Skip to content

Commit 4aa7d1e

Browse files
qqqysqwen-code-dev-botwenshaoQwen Code BotQwen Code Autofix
authored
feat(cli): adopt Goal v3 in interactive TUI (#8005)
* feat(cli): adopt Goal v3 in interactive TUI * fix(cli): restore Goal CI contracts * fix(cli): stop a queued message from stalling the Goal loop (#8005) Reserve the next Goal turn only for a user batch the queue will actually release: peekNextUserBatchKey now mirrors the two-lane drain gate, so an active Goal turn no longer binds a permit to a held plain message and the loop keeps running. Also release the Goal turn binding on the background-capacity early return, drop a redundant getSteerInput spread, recognise the legacy /goal clear aliases in interactive mode, and restore the rollback assertion for loadPausedBackgroundAgents. * fix(cli): address review feedback on Goal queue and retry hint (#8005) * fix(cli): restore Goal trust gate and address review feedback (#8005) * fix(cli): address Goal review feedback on cancel release, icons, claim gate (#8005) * fix(cli): address Goal review feedback on non-interactive guard, icons, and drain retry (#8005) * fix(cli): address review feedback on Goal v3 TUI (#8005) - Strip 'set' keyword before forwarding to legacy path in non-interactive /goal set, preventing the keyword from leaking into the goal condition - Add goalTerminalErrorRef to prevent post-stream cleanup from wiping Goal turn terminal errors - Add 50-turn continuation budget to Goal runtime, matching the legacy MAX_GOAL_ITERATIONS cap - Display verifier rejection status cards (verifier_reject cause) - Clear stale lastReason when editing a goal objective * fix(test): align client-goal turn count with continuation budget (#8005) * fix(cli): address Goal set-clear and delivery-error review feedback (#8005) Non-interactive `/goal set <clear-keyword>` now sets a literal objective instead of clearing the active goal, by bypassing the clear-keyword check for explicit set operations. Goal-turn stream errors now fire onDeliveryFailed rather than onDelivered by including goalTerminalErrorRef in the post-stream delivery dispatch. * fix(cli): rename misleading missingActiveGoalContext variable (#8005) * fix(cli): stop Goal queue from stranding input and orphaning prompts (#8005) Only an active Goal turn holds ordinary input now; paused, blocked and usage_limited states drain the queue normally so a user whose Goal is merely paused (e.g. via Escape) is never stranded waiting for /goal clear. A cancelled Goal continuation turn also strips its synthetic "no new real user input" prompt from the chat history. Previously the auto-restore branch bailed before its orphan strip ran (Goal turns add no UI user item), so the preamble survived and appendCuratedContent merged the user's next real message into it. * fix(core): address Goal resume-budget and mid-turn clear review feedback (#8005) Resuming a Goal that exhausted its 50-turn continuation budget was accepted and reported as `active`, then immediately re-transitioned to `usage_limited` without running a turn: the resume branch kept the exhausted `turnCount`, which `queueContinuation` re-checks. Resume now resets `turnCount` so an explicit resume grants a fresh continuation budget and the reported outcome matches the settled one. A mid-turn `/goal clear` with no active Goal was silently swallowed because its causeless `goal_control` result rendered only when idle. The handler now renders any causeless result (a `status` read or a no-Goal `clear`), which never broadcasts and so cannot double-render. * test(cli): cover Goal tool-batch fail-close guards (#8005) * fix(core,cli): guard budget-exhaustion identity and pass goalContext to tool-result recording (#8005) The budget-exhaustion callback in queueContinuation only checked goal status, not identity. A replace dispatched during the journal append could create a fresh goal that the stale callback then incorrectly usage-limited. Capture goalId/revision at enqueue time and return early on mismatch, matching the existing identity-guard pattern used by handleStartFailure and recordVerificationOutcome. The TUI recorded tool results without goalContext, so the evidence catalog never admitted tool-result records and any Goal whose objective depended on external state could not be verified. Pass request.goalContext at both recordToolResult call sites in useGeminiStream, tagging get_goal/update_goal results as goal_runtime to match the CoreToolScheduler pattern. --------- Co-authored-by: qwen-code-dev-bot <269191875+qwen-code-dev-bot@users.noreply.github.com> Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com> Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com> Co-authored-by: Qwen Code Autofix <qwen-code-autofix@users.noreply.github.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com> Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com>
1 parent 933d78a commit 4aa7d1e

47 files changed

Lines changed: 5629 additions & 1174 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/cli/src/i18n/locales/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,6 +2473,7 @@ export default {
24732473
'Set how hard reasoning-capable models think ({{tiers}}); mapped and clamped per provider.',
24742474
'Set a goal — keep working until the condition is met':
24752475
'Set a goal — keep working until the condition is met',
2476+
'Set or control a session goal': 'Set or control a session goal',
24762477
'Exited plan mode. Previous approval mode restored.':
24772478
'Exited plan mode. Previous approval mode restored.',
24782479
'Enabled plan mode. The agent will analyze and plan without executing tools.':

packages/cli/src/i18n/locales/zh-TW.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,7 @@ export default {
20102010
'設定具備推理能力的模型思考的強度({{tiers}});依各供應商進行映射與鉗制。',
20112011
'Set a goal — keep working until the condition is met':
20122012
'設定目標 — 持續工作直到條件滿足',
2013+
'Set or control a session goal': '設定或控制工作階段目標',
20132014
'Exited plan mode. Previous approval mode restored.':
20142015
'已退出計劃模式,已恢復之前的審批模式。',
20152016
'Enabled plan mode. The agent will analyze and plan without executing tools.':

packages/cli/src/i18n/locales/zh.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,7 @@ export default {
22162216
'设置具备推理能力的模型思考的强度({{tiers}});按各提供方进行映射与钳制。',
22172217
'Set a goal — keep working until the condition is met':
22182218
'设定目标 — 持续工作直到条件满足',
2219+
'Set or control a session goal': '设定或控制会话目标',
22192220
'Exited plan mode. Previous approval mode restored.':
22202221
'已退出计划模式,已恢复之前的审批模式。',
22212222
'Enabled plan mode. The agent will analyze and plan without executing tools.':

packages/cli/src/nonInteractiveCliCommands.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ function handleCommandResult(
187187
originalType: 'confirm_action',
188188
};
189189

190+
case 'goal_control':
191+
return {
192+
type: 'unsupported',
193+
reason: 'Goal control is not supported in non-interactive mode yet.',
194+
originalType: 'goal_control',
195+
};
196+
190197
default: {
191198
// Exhaustiveness check
192199
const _exhaustive: never = result;

0 commit comments

Comments
 (0)