Repository navigation
refactor(agents): split subscribe leaf ownership - #122249
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
84ca0b0 to
366fdcc
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 5:59 PM ET / 21:59 UTC. ClawSweeper reviewWhat this changesThe PR splits embedded-agent tool-result extraction and assistant-message subscription handling into smaller owner modules while keeping Plugin SDK export names unchanged. Merge readinessKeep open: this maintainer-owned refactor remains unique, and no blocking correctness defect was found. The branch is behind current main, so it needs a refreshed merge result and exact-head CI before landing. Priority: P3 Review scores
Verification
How this fits togetherEmbedded-agent subscriptions turn provider message and tool events into ordered agent stream updates and outbound reply payloads. Their helpers are also used by the gateway, CLI runner, system agent, and Plugin SDK runtime. flowchart LR
A[Provider and tool events] --> B[Embedded agent subscription]
B --> C[Tool result leaves]
B --> D[Assistant message leaves]
C --> E[Gateway CLI and SDK consumers]
D --> F[Ordered stream updates]
D --> G[Outbound replies]
Decision needed
Why: The protected maintainer label and maintainer authorship require explicit human handling, while the remaining work is integration verification rather than an automated repair. Before merge
Agent review detailsSecurityNone. PR surfaceSource +326, Tests -169, Other -3. Total +154 across 42 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or merge-queue the behavior-neutral split onto current main, then land it if the refreshed exact-head checks preserve the public SDK surface and ordered subscription behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reorganizes existing behavior rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes: direct leaf imports preserve the existing dispatcher and public SDK contract while removing the oversized ownership hubs; no duplicate replacement path was found. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 459c70e14a2c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer landing note: skipping the optional drift-only rebase from the latest ClawSweeper rank-up moves. The PR is MERGEABLE, exact-head hosted CI/Testbox passed at |
|
Merged via squash.
|
* refactor(agents): split embedded tool result ownership * refactor(agents): split embedded message ownership
What Problem This Solves
The embedded-agent subscribe pipeline still concentrated tool-result extraction and assistant-message reconciliation in two oversized modules. That made ownership boundaries difficult to review and kept three max-lines suppressions in place, including the 2,310-line message-handler test.
Why This Change Was Made
Split tool handling into canonical result, media, and messaging-extraction leaves, and split assistant messages into stream projection, reply handoff, update, and lifecycle owners. Existing call sites now import their owner directly; Plugin SDK exports remain available through the same public paths. Event-ordering, partial/final reconciliation, and provider-boundary comments moved with their original bodies.
The small shared-types, callback, raw-stream, and compaction-runtime seams remain separate because they are intentional cycle, fatal-callback, diagnostic-sink, and lazy-persistence boundaries.
Production LOC: +101 net | Tests: +52 net | Ratchet entries: -3
User Impact
No user-visible behavior changes. Maintainers get smaller, acyclic subscribe modules with explicit ownership and no suppressions for either source monolith or the oversized message-handler test.
Evidence