Repository navigation
refactor(ui): bind Logbook to its bundled view lifetime - #176818
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 changes before merge. What this changesThis PR initializes each Logbook instance once using the connection selected by its existing keyed parent. Example: Logbook disconnects and reconnects using the same Gateway client object.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR makes a focused lifecycle simplification, and no introduced correctness defect was found; failing CI still needs attribution. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI plugin page lazily mounts Logbook from Gateway tab descriptors; its model requests activity data, renders cards, and owns polling and request retirement. flowchart TD
A[Gateway connection receipts] --> B[PluginPageOwner]
B --> C[Keyed bundled view]
C --> D[Logbook initial client]
D --> E[Logbook model]
E --> F[Gateway RPC]
E --> G[Timeline and controls]
Technical reviewBest possible solution: Keep connection replacement in PluginPageOwner and initialize Logbook once within each keyed lifetime. Do we have a high-confidence way to reproduce the issue? This PR proposes a behavior-preserving refactor rather than reporting a reproduced product failure; source confirms the redundant connection observation. Is this the best way to solve the issue? The patch is the smallest complete simplification: it reuses the existing keyed lifetime, retains model cleanup, and migrates every direct caller. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 35aa52a55da8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -2, Tests 0. Total -2 across 4 files. Added test files: 0. View PR surface stats
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 18, 2026, 10:55 PM ET / October 19, 2026, 02:55 UTC. |
4e48954 to
6903b46
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Logbook observed a reactive connection even though its parent already replaces the bundled-view owner for every connection identity change. Give each keyed Logbook instance a plain
initialClientand connect/load once inonSettled; the existing model still owns polling, request retirement, and disposal.The plugin page keeps its lazy Logbook import and keyed bundled-host boundary. No markup, styles, routes, public plugin SDK, or startup imports change. A disconnected keyed instance receives
nulleven when the Gateway retains its client object.Evidence
Before refresh, UI typecheck at base
e0a8caae40a14b360f01a4a83772a94283f9df7bplus this diff reported onlysession-attention.ts:28TS2724 (missingSidebarProjectionMemoexport) andsession-attention.ts:180TS7006 (rowimplicit any). On that run, both implicated Sidebar files were byte-identical to the base; #176477 owns that repair. Final refresh adopted the main repair, and the previously red type check passed. No baseline rerun or exception is claimed. Plugin-page tests pass while emittingSTRICT_READ_UNTRACKEDdiagnostics; the retained route-effect path was not changed.No local build or E2E was run under the campaign budget: this page remains lazy, and the change adds no startup import or visual difference. Exact-head PR CI supplies the startup measurement and broad proof below; import inspection confirms no new eager dependency.
The historical pre-refresh Knip run found one unrelated unused export,
src/cli/tagline.ts: TaglineMode; the refreshed main base makes that type local. The final production Knip scan on the refreshed exact head passed with no findings.Final head
6903b468eabc9dcabd0d90c9d24430dd18ca75a7is rebased on707a215d4c609bdba05b6f28a2f63cca5b65b983. All eight reviewed source/test context blobs match the independently reviewedfccf29d1e1acandidate exactly; the green runtime tests and review were reused without reruns. The refresh frozen install passed in 1.2 s. Fresh UI and UI-pages test types and final production Knip passed; the refresh took 472.08 s through evidence finalization (including waiting).The one surviving effect is
ui/src/pages/plugin/plugin-page.tsx:31: route-property admission into the existing owner. Native bridge callbacks are per-property and occur before Solid publishes props, so replacing it directly could admit a mixed plugin/tab identity. Logbook itself has zero effects after this change.Simplification pass: no helper, new subscription, duplicate connection state, or new test scaffolding; retain the existing lifecycle tests as the primary proof. No leases used.
Inherited CI qualification
Exact-head CI 39198627013 completed for
6903b468eabc9dcabd0d90c9d24430dd18ca75a7. All UI unit, ordinary Control UI E2E, browser-extension, type/lint, security, and strict performance checks passed. The only failed nonaggregate jobs contain these cases:ui-e2e-serial ui/src/e2e/session-pr-reader-lifetime.real-gateway.e2e.test.ts > Session PR readers through a real Gateway > keeps session PR and CI results with the current workspace and reader.The reader case timed out after 120 seconds. The same exact names and error signatures fail on the latest completed scheduled main run 39205204421, at
e3cc361b27cb48b494708891fee8df83e6811946. The actual CI checkout's ordered parents and reconstructed merge tree are verified, and the named failure-source blobs match its base and the scheduled-main head. These are qualified inherited failures; the native inherited-failure/admin route is used without claiming CI green. No failed assertion was weakened and no local E2E rerun was added.Current-head startup: 337,491 B gzip JavaScript, 7 requests, plus 38,500 B gzip CSS, 1 request. Same-host base/head chat boot: 1,489,890 → 1,489,862 B (-28 B); New Session: 1,049,366 → 1,049,337 B (-29 B). Lazy boundaries are unchanged.