Two merge-blocking bugs in the shared in-process run driver, both rooted in `readResult` scanning the whole child session and deriving the stop reason only from `turn/end`: - A pre-turn `cancel()` cleared the queued prompt before any `turn/end` was logged, so the run settled `error` instead of `aborted`, violating the `SubagentRun.cancel()` contract. The driver now tracks that a cancel was requested and maps the no-turn case to `aborted`. - A fork child whose own turn produced no `assistant/message` returned the SEEDED parent's last message as a `completed` success. `readResult` now scopes to the child's OWN events (after the seed prefix), so a message-less child yields empty output. Both fixes carry a regression test proven to go red on the pre-fix driver. Also: correct the `SubagentRun.id` / event-payload docs (it is the child AGENT id, not a session id — the backend mints distinct tokens); refresh the stale `coding-agent` welcome string (subagent is now a tool); and replace the stale `TODO(sub-agents)` "deferred" prose in the Agent interface, core.md, and architecture.md with an accurate pointer to the realized seam.
83 lines
3.5 KiB
YAML
83 lines
3.5 KiB
YAML
# The coding-agent plugin tree: the real coding agent. The two swappable
|
|
# backends — the DeepSeek adapter and the local bash executor — plus `hmr` for
|
|
# the dev/demo reload loop, then the stdio chat app (@deepseek-ai/dsh-stdio-
|
|
# agent), which bundles the whole agent-core spine (timer, llm, sessions,
|
|
# system-prompt, tools, agents, invariants, tool-bash, agent-loop), the console
|
|
# logger, JSONL persistence, the readline UI, and a pre-created `main` agent.
|
|
#
|
|
# `hmr` is a leaf entry (not baked into dsh-stdio-agent): it is a Loader-only
|
|
# dev plugin that needs `--expose-internals` — the `demo:coding` script passes
|
|
# it. Requires DEEPSEEK_API_KEY (and optionally DEEPSEEK_BASE_URL) in the
|
|
# environment — the dsh-stdio-agent bin loads the gitignored repo-root .env
|
|
# first. cordis.yml reads them via the `!!js` tag.
|
|
|
|
# Hot-module reload for the dev/demo loop (needs `node --expose-internals`).
|
|
- id: hmr
|
|
name: '@cordisjs/plugin-hmr'
|
|
config:
|
|
root: ['.']
|
|
|
|
# The DeepSeek adapter. Swap to '@deepseek-ai/dsh-llm-pi-ai' for the pi-ai-backed
|
|
# twin (same config shape; `reasoning: high` replaces thinking/reasoningEffort).
|
|
- 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
|
|
- deepseek-v4-pro
|
|
|
|
# Local bash executor (the model's only tool, via agent-core's tool-bash schema).
|
|
- id: bash
|
|
name: '@deepseek-ai/dsh-bash-local'
|
|
config:
|
|
timeoutMs: 60000
|
|
|
|
# The stdio chat app: the whole spine + front-door cluster, configured for a
|
|
# real coding agent driving a pre-created `main` agent.
|
|
- id: stdio-agent
|
|
name: '@deepseek-ai/dsh-stdio-agent'
|
|
config:
|
|
model: deepseek-v4-flash
|
|
# Set RESUME_SESSION_ID to continue a prior persisted session (the ids live
|
|
# under ./.sessions); unset starts a fresh session each run.
|
|
resumeSessionId: !!js process.env.RESUME_SESSION_ID
|
|
persistenceRoot: './.sessions'
|
|
welcome: 'coding-agent ready. Give it a coding task (its tools are bash and subagent).'
|
|
systemPrompt: |
|
|
You are coding-agent, a CLI coding assistant.
|
|
|
|
Your tools are bash (plus bash_output/bash_kill for background
|
|
tasks) and subagent. Do ALL file operations through bash: read with
|
|
cat/sed/head, search with grep, write with heredocs (cat <<'EOF' >
|
|
file), edit with sed or a rewrite. Each bash call runs in a fresh
|
|
shell — pass workdir instead of cd, and never rely on shell state
|
|
between calls.
|
|
|
|
Use the subagent tool to delegate a focused, self-contained subtask
|
|
to a fresh child agent (it works in its own context and returns only
|
|
its final result) — give it a complete, standalone instruction.
|
|
|
|
Check the [exit code: N] marker on every command; investigate
|
|
failures before moving on. Verify your work by running the code or
|
|
tests. Keep answers brief and factual.
|
|
|
|
# The subagent seam + an in-process spawn backend + the model-facing `subagent`
|
|
# tool, as leaf entries after the app (which provides ctx.agents/ctx.tools). The
|
|
# tool is bound to the `spawn` backend: a delegated task runs as a fresh child
|
|
# agent on this same process. (fork is available too — load dsh-subagent-fork
|
|
# and a second dsh-tool-subagent bound to it with a distinct toolName.)
|
|
- id: subagent
|
|
name: '@deepseek-ai/dsh-subagent'
|
|
|
|
- id: subagent-spawn
|
|
name: '@deepseek-ai/dsh-subagent-spawn'
|
|
config:
|
|
providerName: spawn
|
|
|
|
- id: tool-subagent
|
|
name: '@deepseek-ai/dsh-tool-subagent'
|
|
config:
|
|
provider: spawn
|