qwen-code/packages/cli
Shaojin Wen b420585362
fix(managed-agent): keep runtime MCP state and permission sync honest (#14488)
* fix(managed-agent): keep runtime MCP state and permission sync honest

Clear the recorded runtime-MCP names when the live child that held them is
replaced, so a retired channel does not keep every later session on Legacy.

Diff each settings scope's own rule set when a permission change is
propagated: the merged view carries workspace rules into the User pass, which
then applies them to every session. Make the sync strict for a propagated
change and fail the acknowledgement when a live session rejects a rule, so
the Bridge keeps the channel quarantined instead of lifting the fence.

Refs #14483

(cherry picked from commit 3439ca9da9)

* test(acp-bridge): pin that an added runtime MCP server is observed

The paired selector reads hasRuntimeMcpServers() before it lets a session
select Managed. Pin that a successful workspace-level runtime add is visible
to the bridge.

Refs #14488

* fix(managed-agent): diff the effective permission set for workspace changes

The live permission manager keeps the scopes' rules merged, without provenance. Diffing each scope separately can remove a rule another scope still provides: clearing a workspace deny while the user scope also denies it would make read_file runnable again, and the acknowledgement would hide it. Diff the effective set instead, and keep the workspace filter on the apply.

Refs #14488

* fix(managed-agent): carry the permission scope through a workspace change

A single SettingScope.Workspace pass filtered user-scope deltas out of sessions admitted at another root, such as a worktree session, while still acknowledging the change. Carry the written scope in the change payload and use it to pick the audience: User reaches every live session, Workspace keeps the workspace filter. The content still comes from the effective merged set, so a rule another scope provides is never removed.

Refs #14488

* test(acp-bridge): include the permission scope in the propagated payload

The workspace-change payload now carries the written scope, so the exact assertion in the paired-engine test must include it. This also fixes the failing Test (ubuntu) lane on the same head.

Refs #14488

* test(cli): include the permission scope in the propagated payload

The workspace-change payload now carries the written scope. Update the CLI paired-engine assertion to include it, alongside the acp-bridge one.

Refs #14488
2026-10-18 03:31:31 +00:00
..
scripts fix(cli): bound short OpenTUI scroll dialogs (MYWO-3, MYWO-7) (#14034) 2026-10-14 05:50:41 +00:00
src fix(managed-agent): keep runtime MCP state and permission sync honest (#14488) 2026-10-18 03:31:31 +00:00
.gitignore feat(core): add opt-in built-in web_search backed by the DashScope Responses API (#7215) 2026-07-21 10:59:36 +00:00
index.test.ts feat(managed-agent): Add offline W1b recovery bundles (#13138) 2026-10-02 10:06:28 +00:00
index.ts feat(managed-agent): Add SSH Tool Runtime support (#14318) 2026-10-16 18:18:04 +00:00
package.json chore(release): sdk-typescript v0.1.20 [skip ci] 2026-10-15 17:01:33 +00:00
test-setup.ts fix(ci): route post-merge classifier to ECS and yield CLI workers (#14293) 2026-10-16 17:35:27 +08:00
tsconfig.json feat(channels): add IMAP and SMTP email channel (#12939) 2026-10-03 02:54:25 +00:00
vitest.config.ts feat(web-shell): present structured shell execution results (#12311) 2026-09-21 11:32:42 +00:00