Repository navigation
refactor(subagents): own session Swarm summaries - #206545
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesMoves Swarm summary construction into the subagent registry and combines group counts and member buffers in one accumulator. Example: A parent has 30 retained collectors: 25 completed and 5 failed.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR completes a focused ownership cleanup, and no blocking defect was found. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCompact registry records and parent identity enter the summary builder; bounded counts and optional child details feed session-row materialization and refresh. flowchart TD
A[Subagent registry records] --> B[Subagent summary owner]
B --> C[Initial session row]
B --> D[Session row refresh]
C --> E[Session lists and descriptions]
D --> F[Session events]
Technical reviewBest possible solution: Retain one registry-owned summary builder with direct consumer imports and no compatibility wrapper. Do we have a high-confidence way to reproduce the issue? This is an internal ownership refactor; source inspection establishes the existing Gateway-owned policy rather than a user-visible failure. Is this the best way to solve the issue? The move follows the existing subagent ownership boundary, removes the superseded module, and simplifies accumulation without changing the output contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b431a1ebeb9e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -5, Tests +1, Other +3. Total -1 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 27, 2026, 5:44 AM ET / 10:44 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* refactor(subagents): own session Swarm summaries * refactor(subagents): remove parallel summary member index
What Problem This Solves
Gateway session rows still own the collector-status, grouping, and member-selection decisions for Swarm summaries. This is the next slice of the maintainer-requested subagent ownership cleanup after #206444 and #206479.
User Impact
No user-visible change. Session lists and events preserve their existing summary counts, ordering, limits, and omission of private child content.
Why This Change Was Made
Move the summary implementation beside the registry read types and collapse its parallel group/member maps into one group accumulator. Both gateway consumers call the same owner, and the old module is deleted without a compatibility export. Selected groups discard their private member buffers before returning the wire summary.
session-utils-row.tssession-row-projection-context.tsgateway-fresh-array-measure.tsMechanical caller updates
session-swarm-summary.test.tsimport.unicorn/no-array-sortsuppression entries with the renamed file inlint-suppressions.test.ts; no new suppression is introduced.Scope and measurements
Against
89d1fd016979f5052277669bfec947b92152e8c0, production lines across touched files are net −2: runtime −5 and benchmark +3. Tests are +1. The 121 campaign-listed gateway files have 43 → 42 registry/announce importer files, 68 → 67 total subagent importer files, and 1,307 → 1,307 subagent-mentioning lines. Gateway loses the 86-line policy module; its replacement is 81 lines.Gateway summary decision functions: 1 → 0. Group/member indexes: 2 → 1. Remaining imports of the removed gateway module and operations on the removed member map: 0. The owner retains its three production callers (two gateway paths and the benchmark). Code-sloppiness scans are complete: function SLOC 61 → 56, CC 18 → 17, score 48.6167 → 48.4758, no clone lines or parse failures.
Evidence
git diff --check, signed commit, and session-identity ratchet pass (1,549 files; 6,170 existing pins).c533fb11a0f862ac5603f2cf8d7345fbf4aef873, with no findings or merge blockers.c533fb11a0f862ac5603f2cf8d7345fbf4aef873: 45981537436, 46 passed, 27 planned skips. No local dependency-backed test result is claimed.a675a7f1793d63b2874a23dcb7917ca40037f435: 45975078055. Build, typechecks, lint and every executed test job passed. This precedes the accumulator consolidation.releaseReplacedNamespaces. Scheduled main 45973857636, at the exact base89d1fd016979f5052277669bfec947b92152e8c0, reports the identical error in job140421182413. The PR failure is job140425672511. Both full-tree Knip reports pass; the failing production report is outside this cutover.