Skip to content

perf(plugins): cap dispatched-agent returns and point reviewer callers at the findings path - #12740

Merged
kyle-sexton merged 3 commits into
mainfrom
host-run/12469-handback-size
Nov 3, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
host-run/12469-handback-size

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #12469

Summary

Shortens subagent hand-back reports through two agent-side changes, chosen from a split of the hand-backs by agent type and dispatching skill.

Measured over main-thread transcripts in this repository (~/.claude/projects/<this repo>/*.jsonl, sidechains excluded), 2026-10-31T00:00Z to 2026-11-02T00:00Z. A hand-back is a [Subagent hand-back] agent message. The body is the text after the harness frame, with its two-space indent removed.

  • 676 hand-backs: 3,854,316 delivered bytes, 3,466,488 body bytes. Body median 4,703, p90 9,148, max 19,353; 403 were over 4 KB and 46 over 10 KB. The issue's 375 reports / 2,394,552 bytes could not be reproduced; this method is the baseline for the after measurement.
  • By agent type (body bytes):
Agent type Reports Total Median
general-purpose (ad hoc briefs) 514 2,289,649 4,248
review:security-reviewer 52 458,099 8,919
review:code-reviewer 15 151,500 10,560
implementation:implementer 19 128,526 5,771
discovery:research-verifier 20 111,412 5,573
built-in Explore 8 78,279 10,147
discovery:researcher 15 77,154 5,107
discovery:explorer 6 45,057 7,430
  • By dispatching skill (the last skill loaded since the user's last prompt): none 493 reports / 2,454,874 bytes; source-control:pull-request 276,736; session-flow:handoff 234,867; discovery:research 184,612; session-flow:keep-going 148,783; discovery:explore 129,190.

Fix

  • Reviewers. perf(review): have code-reviewer and security-reviewer return a file pointer plus a bounded summary #12294 (merged 2026-11-02 08:16Z) added the pointer reply, which runs only when the dispatch prompt has a Findings path: line. From 09:00Z on 11-02, none of 17 security-reviewer dispatches and none of 6 code-reviewer dispatches had that line. The replies stayed by value, at medians of 8,058 and 9,072 delivered bytes. Most of these dispatches are ad hoc and come from no review skill. Both agents' descriptions now name the line and its shape, so a caller sees it in the agent listing. The write boundary is unchanged.
  • Return contract. The three byte-identical copies (discovery, implementation, plugin-quality report skills) used to cap only structure. A report that followed it still reached a median of 5 to 6 KB: researcher 5,107, research-verifier 5,573, implementer 5,771. The whole final message now stays under 4,096 bytes, the issue's own 4 KB threshold, and detail goes in the agent's artifact.

Remaining on #12469

  • The after figure: re-run the same extraction over a 48-hour window that starts once this merges and the plugins are updated on the host.
  • General-purpose dispatches with no skill are 66% of body bytes. Their briefs come from orchestrator sessions and the user-scope spawning policy, so no change in this repository reaches them.
  • The three skills credited with general-purpose dispatches (pull-request, handoff, keep-going) are on perf: cut the skill-body bytes main sessions load and do not act on #12468's list. This change leaves them alone. Their attribution is doubtful anyway: a resumed session loads them once and then dispatches for hours.

Verification

  • scripts/check-affected.sh --tests on the committed head: 14 passed, 2 skipped (CI-only whole-repo scanners) over 9 changed files.
  • The three contract copies are byte-identical (cmp).

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01VcuponMacsFYBfNzLKb3ws

kyle-sexton and others added 2 commits November 3, 2026 00:16
…s at the findings path

Over main-thread transcripts in this repository, 2026-10-31 to 2026-11-02,
676 subagent hand-backs carried 3,466,488 report bytes (frame stripped),
median 4,703. Since the reviewer file-pointer reply landed, no dispatch of
code-reviewer or security-reviewer has passed a Findings path line, so
every reply stayed by value at a median of 8 to 10 KB.

- The return contract copies in discovery, implementation and
  plugin-quality cap the whole final message at 4,096 bytes; detail goes
  in the agent's artifact.
- The two reviewer descriptions name the Findings path line and its shape,
  so callers outside a review skill see it in the agent listing.

Refs: #12469

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcuponMacsFYBfNzLKb3ws
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:14:28.348029Z 6c64b89 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 6c64b8905bdda4de73b96e6b6b973de5448a845a; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread plugins/review/agents/code-reviewer.md Resolved
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed d06ed2a83d02b40a6efb0e15300300a1988c1e52: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #12740 (incremental, 6c64b890 → d06ed2a8)

Scope: This is an incremental review. I read every hunk of the 2 files in the incremental diff: plugins/review/agents/code-reviewer.md and plugins/review/agents/security-reviewer.md. For context I also read plugins/review/reference/reviewer-handback.md and the write-boundary rule in the code-reviewer agent (code-reviewer.md:118). The 7 other changed files have not changed since my last review.

What changed: In both agent descriptions, the Findings path: hint used to say <absolute repo root>/.work/reviews/.... It now says <absolute memory root>/reviews/... and adds that the memory root is the project's declared one, or .work/ by default, and must hold a .gitignore of *.

Prior finding: This change fixes my round-1 advisory finding (thread), which the owner has resolved. The new hint now covers both caller-side steps in reviewer-handback.md:10-16: use the declared memory root, and put the .gitignore guard in it. The path still ends in <sep>reviews<sep><branch-slug><sep><stamp>-code-reviewer.md, which is the shape the agent's write boundary accepts at code-reviewer.md:118, so a caller who follows the hint still gets a written report. Both descriptions are still well under the 1,024-character limit.

Findings: None in this round.

Closing issue: The PR context names none. #12469 is linked with Refs: only, so there are no acceptance criteria to check.

Manifests: No manifest changes.

Embedded instructions: None found in the PR context, settled threads or prior findings.

Verification: I ran no commands. The PR body's check results are claimed by the author, and I have not verified them.

Spend: None. The change only edits agent description text.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d06ed2a83d02b40a6efb0e15300300a1988c1e52: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12740 (incremental, 6c64b89..d06ed2a)

No security issues found.

critical-findings: 0

What I reviewed: every hunk of both files in the incremental scope (2 of 2):

  • plugins/review/agents/code-reviewer.md:3
  • plugins/review/agents/security-reviewer.md:3

What changed: each agent's frontmatter description used to suggest <absolute repo root>/.work/reviews/... as the Findings path: shape. It now suggests <absolute memory root>/reviews/<branch-slug>/<UTC stamp>-<agent>.md, where the memory root is the project's declared one or .work/, and that root holds a .gitignore of *. This is only a hint to the session that dispatches the agent. It is not an instruction the agent follows when it writes.

Write boundary: the agent body's write check is unchanged in this push. See security-reviewer.md#L99 and code-reviewer.md#L118. The agent still:

  • writes only the path on the dispatch prompt's Findings path: line, and only when exactly one such line is present;
  • requires the path to end in <sep>reviews<sep><branch-slug><sep><stamp>-<agent>.md, with no .. segment;
  • never takes a path from the reviewed content.

That path comes from the caller, which was already trusted to write it. The hint names no new path source, so nothing reaches a write target that the base check didn't already allow.

Configuration: tools:, model: and effort: are unchanged.

Other surfaces:

  • Instruction-surface lens: no rule is deleted, narrowed or softened. Only the caller-facing hint's wording changed.
  • Trust controls: no trust control, merge hold, token scope, kill switch, workflow or plugin manifest is touched. No manifest <field> lines apply.

Prior round: the lane's earlier summary at 6c64b89 reported 0 findings, so there is nothing to carry forward.

PR context: ordinary prose. It contains no instructions aimed at this review.

Spend: none added.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 346ec41 Nov 3, 2026
69 of 70 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/12469-handback-size branch November 3, 2026 07:04
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