deepseek-harness/docs/core-data-structures
Tianyi Cui b82c310db3 Fix subagent in-process result scoping (Codex review round 1)
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.
2026-06-22 06:47:20 +08:00
..
bash.md feat(types): brand bash ids + stop brand erosion; extract Branded to dsh-brand 2026-06-21 07:19:59 +08:00
core.md Fix subagent in-process result scoping (Codex review round 1) 2026-06-22 06:47:20 +08:00
llm-streaming.md simplify(llm): drop unconsumed adapter-change event and assembled call surfaces 2026-06-21 01:27:41 +08:00
persistence.md fix review findings: bump session format version + restore late turn-end warn 2026-06-21 11:08:10 +08:00
session.md simplify(session): fold trace-only usage/error events into load-bearing events 2026-06-21 10:00:06 +08:00
subagent.md Add in-process subagent backends: spawn (fresh) and fork (seeded) 2026-06-22 05:58:40 +08:00
tools.md Fix doc cross-links for the hierarchy; add package-path + shape gates 2026-06-20 23:12:14 +08:00