Files
deepseek-harness/examples/plan-acp-agent/cordis.yml
kingwl edc065666f feat(mode): exit_plan_mode + the ACP session-mode picker + scriptable review answers
Plan mode's stage 2 (RFC 2026-07-07-plan-mode). The exit tool: one
required plan argument (the durable log artifact), execute re-checks the
folded mode, then conducts the review over the user-interaction seam —
one single-select question (Approve / Keep planning) with free text open
— so an approval appends mode/set back to default in-turn and every
other outcome (keep-planning feedback verbatim, aborted, no provider)
returns the corrective isError with the mode unchanged. presentCall is a
generic card titled by the plan's first heading carrying the plan
markdown; over ACP the review rides the ask_user elicitation flow, in
the terminal the stdio prompt queue — no approval-seam dependency.

The ACP bridge maps the picker 1:1 onto ctx.modes (opportunistic, a
type-only peer edge): session/new + session/load advertise
availableModes/currentModeId, session/set_mode validates through set()
and echoes an optimistic current_mode_update (the pending mode IS the
selection; the logged mode/set lands at the boundary and, matching, is
not re-sent), and a session/event listener re-notifies on each logged
flip that differs from the last sent — the tool-driven exit updates the
picker. The feature matrix rows move from 'not modeled' to the
picker-to-modes / knobs-to-config-options division, with the ACP v2
removal direction recorded as a mechanical-migration risk.

The snapshot harness gains the setMode/setModeExpectError ops and a
scripted elicitationAnswers FIFO (cancel on exhaustion; a stray choice
string reaches the agent verbatim as a non-consenting custom answer, so
a scenario bug fails safe). The suite factory's header-pin requirement
now applies only to model-turn scenarios — a protocol-only suite has no
header content to anchor. examples/plan-acp-agent is the live
composition; its keyless modes-advertise scenario pins the wire surface
(advertisement, both set_mode round-trips, unknown-id rejection). The
recorded plan-mode approve/reject arc awaits a with-key recording
session; its texts are pinned at the unit tier meanwhile.

examples/AGENTS.md ceiling 653 → 680: the new example's required smoke
row does not fit the old budget.
2026-07-10 02:57:40 +08:00

66 lines
2.6 KiB
YAML

# The plan-acp-agent plugin tree: the coding agent served over the Agent
# Client Protocol WITH session modes composed — the plan-mode RFC's live
# composition. The editor's mode picker (session/set_mode) switches the
# session between `default` and `plan`; in plan mode the model works under the
# read-only allowlist and leaves through the user-reviewed exit_plan_mode tool
# (the review rides the same elicitation flow as ask_user_question).
#
# CRITICAL: this tree loads NO stdout logger and NO hmr — stdout is reserved
# for the ACP JSON-RPC protocol (a property of @deepseek-ai/dsh-acp-agent,
# same as examples/acp-agent).
#
# Requires DEEPSEEK_API_KEY (and optionally DEEPSEEK_BASE_URL) — the
# dsh-acp-agent bin loads the gitignored repo-root .env first (on STDERR only).
# The DeepSeek adapter.
- id: llm-deepseek
name: '@deepseek-ai/dsh-llm-deepseek'
config:
apiKey: !!js process.env.DEEPSEEK_API_KEY
baseURL: !!js process.env.DEEPSEEK_BASE_URL
models:
- deepseek-v4-flash
# The ACP server app: the agent-core spine + JSONL persistence + the ACP
# bridge (which advertises the mode picker and answers the plan review).
- id: acp-agent
name: '@deepseek-ai/dsh-acp-agent'
config:
model: deepseek-v4-flash
# Persistence root: $DSH_SNAPSHOT_SESSIONS_ROOT when the snapshot harness
# sets it (so a record run's logs land where the harness harvests them),
# else the local ./.sessions default.
persistenceRoot: !!js process.env.DSH_SNAPSHOT_SESSIONS_ROOT ?? './.sessions'
persona: |
You are a coding assistant powered by the {{model}} model. Your working
directory is {{cwd}}.
Verify your work by running the code or tests. Keep answers brief and
factual.
# Session modes (ctx.modes — the shipped `plan` definition, no overrides): the
# mode/set vocabulary, the assemble filter + mode section, the pre-execute
# gate, and the exit_plan_mode tool. The ACP bridge above reads it
# opportunistically and advertises the picker.
- id: mode
name: '@deepseek-ai/dsh-mode'
# Filesystem capability stack: local provider, read-before-write/edit policy
# gate, then the model-facing read/write/edit tools — `read` is on plan mode's
# allowlist; `write`/`edit` are what the plan-mode gate denies.
- id: fs-local
name: '@deepseek-ai/dsh-fs-local'
config:
cwd: !!js process.cwd()
- id: fs-policy
name: '@deepseek-ai/dsh-fs-policy'
- id: tool-fs
name: '@deepseek-ai/dsh-tool-fs'
# The model-facing todo_write tool — allowlisted in plan mode, so the model
# can track its plan while exploring.
- id: tool-todo
name: '@deepseek-ai/dsh-tool-todo'