Skip to content

limit 68: subagent reader no longer reads a moved sidecar as no subagents - #64

Merged
githubscum merged 2 commits into
mainfrom
lotor-lane/subagent-false-zero
Oct 22, 2026
Merged

githubscum merged 2 commits into
mainfrom
lotor-lane/subagent-false-zero

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO: limit 68 in the repo reader. The subagent ingest (src/ingest/subagents.js, non-core) could not tell "no children ran" from "cannot find children": a renamed sidecar directory read as a silent null, a renamed file pattern as count 0.

Why now: the v3 queue is blocked on Isaac's rulings (V3-02 question, hook-core drafting for V3-03/04, V3-07 home), so the lane took KNOWN-LIMITS per its order. This is R1 completeness, the floor v3 builds on.

What changed (capture only, no judging):

  • countParentDispatches(transcriptPath): counts the parent's own Task / Agent tool_use items. Unreadable file is null, malformed lines skipped.
  • summarizeSubagents: sidecar dir missing while the parent dispatched now returns sidecarMissing: true, count: null, parentDispatches, dir instead of null. Missing dir with zero dispatches still returns null, unchanged. Present dir adds parentDispatches and unmatchedEntries (entry names outside agent-*.jsonl).
  • KNOWN-LIMITS 68: a dated "Repo reader" paragraph. The remaining blind spot is named: rename the dispatch tool itself and the cross-check reads zero too.

Tested: npm test 1061/1061 (main 1056, +5). Probe on a real 2026-10-10 parent transcript: count 2, parentDispatches 2, they agree. Same transcript with the sidecar dir moved to children/: sidecarMissing true, parentDispatches 2, where main returns null.

Eval served: none of E1-E6 directly; it closes a false-zero path that would understate reach at R1 for any run with subagents.

What a reviewer should doubt:

  1. unmatchedEntries is never empty on real sessions today: the harness writes agent-<id>.meta.json beside each child. That is honest capture, but it is noise. Option: exclude *.meta.json by name, or read them (they may carry the agent type). Left as-is so nothing is filtered by guess.
  2. count: null is a new shape on the receipt payload. Only the ingest wiring writes the field and no in-repo reader does arithmetic on it, but an external consumer could.
  3. Dispatch tool names are hard-coded (Task, Agent). That is the same undocumented-layout dependency limit 68 describes, one level up.

Executor: glm-5.3-flash:cloud via dispatch-to-ollama.ps1 (acceptEdits; it could not run tests, the orchestrator did). Orchestrator re-read the full diff and ran the probe.

🤖 Generated with Claude Code

githubscum and others added 2 commits October 19, 2026 20:37
…ren"

Cross-check the parent's own Task/Agent dispatch count. A missing sidecar
dir with dispatches on record now returns sidecarMissing instead of a
silent null; a present dir lists unmatchedEntries by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
countParentDispatches counted every Task/Agent tool_use, including ones a
hook denied, the operator rejected, or an interrupt cut off. None of those
ran a child, so a session with only such a dispatch got
sidecarMissing: true, a false statement on a receipt.

It now collects dispatch tool_use ids and counts only those answered by a
tool_result not marked is_error. Unanswered dispatches (interrupted, or
still in flight) do not count; the count errs low. Repeated rows for one
id count once.

Nit: summarizeSubagents takes opts.transcriptText and the ingest wiring
passes the jsonlText it already holds, so the parent file is not read a
second time. Path-only callers still read the file.

Tests: denied dispatch -> null; rejected and interrupted -> 0; one through
plus one denied -> 1; repeated id -> 1; transcriptText used in place of the
file. Existing dispatch tests now pair each tool_use with a result.
KNOWN-LIMITS 68 paragraph updated to say what counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum

Copy link
Copy Markdown
Owner Author

Review fixes pushed in 881d644. Both findings re-checked against the code first; both held.

Fixed

  1. Denied dispatches counted as dispatches. countParentDispatches counted every Task/Agent tool_use, so a session whose only dispatch was denied by a hook, rejected, or interrupted got sidecarMissing: true, a false statement on the receipt. It now counts only dispatch ids answered by a tool_result not marked is_error. Unanswered ones (interrupted, or still in flight at ingest) do not count, so the count errs low, never high. A repeated row for one id counts once. Field names and shape are unchanged; parentDispatches now means "dispatches that went through", and the KNOWN-LIMITS 68 paragraph says so. (Shape check: a hook-denied tool call in a local Claude Code transcript is a user row with a tool_result carrying is_error: true and the tool_use_id, which is what this pairs on.)
  2. (nit) Second read of the parent file. summarizeSubagents accepts opts.transcriptText, and src/ingest/index.js passes the jsonlText it already holds. Callers that pass only a path still read the file.

Tests added: denied dispatch with no dir returns null; rejected plus interrupted counts 0; one through and one denied gives parentDispatches: 1; repeated id counts once; transcriptText is used in place of the file. Existing dispatch tests now pair each tool_use with a result row.

npm test: 1066 pass, 0 fail (was 1061).

Trade-off left visible: a subagent that ran and then ended in an error result is now not counted, so on a session with a present sidecar dir parentDispatches can read lower than count. Erring low was chosen because the field exists to back a claim that something is missing.

githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, this PR takes 77. Every citation on
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, #67 takes 77, this PR takes 78.
Every citation on this branch moves with it: KNOWN-LIMITS.md heading,
CHANGELOG.md, docs/receipt-coverage.md, and the V3-03 proposal note. The
staged .patch carries no limit number and is unchanged.

On this branch alone the numbering test reports 75, 76 and 77 missing;
that clears once #62, #61 and #67 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum
githubscum merged commit 79f84bd into main Oct 22, 2026
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant