Repository navigation
refactor(ui): read agent rosters from their owner - #180696
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces Agents route and page roster copies with a read-only getter into the shared agent capability. Example: Open /settings/agents/research/tools with Research and a system agent in the roster.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR makes a useful, owner-directed simplification, and no actionable defect was found in the pinned diff. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway supplies agent rosters to the shared capability; Settings selection and the Agents page consume that owner to select agents, hydrate identities, and render panels. flowchart TD
A[Gateway agents list] --> B[Shared agent capability]
B --> C[Settings selection owner]
B --> D[Page read-only getter]
E[Route selection intent] --> C
C --> F[Agents panels]
D --> F
Technical reviewBest possible solution: Use the existing capability as the sole roster owner while retaining selection intent, consumer filtering, and synchronous lifecycle retirement. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor; source inspection confirms the duplicated roster ownership, and no failing product scenario is claimed. Is this the best way to solve the issue? The patch is the smallest coherent cutover: it reuses the existing owner and publication path, removes the copied data, and preserves filtering at the affected consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd3b7a824a6c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -7, Tests +62. Total +55 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 22, 2026, 10:47 AM ET / 14:47 UTC. |
|
Merged via squash.
|
* refactor(ui): read agent rosters from their owner * test(ui): bind agent fixtures to canonical roster owners
Problem and solution
Agents route data and mutable page state each copy the roster already owned by the shared agent capability. The page also filters and clones that roster on every owner publication.
Read the canonical roster through a read-only getter. Keep route data limited to URL and selection intent, removing its roster and Gateway identity fields. The view excludes system rows when selecting a displayed agent, and identity hydration filters those rows at its existing consumer. The route still waits for initial roster loading at the same lazy boundary; selection intents, drafts, and late-result retirement keep their existing owners.
Production fan-in remains page 8 / route 4 / view 1; page/view fan-out remains 38 / 24 including dynamic imports. The full-roster read contract remains because the page's domain helpers consume it, but it no longer stores or owns that roster. No new modules, exports, or reactive primitives. Existing counts remain one signal, one memo, two onSettled calls, one action, and one optimistic value; no effects, cleanup calls, untrack, flush, owner APIs, listeners, or DOM queries.
Proof
The first local run exposed a static test fixture whose roster never retired on client replacement. That fixture had depended on the deleted page mirror to force a reload. The replacement matrix now uses real roster and selection owners, retaining all four lifecycle cases and the assertion that a late old model result cannot replace the current catalog. Only the affected test file was rerun. Added rendered coverage ensures a system-only roster does not expose an agent panel.
Knip reports only
src/infra/heartbeat-active-hours.tsandsrc/infra/heartbeat-wake-policy.ts, reproduced on untouched main. Full UI CI is requested. Rendering, tags, classes, and selectors are unchanged; screenshots are not applicable.CI repair: four additional test files supplied static roster/connection fixtures through the retired route payload. They now bind the existing roster and selection capabilities to the Gateway; snapshot-provenance assertions remain for routes that carry snapshots. All 30 cases across the affected files, UI-pages types, targeted lint/format, and independent P2 review passed. The fixture repair adds 37 test/helper lines and no production code. Final PR: 270 additions / 178 deletions (net +92); production remains -7 LOC. Current main is merged, including its Twitch test repair.