refactor(examples): fold plan mode into ACP demo

This commit is contained in:
Tianyi Cui
2026-07-21 00:40:15 +08:00
parent 0022979e4c
commit c3f4332b8d
96 changed files with 990 additions and 364 deletions
+14
View File
@@ -50,6 +50,20 @@ function snapshotModeFromEnv(value: string | undefined): SnapshotSuiteOptions['m
const SCENARIOS: Scenario[] = [
{ name: 'handshake', hasModelTurn: false, recorded: false },
{ name: 'reject-extra-dirs', hasModelTurn: false, recorded: false },
// Protocol-only (keyless, authored): session/new advertises the mode picker,
// session/set_mode acknowledges a valid selection, and an unknown mode id
// fails loudly. With no model turn, its membership in the plan header class
// is vacuous; the class still needs one explicit pin below.
{ name: 'modes-advertise', hasModelTurn: false, recorded: false, headerClass: 'plan' },
// The plan header pin covers the full arc: setMode(plan), a real read under
// the independently configured sandbox, plan review through exit_plan_mode,
// an approved boundary flip back to default, and a real edit in the next
// step. Leaving plan removes the policy section and exit tool, producing one
// changed request header.
{ name: 'plan-mode', hasModelTurn: true, recorded: true, pinsHeader: true, headerClass: 'plan', expectedHeaderChanges: 1 },
// Free-text review feedback returns as a corrective error and leaves the
// session in plan mode, so this scenario shares the pinned plan header.
{ name: 'plan-mode-reject', hasModelTurn: true, recorded: true, headerClass: 'plan' },
// text-turn is the pinned-header scenario: the minimal single text turn.
// Its prompt and tool-schema sidecars pin the composed header.
{ name: 'text-turn', hasModelTurn: true, recorded: true, pinsHeader: true },