Repository navigation
refactor(ui): reuse presentation lifetime owners - #177437
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43142768fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isCurrent = () => | ||
| this.context.isConnected && | ||
| this.context.available && | ||
| client === this.context.client && | ||
| requestId === this.availabilityRequestId && | ||
| environmentId === this.availabilityTarget; |
There was a problem hiding this comment.
Restore latest-request admission for desktop availability
When two node.runnerInventory.changed events for the current node arrive before the first environments.status call resolves, the newer reply can update the lock state and then the older reply still passes every check here and overwrites it. This can leave the desktop viewer showing stale availability—and potentially the wrong sign-in/control state—until another inventory event occurs, so retain a per-request generation check before publishing the snapshot.
AGENTS.md reference: ui/AGENTS.md:L14-L18
Useful? React with 👍 / 👎.
| if (reason === "publication" && (this.active || this.catalogLoading)) { | ||
| this.publicationPending = true; | ||
| // Catalog changes during an existing read are best effort until the next refresh. | ||
| return; |
There was a problem hiding this comment.
Queue publications that arrive during provider loads
When chat.metadata.changed arrives while the initial auth/catalog read is active, subscribeModelCatalogChanges reaches this branch after invalidating the shared facts, but the event is discarded and the already-running pre-publication response can still be published. A normal login or provider update can therefore leave the Models page showing Checking or old authentication metadata indefinitely until a manual refresh; preserve one trailing publication refresh after the active read settles.
AGENTS.md reference: ui/AGENTS.md:L14-L18
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR reuses shared presentation helpers and parent connection lifetimes while removing redundant request counters and refresh scheduling. Example: An openai catalog publication arrives while the Models page is loading authentication.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored refactor consolidates existing UI owners, and source review found no actionable defect outside the explicitly accepted behavior changes. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI presentation owners consume Gateway snapshots, events, native callbacks, and browser timers, then publish scoped state to Solid views. flowchart TD
Gateway[Gateway snapshots and events] --> Owners[Scoped domain owners]
Native[Native settings callbacks] --> Owners
Parent[Plugin page connection lifetime] --> Logbook[Logbook model]
Helpers[Shared presentation helpers] --> Views[Solid views]
Owners --> Views
Logbook --> Views
Technical reviewBest possible solution: Use the existing shared helpers and parent connection owner while retaining actual scope, cancellation, config-write ordering, and the recorded best-effort tradeoffs. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a reported bug; source and existing regressions establish the changed ordering cases, but no runtime reproduction was performed. Is this the best way to solve the issue? The change uses owners already present, removes the replaced paths, and retains meaningful lifecycle tests; the reduced freshness guarantees are explicitly accepted by the maintainer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11d0c854192d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -102, Tests +135. Total +33 across 17 files. Added test files: 1. 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 19, 2026, 11:55 AM ET / 15:55 UTC. |
|
Exact-head gate investigation for
The original publisher's No CI rerun, dispatch, branch update, test weakening, status override or gate bypass was performed for this investigation. Ordinary native landing remains subject to its live gate checks. |
|
Coordinator landing evidence for exact head
Merging with the exact-head SHA guard (squash). This works around a misfiring gate publisher; it does not bypass any failing check. |
What Problem This Solves
The Control UI duplicates timer, artwork, FileReader, request-version and reconnect ownership already provided by shared helpers or the parent lifetime.
What Changed
Use the existing presence lifecycle, artwork renderer and Blob reader; keep only config-read request versions; create Logbook once per parent-owned connection. Remove presentation-only chronology and redundant provider refresh scheduling while retaining actual connection/agent/day scope, network cancellation, native authority, config-write admission and FIFO settlement.
This is the UI area split from the plugin/core owner-plumbing family spanning more than 120 paths. The campaign's area-split exception applies; no padding to meet a deletion floor. Current pre-format measurement: 102 net production lines removed across 11 production owners, 17 changed source/test paths. Phase E standalone session memory, all supporting machinery and tests are untouched. No CSS, tag, DOM, user-facing text, public SDK, configuration, protocol, dependency or persisted shape change intended.
Best-effort tradeoffs accepted
The remaining cuts intend no behavior compromise. Schema loading has synchronous one-request admission plus retained connection epoch, so its second version dimension is redundant (#122117 extraction); config read/write invalidation stays. Activity uses the existing nearest-deadline/hidden-clear/visible-catchup owner (#168756/#168788). Background uploads use the existing reader with identical image-read errors (#173811). Plugin visitor artwork uses the existing renderer with the same image class, empty alt, pending/error fallback and retired-result behavior (#168760/#169243/#171576).
Evidence
The current-base focused selection covered 25 owner/consumer files (21 UI unit files plus four focused browser-unit files, not E2E): 389 passed and one ordinary Agents catalog-publication assertion failed. That proposed three-line cut and all associated test changes were withdrawn. The complete retained Agents suite then passed 31 tests (30.6 seconds wall). Existing inputs and passing proof for the other owners are unchanged.
Typed lint caught the newly added presence case growing an already-over-limit Activity test file. Only that new case moved to a small dedicated file using existing real Gateway/session/context helpers, preserving every assertion; the original Activity test file is now base-identical. The new presence file and original Activity suite pass 36 tests (20.1 seconds wall; new case 40 ms). No limit, assertion or suppression was weakened.
Targeted UI production and changed-test types pass (7.6 and 8.2 seconds). Focused typed lint passes (61.5 seconds; existing style/reactivity warnings remain), formatting passes, the Solid controller guard passes with no baseline growth, runtime cycles are zero and Madge cycles are zero. Author simplification and complete diff inspection are complete. A fresh independent review with the complete determining owners and moved-test helper context finished scoped-clean through P2 (confidence 0.90).
The suppression audit is 13 pass / one inherited failure: the unchanged
src/gateway/session-row-scope.ts|unicorn/no-new-array|1row introduced by #177285. This exact signature is open in the coordinator index and occurs in completed scheduled main runs 39270035500 and 39261680942; the newest six completed scheduled runs were checked. The source and audit test are base-identical, and this UI diff adds no suppression. No allowlist or baseline was changed. Exact-head hosted CI remains the broad gate; this is not an all-green CI claim. Changed-check dry-run classified all 17 current paths; broad local check-changed/build/E2E were not run under the campaign budget.New boundary tests cover actual presence expiry/visibility/disposal and retained visitor success/error/replacement/retirement. Existing cross-connection/day, native setting errors, config write/reconnect and Logbook ordering assertions remain. Removed tests only pinned the explicitly removed same-scope metadata perfection paths. No longer timeouts, retries, skips, suppressions or baseline expansion. Local proof is isolated/nice10/single-worker; exact-head PR CI supplies broad proof. No visual appearance change intended, so no visual redesign evidence is claimed.