mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(claude): add effort setting parity with model across stack (#353)
Co-authored-by: Xiaoyi <xiaoyizhang@microsoft.com>
This commit is contained in:
@@ -188,6 +188,7 @@ export class SyncEngine {
|
||||
mode?: 'local' | 'remote'
|
||||
permissionMode?: PermissionMode
|
||||
model?: string | null
|
||||
effort?: string | null
|
||||
collaborationMode?: CodexCollaborationMode
|
||||
}): void {
|
||||
this.sessionCache.handleSessionAlive(payload)
|
||||
@@ -211,8 +212,15 @@ export class SyncEngine {
|
||||
this.machineCache.reloadAll()
|
||||
}
|
||||
|
||||
getOrCreateSession(tag: string, metadata: unknown, agentState: unknown, namespace: string, model?: string): Session {
|
||||
return this.sessionCache.getOrCreateSession(tag, metadata, agentState, namespace, model)
|
||||
getOrCreateSession(
|
||||
tag: string,
|
||||
metadata: unknown,
|
||||
agentState: unknown,
|
||||
namespace: string,
|
||||
model?: string,
|
||||
effort?: string
|
||||
): Session {
|
||||
return this.sessionCache.getOrCreateSession(tag, metadata, agentState, namespace, model, effort)
|
||||
}
|
||||
|
||||
getOrCreateMachine(id: string, metadata: unknown, runnerState: unknown, namespace: string): Machine {
|
||||
@@ -283,6 +291,7 @@ export class SyncEngine {
|
||||
config: {
|
||||
permissionMode?: PermissionMode
|
||||
model?: string | null
|
||||
effort?: string | null
|
||||
collaborationMode?: CodexCollaborationMode
|
||||
}
|
||||
): Promise<void> {
|
||||
@@ -294,6 +303,7 @@ export class SyncEngine {
|
||||
applied?: {
|
||||
permissionMode?: Session['permissionMode']
|
||||
model?: Session['model']
|
||||
effort?: Session['effort']
|
||||
collaborationMode?: Session['collaborationMode']
|
||||
}
|
||||
}
|
||||
@@ -314,9 +324,21 @@ export class SyncEngine {
|
||||
yolo?: boolean,
|
||||
sessionType?: 'simple' | 'worktree',
|
||||
worktreeName?: string,
|
||||
resumeSessionId?: string
|
||||
resumeSessionId?: string,
|
||||
effort?: string
|
||||
): Promise<{ type: 'success'; sessionId: string } | { type: 'error'; message: string }> {
|
||||
return await this.rpcGateway.spawnSession(machineId, directory, agent, model, modelReasoningEffort, yolo, sessionType, worktreeName, resumeSessionId)
|
||||
return await this.rpcGateway.spawnSession(
|
||||
machineId,
|
||||
directory,
|
||||
agent,
|
||||
model,
|
||||
modelReasoningEffort,
|
||||
yolo,
|
||||
sessionType,
|
||||
worktreeName,
|
||||
resumeSessionId,
|
||||
effort
|
||||
)
|
||||
}
|
||||
|
||||
async resumeSession(sessionId: string, namespace: string): Promise<ResumeSessionResult> {
|
||||
@@ -386,7 +408,8 @@ export class SyncEngine {
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
resumeToken
|
||||
resumeToken,
|
||||
session.effort ?? undefined
|
||||
)
|
||||
|
||||
if (spawnResult.type !== 'success') {
|
||||
|
||||
Reference in New Issue
Block a user