* feat(core): defer agent and goal declarations by default
* docs: clarify existing prompt gating in deferral candidate
* test(core,integration): repair the two suites broken by default deferral
Deferring `agent` and the Goal tools broke two suites that still assumed
the pre-deferral surface:
- `goal-tools.test.ts` registers `ProposeGoalTool` and calls
`getFunctionDeclarations()`, which reaches `isToolDeclared()` and its
unguarded `this.config.isGoalProposalAvailable()`. The local mock config
only stubbed four methods, so the call threw a TypeError. Stub it as
available, which is what the case needs for `propose_goal` to be
declared once visible.
- The tool-restricted subagent E2E asserted that the first streaming
request advertises `agent` with the subagent catalogue in its
description. That no longer holds: `agent` is deferred, and a deferred
tool stays out of the advertised declaration list even after
`tool_search` selects it, so routing this case through discovery could
not restore the assertion. Pin the `tools.visible` contract instead,
which the design doc lists as a supported way to force a declaration up
front.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix(core): preserve agent discovery when deferred
* fix(core): retain deferred Agent guidance
* fix(core): close review findings R1-1/R1-2/R1-8/R1-10 on default deferral
- R1-1: take the prompt tool snapshot after resolveDeferredToolsForReminder()
so the incomplete-bridge eager reveal lands in the declared set, and use
the registration-based bridge check for Agent reachability.
- R1-2: recognise a bridged Agent result under the tool_call envelope by
correlating the response call id with the functionCall in history, so the
#10953 forced active-todo reminder keeps firing.
- R1-8: pin setPromptAgentReachable(false) for sessions with no Agent and
for a permission-deferred Agent withheld by an incomplete bridge.
- R1-10: define the Agent description first line once so the cold-start
catalog copy cannot drift from the assembled, tested copy.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmuofqisz0a
* style(core): apply prettier formatting to client.test.ts
The Lint & Static gate failed at the "Run Prettier" step on this single
file. Rewrap the nested tool_call args object literal so it satisfies the
prettier line-width rule. Formatting only, no behavior change.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmuojnzcnif
* fix(core): give deferred coordination tools self-contained catalog lines
A deferred tool's only up-front surface is its discovery-catalog entry,
which truncateDeferredToolDescription renders as description.split('\n')[0]
capped at MAX_DEFERRED_TOOL_DESC_LEN = 160. get_goal, update_goal,
propose_goal and list_agents were single-paragraph descriptions, so their
catalog entry was a mid-clause slice that dropped the clauses gating their
use. Each now carries a short self-contained first line and keeps the full
text on the lines below, where tool_search select: still returns it
verbatim. The Goal-tool size budget in goal-tools.test.ts is raised from
3800 to 4200 to record that growth as a decision, and a new case pins the
first-line invariant.
Also corrects two documents this change made inaccurate: the
default-deferred coordination design record (EN and zh-CN) claimed
system-prompt gating stays purely declared-tool based, while the same
commit adds Agent reachability as a second input; and the context-cost
page did not say that the all-or-nothing preload budget now has to fit
five more declarations.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmuom604nil
* docs(core): reconcile prompt-gating rule with Agent bridge reachability
The 091672639f rename of `takes the declared set from the Config snapshot`
to `keeps Agent guidance when Agent is bridge-reachable` orphaned three
pointers (both 2026-09-18 design languages and the verification README)
and left the gate-table comment, the monitor test comment, and the design
acceptance criterion stating the old absolute "declared only" rule next to
the agentReachable disjunct that suspends it.
The table comment and the gateToolGuidance JSDoc now state the rule as
"callable in this session", with Agent as the deliberate and only
exception: the delegation and codebase-search bullets are the policy that
sends the model to the bridge to discover Agent, so gating them away would
turn deferral into silent removal. Every other deferred tool's line
(monitor included) still drops, and the monitor test comment now says why
instead of stating the contradictory absolute rule. Both design languages
gain a §4.6 recording the exception and a restated §8 criterion, and the
verification README points at the new test name. No shipped prompt text
changes; prompts.test.ts passes 200/200 and core typechecks clean.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmuoqgbnv0l
* docs(core): apply prettier formatting to resident-tool-prompt-assembly docs
Fixes the Lint & Static prettier gate failure on run 36794724310.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmuoslhfy0n
* fix(cli): preserve deferred agent execution in ACP
* fix(core): close the review-round findings on the deferred-coordination defaults
- client.ts bridged-result correlation: skip refused/cancelled bridge calls
(their response carries `error`, not `output`) so a turn where nothing was
delegated no longer forces the todo reminder and resets the cadence; and
scan history newest-first over the raw entries through the new
LlmChat.findLastHistoryEntry instead of cloning the whole history per send.
- Wire the mock Config's prompt-surface getters to the recorded state and
pin the record-to-read wiring on the surface getCoreSystemPrompt receives.
- Stamp tool_search results during a Goal turn as goal_runtime bookkeeping:
discovery is not evidence about the world and must not enter the
verifier's catalog as an external_fact nor read as finishing-turn progress.
- Deduplicate the deferred-catalog first line from the body opening for
get_goal/update_goal/propose_goal/list_agents (the agent.ts pattern), which
returns the Goal-tools request budget to 3,800.
- Re-baseline the file-work allowlist saving for the two states §4.6
distinguishes: 900-1,400 (measured 1,135) without bridge reachability,
the 317-character monitor policy alone when Agent is bridge-reachable.
- Export isDeferredToolBridgeAvailable and use it at the two client.ts
sites instead of a fifth inline copy; unwrap the hard-wrapped paragraph
in context-cost.md.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix(core): guide deferred Goal continuation and correct prompt checks
* fix(cli): keep the Goal continuation prompt expectation in sync
The two bridge lines this branch adds to the shared Goal continuation
prompt reached the prompt builder in packages/core but not its
expectation in packages/cli, so Test (ubuntu-latest, Node 22.x) failed
`sends a hidden Goal turn without user admission side effects`.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmupibesp19
* test(core): match the deferred coordination tests to production
- goal-tools.test.ts: name a reveal, `tools.visible`, the incomplete-bridge
fallback and the `tools.toolSearch.threshold` preload as the paths that
declare the natively deferred Goal tools, and drop the `tools.eager`
claim the design doc contradicts (R3-7).
- goal-tools.test.ts: drive both code-mode cases with production's
`isDeferredAndHidden` predicate and add the default-session arm that pins
the deferred rendering (R3-9).
- client.test.ts: drop the duplicate `getRegistryMock()` accessor and reach
the suite registry through `registryMock()`/`deferredToolRegistry()`
(R3-4).
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmupibesp19
* docs(design): add the nonzero-threshold arm to the acceptance run
The preload is all-or-nothing over the whole deferred pool, so a
`tools.toolSearch.threshold` that used to reveal every ordinary deferred
tool can now reveal none of them once these five declarations join the
pool. The recipe that gates leaving Draft never measured that
configuration (R3-6); add it to both language versions.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmupibesp19
* style(core): apply prettier to the deferred-tool test helpers
Whitespace-only reflow of the two `deferredToolRegistry` calls added in
the previous commit.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmupibesp19
* test(core): sweep the prompt gate under the bridge-reachable arm
R3-8: the two mechanical prompt-invariant sweeps never entered the one
configuration in which the gated sections may legitimately name an undeclared
tool -- `agentReachable: true` with `agent` withheld -- so a future line that
leaked a second name through that exception branch would pass both, and the
design's §7 item 3 calls those sweeps the config-independent guard.
Both sweeps now run the reachable arm as well: the narrow sweep pins its
leaked set to exactly `agent`, and the every-example-set sweep pins the set of
distinct surviving names to exactly `agent` under that arm and to none under
the unset one, so widening or losing the exception both go red.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmupkgkl21b
* fix(cli): Normalize deferred arguments before headless scheduling
* fix(cli): Keep bridge classification free of validation side effects
* fix(core,cli): close the round-3 findings on the deferred-coordination defaults
- client.ts: narrow the bridged-result exclusion to the bridge's refusal and
cancellation prefixes — a bridged Agent that ran and failed carries a
generic error, and the delegated work still forces the todo reminder,
matching the direct-Agent branch and the seeding pass (R2-9).
- Session.ts: skip the awaited bridge resolution for envelopes once the
turn's abort signal has fired — a cancelled batch's classification work
would be discarded (R4-3).
- Session.test.ts: drive the production schema-review gate in the three ACP
bridge cases (getReviewedDeclaration wired to the live fingerprint) plus a
stale-fingerprint refusal pin, and add the live-PM allow arm of the
bridge-enablement guard (R4-2/R4-4).
- client.test.ts: pin that a non-Agent deferred summary entry does not count
as Agent reachability — the mutant reading `deferredSummary.length > 0`
goes red (R4-7).
- nonInteractiveCli.test.ts: capture and assert the executed request keeps
the envelope identity (R4-6), and pin that a malformed string-arguments
envelope degrades to the bridge's own refusal instead of a synchronous
JSON.parse throw (R4-5).
- docs: §7 item 2 quotes the brackets prompts.test.ts actually asserts
(900-1,500 / 250-450), a self-consistent component split, and the
re-measured narrow-allowlist figures as descriptive, in both languages;
the verification runbook's 818 row now names the reachable recipe
(tools.disabled: ["agent"]) instead of an unreachable condition (R2-4/R4-1).
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* test(cli): type the optional schema-review lookup on the ACP registry mock
34dd9b1408 assigns getReviewedDeclaration on the mock registry in five
tests, but the mock's declared type had no such field, so the cli
build failed with TS2339 and every downstream CI job went red. Declare
it optional so the other tests keep the gate off.
* fix(core): Explain deferred roster discovery in coordination hints
* fix(core,cli): close the round-5 findings on the deferred-coordination defaults
- Session.ts: reveal propose_goal exactly while its turn key is armed and
unreveal on clear — natively deferred, it was otherwise filtered out of
every announcement and undiscoverable in ACP/daemon sessions (R5-1).
- goal-tool-result-provenance.ts: narrow the goal_runtime stamp to select:
lookups naming a Goal tool — keyword discovery about the objective's own
work is evidence the verifier needs and must keep its ordinary stamp
(R5-2).
- Session.ts: align the ACP observation arm with the core client's
exclusion — a cancelled bridged call means nothing was delegated and must
not force the reminder (R5-3).
- docs: fix the component-split arithmetic against the measured total, both
languages (R2-4 carried).
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix(core): widen the Goal tool set so canonicalToolName's string is accepted
`new Set([ToolNames.GET_GOAL, ToolNames.UPDATE_GOAL, ToolNames.PROPOSE_GOAL])`
infers Set<"get_goal" | "update_goal" | "propose_goal">, so the
`.has(canonicalToolName(name.trim()))` membership test -- canonicalToolName
returns string -- failed to compile with TS2345. That broke the packages/core
build, which every CI job runs through `prepare`, so Lint & Static, Test,
Integration Tests, web-shell E2E, the Java daemon lane and both TUI gates all
died in their install/build step on head b8df6af78d.
Annotate the set as Set<string>, matching the existing convention in
followup/speculationToolGate.ts, memory/refresh.ts and permissions/autoMode.ts.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmurvoyy91t
* fix(core): classify Goal discovery from returned schemas
* fix(core): match bridged Agent names for todo reminders
* fix(core): preserve bridged tool execution evidence
* fix(agent): align frontend bridge execution markers
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
---------
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: yiliang114 <yiliang114@users.noreply.github.com>