Skip to content

fix(discovery): the truncation rule says discard the partial slice; both recovery ladders say resume first #2272

Description

@kyle-sexton

Three sites in discovery tell the parent to discard the partial slice on a no-payload return; both recovery ladders tell it to resume the agent first. The two rules address the same event and prescribe opposite actions, and the observed incident refutes the discard rule: resuming recovered the complete artifact set from retained context, so following the discard rule as written would have thrown away a complete run and re-dispatched at full cost.

This is adjacent to #2203 but is not the same defect. #2203 was a missing enum value (nothing could say "complete but unpersisted"), fixed in #2222 by the persistence: axis. This is two rules that disagree about one event, and #2222 deliberately left truncated and its discard rung untouched so the new axis would not disturb them.

Rows

  • I7 B-F10plugins/discovery/agents/explorer.md:194, plugins/discovery/agents/researcher.md:195, plugins/discovery/skills/research/context/dispatch.md:236 (discard) against plugins/discovery/skills/explore/reference/dispatch.md:124, plugins/discovery/skills/research/context/dispatch.md:198 (resume first)

Evidence

The discard rule — agents/explorer.md:194:

truncated-without-warning, and the parent discards the partial slice rather than resuming it. Budget

skills/research/context/dispatch.md:236:

cases **the parent discards the partial slice rather than resuming it**, because a half-run ledger

The resume rung — skills/explore/reference/dispatch.md:124 and skills/research/context/dispatch.md:198, identical opening:

**Exit 1 with the agent still live — resume it; do not re-dispatch it.** A resume costs one message;

A no-payload return produces an empty-or-partial slice, hence exit 1 — so both rules fire on the same event. The reconciliation attempt at skills/research/context/dispatch.md does not survive contact: recovering the payload is what tells you whether the slice is worth keeping, so the discard cannot correctly precede the resume.

Docs check, https://code.claude.com/docs/en/sub-agents, fetched 2026-08-11 — resume-before-discard is doc-safe: "Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh," and "A completed subagent that receives a SendMessage auto-resumes in the background without a new Agent invocation."

Constraint on the fix

truncated must keep meaning the turn-budget stop and its discard rung must stay correct for that case — that is the invariant #2222 built the persistence: axis around, and a fix that re-overloads truncated reopens #2203. The ordering is what needs stating: resume first where the agent is still live, then decide whether the slice is worth keeping from what the resume returns.

Provenance

Severity: MED · Provenance: AUDITOR_VERIFIED
Origin: handoff-inbox item 2026-08-10-plugin-quality-audit-four-components (023241Z)
Ledger: .work/handoff-inbox-batch-4/ledgers/I7-four-components-023241Z.md § "Lane B — discovery 0.13.1" (B-F10)
Verified against origin/main 9b34a82a. discovery went 0.13.1 → 0.14.0 in #2222 (d6e4b452) after the ledgers were written at dacb8661; anchors are re-pinned at 9b34a82a and differ from the ledger's.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions