qwen-code/packages
qqqys bf123a375a
fix(goal): converge the three continuation prompts on one guarded contract (#9834)
* refactor(goal): render Goal continuation prompts from one core renderer

The prompt sent when `runtime.finishTurn` schedules another Goal turn was
assembled independently in three hosts: the TUI's inline array in
`useGeminiStream`, and a `buildGoalContinuationParts` in each of the ACP
session and the non-interactive CLI. Three copies of the same four shared
lines have already drifted -- the TUI carries the anti-spoofing guard lines
but no objective, while ACP and non-interactive carry the runtime
continuation context but no guard lines.

Upcoming work adds further variants (an "objective was edited" announcement
and a budget wind-down prompt). With the text living in three places, every
new variant means three edits, which is precisely how the current drift was
produced. This moves assembly into `packages/core/src/goals/goal-continuation-prompt.ts`,
where a variant is a case in one function and the shared prefix exists once.
The two `buildGoalContinuationParts` helpers keep their names and signatures
and simply delegate.

This is a pure refactor: no prompt text changes. Each host still emits a
byte-identical string to the one it emitted before. The existing drift is
preserved deliberately and is left for a separate, behavior-changing
follow-up. The new unit test pins the complete rendered string for both
variants with and without verifier feedback, so any future edit to a line
surfaces as a test diff; the existing host tests pass unmodified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(goal): tighten continuation renderer contract

* test(goal): cover verifier feedback hosts

* refactor(goal): hoist Goal continuation parts builder into core (#9581)

* fix(goal): converge the three continuation prompts on one guarded contract

Every automatic Goal turn now renders the same prompt in every host: the
runtime-supplied goalId, revision and objective as an escaped JSON data
block, framed as untrusted task data, under both anti-spoofing guard
lines, followed by a line stating the block supersedes any earlier
objective in the conversation.

Before this change the drift ran the wrong way. ACP and non-interactive
interpolated the raw objective into a synthetic user-role turn carrying
neither guard line; the TUI carried both guard lines but dropped the
objective, so the host that guarded most gave up information and the two
that guarded least were the exposed ones. None of the three escaped the
objective, so objective text shaped like a tag could break out of the
surrounding prompt.

The prompt input collapses to a single flat shape, so the variant
discriminant and its unreachable-default arm are gone. `<`, `>` and `&`
are escaped inside the serialized JSON so an objective cannot close the
data block or open one of its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: qqqys <266654365+qqqys@users.noreply.github.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
2026-08-24 17:38:29 +00:00
..
acp-bridge fix(acp-bridge): Disable permission timeout by default (#9933) 2026-08-24 16:08:44 +00:00
audio-capture chore(release): v0.22.0 (#9736) 2026-08-22 15:23:02 +00:00
channels fix(dingtalk): parse forwarded chat records (#9339) 2026-08-23 18:21:41 +00:00
chrome-extension feat(serve): add --open-with-auth (#9738) 2026-08-24 07:33:05 +00:00
cli fix(goal): converge the three continuation prompts on one guarded contract (#9834) 2026-08-24 17:38:29 +00:00
core fix(goal): converge the three continuation prompts on one guarded contract (#9834) 2026-08-24 17:38:29 +00:00
cua-driver feat(cua-driver): add versioned Computer Use SDK and release pipeline (#9587) 2026-08-23 14:20:14 +00:00
desktop feat(mcp): add MCP 2026 core and WebShell Apps host (#8992) 2026-08-23 18:34:30 +00:00
desktop-shell feat: consolidate Local Control into one daemon-owned implementation (#9106) 2026-08-17 16:44:48 +00:00
mobile-mcp chore(deps): Clear high-severity CVE baseline and harden the security gate (#9584) 2026-08-21 07:43:32 +00:00
node-repl feat(computer-use): replace built-in tools with bundled skill (#9856) 2026-08-24 11:05:23 +00:00
sdk-java refactor: centralize approval mode contracts (#9796) 2026-08-24 07:46:50 +00:00
sdk-python refactor: centralize approval mode contracts (#9796) 2026-08-24 07:46:50 +00:00
sdk-typescript docs(sdk): fix query timeout example signature (#9867) 2026-08-24 12:40:05 +00:00
vscode-ide-companion fix(acp-bridge): Disable permission timeout by default (#9933) 2026-08-24 16:08:44 +00:00
web-shell feat(computer-use): replace built-in tools with bundled skill (#9856) 2026-08-24 11:05:23 +00:00
web-templates chore(release): v0.22.0 (#9736) 2026-08-22 15:23:02 +00:00
webui feat(scheduled-tasks): allow creating a task with an existing session (#9361) 2026-08-24 02:23:45 +00:00
zed-extension