fix(goal): preserve interactive human turns

This commit is contained in:
Tianyi Cui
2026-07-20 08:47:05 +08:00
parent 134199c00f
commit 89f9900be1
15 changed files with 163 additions and 89 deletions

View File

@@ -1,4 +1,4 @@
/** Deterministic adapter that creates, reads, then pauses one goal. */
/** Deterministic adapter that creates, reads, pauses, then acknowledges one goal. */
import type { Context } from 'cordis'
import { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
@@ -75,7 +75,7 @@ class GoalScriptAdapter extends LlmAdapter {
if (goal === undefined) throw new Error('scripted goal state missing')
return toolCall('update_goal', { goal_id: goal.id, revision: goal.revision, action: 'pause' })
}
if (prompt.text === 'pause') return textReply('UNEXPECTED CONTINUATION AFTER PAUSE')
if (prompt.text === 'pause') return textReply('GOAL PAUSED')
return textReply('UNEXPECTED PROMPT')
}
}