From 3532638db35e303388a1ad2bd528b23192bae7b5 Mon Sep 17 00:00:00 2001 From: qqqys Date: Wed, 2 Sep 2026 15:39:02 +0800 Subject: [PATCH 1/2] docs(goals): sync the Goal docs with the current runtime Four statements in the Goal docs no longer match the code. The headless note said ACP still uses the legacy Goal command path. ACP adopted the v3 runtime in #8732: it drives the same runtime through the sessionGoalControl extension method and pushes every status change as a session/update notification carrying _meta.goalState. The propose_goal section said the tool refuses in subagents. It is never registered there at all: registerGoalWorkerTools returns early when forSubAgent is set, so a subagent has no get_goal, update_goal, or propose_goal to refuse. The objective guidance gave one 1,200-character figure without saying where it comes from. /goal set and /goal edit do not check length at all; propose_goal caps the objective at 1,500 characters. Both facts now appear, with the 1,200 recommendation kept as guidance because the objective is re-sent on every Goal turn. The introduction implied a verifier runs after every turn. It runs only when the model proposes a terminal status through update_goal; an ordinary turn just records evidence. The /goal row in the command table also listed only two of its six forms. --- docs/users/features/commands.md | 2 +- docs/users/features/goals.md | 6 +++--- docs/users/features/headless.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/users/features/commands.md b/docs/users/features/commands.md index 481a82e147c2..12f85a2cb0ed 100644 --- a/docs/users/features/commands.md +++ b/docs/users/features/commands.md @@ -119,7 +119,7 @@ Commands for managing AI tools and models. | `/permissions` | Manage permission rules | `/permissions` | | `/agents` | Manage subagents | `/agents manage`, `/agents create` | | `/arena` | Manage Arena sessions | `/arena start`, `/arena stop`, `/arena status`, `/arena select` (alias `choose`) | -| `/goal` | Set a goal — keep working until condition met (see [Goals](./goals.md)) | `/goal `, `/goal clear` | +| `/goal` | Set a Goal — keep working until a verifier confirms it (see [Goals](./goals.md)) | `/goal `, `/goal edit `, `/goal pause`, `/goal resume`, `/goal clear` | | `/tasks` | List background tasks | `/tasks` | | `/workflows` | Inspect workflow runs; cooperatively pause/resume a background run | `/workflows`, `/workflows `, `/workflows p ` | | `/lsp` | Show LSP server status | `/lsp` | diff --git a/docs/users/features/goals.md b/docs/users/features/goals.md index 52b829074548..7716f7fbb694 100644 --- a/docs/users/features/goals.md +++ b/docs/users/features/goals.md @@ -1,6 +1,6 @@ # Goals -A Goal keeps Qwen Code working across turns until a stated condition is met. Set one with `/goal `; after each turn an independent verifier checks the transcript, and the session keeps going until the objective is verified complete, verified blocked, paused, or cleared. +A Goal keeps Qwen Code working across turns until a stated condition is met. Set one with `/goal `, and the session keeps going on its own. Each turn is recorded as evidence; when the model proposes that the objective is complete or blocked, an independent verifier judges that proposal from the evidence alone. The session stops when the verifier accepts, or when the Goal is paused, cleared, or stopped by a limit. ## Commands @@ -40,7 +40,7 @@ Put these into the objective, in this order: | `On block:` | What to report when stuck, and which decision a human must make. | | `Context:` | Only facts the agent cannot find in the workspace: branch, environment, earlier decisions. | -Keep it to one objective and roughly under 1,200 characters. `/goal set` and `/goal edit` collapse newlines to spaces, so number the items rather than relying on line breaks. +Keep it to one objective. `/goal set` and `/goal edit` accept any length, but stay roughly under 1,200 characters: the objective is re-sent on every Goal turn. An objective the model proposes through `propose_goal` is capped at 1,500 characters. Both commands collapse newlines to spaces, so number the items rather than relying on line breaks. | Weak | Why it fails | Stronger | | -------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -57,7 +57,7 @@ Pass an existing objective to tighten it: `/goal-draft all tests pass and the li ### Approve a Goal the model proposes -In an interactive terminal session the model has a `propose_goal` tool. When `/goal-draft` finishes, or when you ask for an outcome that spans several turns, it can propose the objective instead of printing a `/goal set …` line for you to copy. The proposal appears as an approval dialog showing the full objective. Approving it sets the Goal exactly as `/goal set` would, the moment the current turn ends (the model acknowledges and stops; the first Goal turn then starts on its own), and declining sets nothing — the model is told only that the Goal was not set, and must not propose it again. The approval is bound to the turn that asked for it: if that turn is cancelled or otherwise never reaches its end, the approval is dropped rather than applied under a later message or an automated turn. No permission rule or approval mode (including YOLO) skips this dialog, and the tool refuses while another Goal is active, in plan mode, in subagents, and in untrusted folders. It is not available in headless runs, nor yet in Web Shell or other ACP-driven sessions (they do not pass through the turn boundary that applies the approval); there the printed `/goal set` line remains the hand-off. +In an interactive terminal session the model has a `propose_goal` tool. When `/goal-draft` finishes, or when you ask for an outcome that spans several turns, it can propose the objective instead of printing a `/goal set …` line for you to copy. The proposal appears as an approval dialog showing the full objective. Approving it sets the Goal exactly as `/goal set` would, the moment the current turn ends (the model acknowledges and stops; the first Goal turn then starts on its own), and declining sets nothing — the model is told only that the Goal was not set, and must not propose it again. The approval is bound to the turn that asked for it: if that turn is cancelled or otherwise never reaches its end, the approval is dropped rather than applied under a later message or an automated turn. No permission rule or approval mode (including YOLO) skips this dialog, and the tool refuses while another Goal is active, in plan mode, and in untrusted folders; subagents are never offered it. It is not available in headless runs, nor yet in Web Shell or other ACP-driven sessions (they do not pass through the turn boundary that applies the approval); there the printed `/goal set` line remains the hand-off. Turn it off with `goals.modelProposed: "disabled"` in your user settings. Because the setting decides whether the model may ask you to start an autonomous loop, it is honored only from user and system scope; a workspace `.qwen/settings.json` value is ignored with a warning. diff --git a/docs/users/features/headless.md b/docs/users/features/headless.md index 694d44ca17bb..2750ed8d22c0 100644 --- a/docs/users/features/headless.md +++ b/docs/users/features/headless.md @@ -89,7 +89,7 @@ With `--output-format stream-json`, each Goal status change emits a `stream_even > [!note] > -> This behavior applies to standard headless CLI runs. ACP still uses the legacy Goal command path. +> This behavior applies to standard headless CLI runs. ACP-driven sessions (IDE integrations, Web Shell) drive the same Goal runtime through the `sessionGoalControl` extension method, and receive each status change as a `session/update` notification carrying `_meta.goalState` instead of a `goal_state` stream event. ## Customize the Main Session Prompt From 7de45f0d4682ee69d35c6490896f20e4a7161821 Mon Sep 17 00:00:00 2001 From: qqqys Date: Wed, 2 Sep 2026 17:44:13 +0800 Subject: [PATCH 2/2] docs(goals): correct what the model is told when a Goal proposal is declined The propose_goal section said that on a decline "the model is told only that the Goal was not set, and must not propose it again". The message it describes is unreachable: a declined dialog resolves as a cancel outcome, and the tool scheduler settles the call as cancelled without ever entering the tool's execute(). What the model receives is the scheduler's own cancellation notice. What actually stops it from re-proposing is the tool description, which already tells it the decision will not be reported and the same objective must not be proposed again. The sentence now says that. --- docs/users/features/goals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users/features/goals.md b/docs/users/features/goals.md index 7716f7fbb694..d93fd89bbe10 100644 --- a/docs/users/features/goals.md +++ b/docs/users/features/goals.md @@ -57,7 +57,7 @@ Pass an existing objective to tighten it: `/goal-draft all tests pass and the li ### Approve a Goal the model proposes -In an interactive terminal session the model has a `propose_goal` tool. When `/goal-draft` finishes, or when you ask for an outcome that spans several turns, it can propose the objective instead of printing a `/goal set …` line for you to copy. The proposal appears as an approval dialog showing the full objective. Approving it sets the Goal exactly as `/goal set` would, the moment the current turn ends (the model acknowledges and stops; the first Goal turn then starts on its own), and declining sets nothing — the model is told only that the Goal was not set, and must not propose it again. The approval is bound to the turn that asked for it: if that turn is cancelled or otherwise never reaches its end, the approval is dropped rather than applied under a later message or an automated turn. No permission rule or approval mode (including YOLO) skips this dialog, and the tool refuses while another Goal is active, in plan mode, and in untrusted folders; subagents are never offered it. It is not available in headless runs, nor yet in Web Shell or other ACP-driven sessions (they do not pass through the turn boundary that applies the approval); there the printed `/goal set` line remains the hand-off. +In an interactive terminal session the model has a `propose_goal` tool. When `/goal-draft` finishes, or when you ask for an outcome that spans several turns, it can propose the objective instead of printing a `/goal set …` line for you to copy. The proposal appears as an approval dialog showing the full objective. Approving it sets the Goal exactly as `/goal set` would, the moment the current turn ends (the model acknowledges and stops; the first Goal turn then starts on its own), and declining sets nothing — the model sees only that the tool call was not allowed, and its instructions tell it not to ask why and not to propose the same objective again. The approval is bound to the turn that asked for it: if that turn is cancelled or otherwise never reaches its end, the approval is dropped rather than applied under a later message or an automated turn. No permission rule or approval mode (including YOLO) skips this dialog, and the tool refuses while another Goal is active, in plan mode, and in untrusted folders; subagents are never offered it. It is not available in headless runs, nor yet in Web Shell or other ACP-driven sessions (they do not pass through the turn boundary that applies the approval); there the printed `/goal set` line remains the hand-off. Turn it off with `goals.modelProposed: "disabled"` in your user settings. Because the setting decides whether the model may ask you to start an autonomous loop, it is honored only from user and system scope; a workspace `.qwen/settings.json` value is ignored with a warning.