fix(managed-agent): refuse to acknowledge a skipped tightening change

A settings reload applies to idle sessions only. For a tightening change, a
session the reload skipped still holds the old revision, so answering the
exact revision would let the Bridge lift its quarantine without the change
having reached that session. Leave the request unanswered instead, which
keeps the channel quarantined and the failure closed.

Refs #12737
This commit is contained in:
Shaojin Wen 2026-10-17 23:29:21 +08:00
parent a22d58f1fd
commit 3439ca9da9

View file

@ -10684,12 +10684,26 @@ class QwenAgent implements Agent {
);
break;
}
case 'settings':
await this.extMethodInternal(
case 'settings': {
const reloaded = await this.extMethodInternal(
SERVE_CONTROL_EXT_METHODS.workspaceReload,
{ cwd: changeCwd },
);
// A tightening change that skipped a live session has not
// reached it: acknowledge nothing, so the Bridge keeps the
// channel quarantined instead of lifting the fence.
const skipped = reloaded['sessionsSkipped'];
if (
params['tightening'] === true &&
Array.isArray(skipped) &&
skipped.length > 0
) {
throw new Error(
`The settings change did not reach ${skipped.length} live session(s).`,
);
}
break;
}
case 'sessionWorkflow':
await this.extMethodInternal(
SERVE_CONTROL_EXT_METHODS.workspaceSessionWorkflow,