Repository navigation
refactor(ui): derive page views from canonical owners - #177660
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 derives Control UI view contracts from existing owners and replaces copied Agent panel fields with reactive owner accessors. Example: Open agent beta’s Files panel and edit AGENTS.md.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored refactor removes duplicate view contracts, and inspection found no concrete introduced defect; CI failures still need attribution. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI page owners receive Gateway state and manage synchronous requests and drafts; reactive projections expose their facts to Solid views, whose callbacks invoke the existing owners. flowchart LR
Gateway[Gateway state] --> Owners[Canonical domain owners]
Owners --> Pages[Page owners and drafts]
Pages --> Projections[Reactive owner accessors]
Projections --> Views[Solid page views]
Views --> Actions[Existing action callbacks]
Actions --> Pages
Technical reviewBest possible solution: Keep the existing owners authoritative and land the accessor and type derivation cleanup once required CI has an attributable disposition. Do we have a high-confidence way to reproduce the issue? This PR proposes a behavior-preserving refactor rather than a reproducible product bug; source inspection confirms the duplicated contracts and projections it removes. Is this the best way to solve the issue? The change uses existing reactive readers and owner output types, preserves intentional view narrowing, and adds no competing state owner or unnecessary production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cd23b665868. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -264, Tests +101. Total -163 across 36 files. Added test files: 0. View PR surface stats
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 Reviewed October 19, 2026, 4:02 PM ET / 20:02 UTC. |
# Conflicts: # ui/src/pages/model-setup/model-setup-owner.ts # ui/src/pages/model-setup/view-types.ts # ui/src/pages/sessions/sessions-page-state.ts # ui/src/pages/sessions/sessions-page-state.types.ts
|
Merged via squash.
|
* refactor(ui): derive page views from canonical owners * refactor(ui): retire unused channel view type exports * fix(ui): keep page view types in their owning layers * test(ui): settle lazy attachment previews before removal checks * refactor(ui): keep identity loading with its canonical owner
Problem and change
Agent panels copied fields from their reactive page and channel owners, and Usage repeated owner output in parallel view contracts. Panels now read their existing owners, and view types derive from those owners. The Agents page also delegates identity loading to the existing identity capability, deleting redundant loading state, cache filtering, and request cleanup. The capability already owns access checks, deduplication, stale replies, and RPC errors.
Identity drafts remain with the identity actions. Shared Usage state has a type-only leaf, and Channels retain explicit callback contracts. Routes, host tags, classes, styles, and lazy boundaries are unchanged. Sessions and Model Setup changes were removed after equivalent work landed or was covered by another lane.
Proof
pnpm tsgo:uipassed using tsrspnpm deadcode:knippassedci:fullrun39353552457passed: 45 success / 24 skipped, including full UI E2E and real-Gateway shardsProduction LOC: 5,723 → 5,568 (−155) across 19 files. Tests/helpers: 4,619 → 4,726 (+107) across 15 files. Whole PR: −48 lines across 34 files. Test growth changes flat field fixtures to owner accessors while preserving behavior assertions; the identity test waits for the relevant refresh instead of page-local deduplication.
The previously green head encountered conflicts with main's Model Setup and Sessions simplifications. Equivalent changes are now excluded from this PR. The confirmed-cancelled auto request remains retired; landing uses native replacement recovery after current-head review, preparation, and CI.