mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
Unify agent flavor definitions
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* - No E2E encryption; data is stored as JSON in SQLite
|
||||
*/
|
||||
|
||||
import type { LocalResumeTarget, ResumableSession } from '@hapi/protocol'
|
||||
import { isKnownFlavor, type LocalResumeTarget, type ResumableSession } from '@hapi/protocol'
|
||||
import type { AgentFlavor, CodexCollaborationMode, DecryptedMessage, PermissionMode, Session, SyncEvent } from '@hapi/protocol/types'
|
||||
import { unwrapRoleWrappedRecordEnvelope } from '@hapi/protocol/messages'
|
||||
import type { Server } from 'socket.io'
|
||||
@@ -459,7 +459,7 @@ export class SyncEngine {
|
||||
async spawnSession(
|
||||
machineId: string,
|
||||
directory: string,
|
||||
agent: 'claude' | 'codex' | 'cursor' | 'gemini' | 'opencode' = 'claude',
|
||||
agent: AgentFlavor = 'claude',
|
||||
model?: string,
|
||||
modelReasoningEffort?: string,
|
||||
yolo?: boolean,
|
||||
@@ -486,9 +486,7 @@ export class SyncEngine {
|
||||
|
||||
private resolveFlavor(session: Session): AgentFlavor {
|
||||
const flavor = session.metadata?.flavor
|
||||
return flavor === 'codex' || flavor === 'gemini' || flavor === 'opencode' || flavor === 'cursor'
|
||||
? flavor
|
||||
: 'claude'
|
||||
return isKnownFlavor(flavor) ? flavor : 'claude'
|
||||
}
|
||||
|
||||
private resolveAgentResumeId(session: Session, namespace: string): string | null {
|
||||
|
||||
Reference in New Issue
Block a user