Repository navigation
refactor(ui): observe device policy read readiness - #180285
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 presents Devices policy and configuration reads through scoped Solid loading and error boundaries. Example: The policy read for Studio Mac remains pending.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 3 items remain Keep open for a focused repair: the owner-directed readiness refactor fits the existing architecture, but introduces a confirmed recovery regression. Priority: P2 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherThe Devices page consumes Gateway policy requests and shared RuntimeConfig receipts, then renders inventory, approval controls, and node-binding editors. flowchart TD
A[Gateway connection] --> B[Existing policy loaders]
A --> C[RuntimeConfig owner]
B --> D[Scoped readiness observers]
C --> D
D --> E[Policy and binding boundaries]
A --> F[Device inventory]
Technical reviewBest possible solution: Keep the existing binding draft and editor available after refresh failure while displaying the error and retry through RuntimeConfig. Do we have a high-confidence way to reproduce the issue? Source tracing establishes the introduced failure path, and exact-head browser CI fails at the matching retained-editor assertion; no target code was executed during this review. Is this the best way to solve the issue? Receipt-based readiness preserves the existing request owners, but refresh errors must not replace an editor whose valid draft the configuration owner intentionally retains. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a90fc1e8a87d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +161, Tests +61. Total +222 across 6 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 22, 2026, 12:38 AM ET / 04:38 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 985112c594
ℹ️ 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".
| if ( | ||
| !result.ok && | ||
| currentConfigRead(current.state) === read && | ||
| !currentConfigObject(current.state) |
There was a problem hiding this comment.
Preserve the retained draft across reconnect failures
When a same-client reconnect invalidates the config connection, currentConfigObject(current.state) returns null because the snapshot is marked stale, even though viewProps deliberately continues displaying the connection-owned config.configForm. If the reconnect's config.get then fails, this condition throws and replaces that retained binding draft with the initial-load error UI; clicking its Retry button calls discardDraft({ reloadOnly: true }), which can discard the unsaved draft once the retry succeeds. Distinguish a genuinely empty initial load from a stale-but-retained editable form before rejecting the readiness promise.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c9e16ad. Readiness and rendering now share the existing binding-form accessor, including the read-permission and Gateway/client custody checks. The new failed-reconnect variant failed on the previous head with a missing Node combobox; all 44 Device page tests pass after the fix, preserving the element, draft value, editability and dirty state. Final head b47ccda also retains the original config mutation refresh-target memo; its exact typecheck, lint and all 44 page tests pass.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21b40429c9
ℹ️ 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".
| fallback={(error) => ( | ||
| <div class="callout danger" role="alert"> | ||
| {String(error())} | ||
| <button class="btn" onClick={() => props.onRetry()}> |
There was a problem hiding this comment.
Reset the policy error boundary after retry
When the initial config.get read fails, clicking Retry invokes the owner reload but leaves this Errored boundary in its failed state because the provided reset callback is ignored. Even if the replacement read succeeds, the bindings section can remain replaced by the error callout until the page is remounted; admit the retry and reset the boundary so it can consume the new read.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The existing page-level test surfaces the shared config read failure and retries through its owner verifies this path and passes on the final head: it clicks Retry, completes the successor owner read, and observes the error disappear. Solid 2 automatically heals this boundary when the async derivation becomes healthy, so no explicit reset is needed. I retained the owner retry and the behavioral assertion.
|
Merged via explicitly authorized admin squash with prior CI and scoped validation.
|
* refactor(ui): observe device policy read readiness * fix(ui): retain device bindings after failed warm reloads * test(ui): use supported exact role-name matching * test(ui): wait for compact identity menu readiness * style(ui): format device binding readiness assertion * test(ui): wait for HTML preview pointer routing * test(ui): identify session sharing transition failures * fix(ui): retain device binding drafts after reconnect failures * fix(ui): preserve the device config mutation refresh target
Whole-scope AST census at
5b4f83ce8611→ final headb47ccdaaf5a. These count syntax candidates and API use, not unresolved defects. Promise-returning memo callbacks are described separately below because the AST async-keyword count does not identify them.The unchanged families retain the campaign’s separately recorded semantic exceptions and assignments. This PR changes only the Devices family and the directly coupled HTML publication proof.
Problem and change
Devices policy controls need to follow the readiness of their existing Gateway and runtime-config requests. Two page-lifetime async memos now observe admitted receipts under independent
Loading/Erroredregions. They retain connection, epoch and target identity and send no extra RPC. Inventory remains independently usable. A failed initial config read presents retry; a failed warm reload preserves the editable last-good bindings and unsaved draft.Main now contains the coupled HTML publication pointer fix, which contributes no diff here. Main’s sharing-test refresh barrier repair (#180498) is retained in full; the three added assertion messages are the only remaining chat change. To keep the page below its 700-line gate, the existing rotation-outcome flow now lives in the Device dialogs owner. It still awaits the authoritative result and reveals a delivered token after a connection reset; its old exported helper is now private.
A reviewed reconnect failure is fixed: readiness now uses the same connection-owned binding-form accessor as rendering. Previously the stale snapshot check could replace a retained unsaved draft with initial-load retry UI after reconnect. The shared accessor preserves existing permission and Gateway/client custody and retains the existing mutation refresh-target memo. The reload/reconnect regression fails on the prior head and passes after repair. The separate suggestion to explicitly reset
Erroredwas not adopted: the existing cold-read retry test confirms native Solid 2 error recovery.onCleanup0→0; pairedonSettled1→1Loading0→1 andErrored0→1 wrapper, each used for both regions;latest1→2;isPending0→1action/optimistic/affects/refresh owners unchangedPresence, system information and environment samples remain deliberately silent background reads. Plain owners retain synchronous admission, policy drafts, authorization and write settlement. The existing save actions provide temporary feedback; this PR adds only readiness consumption.
pr-simplifyretained the two scoped receipt observers because replacing owner admission with a new read would duplicate RPCs.Proof
ci:full; final corrected headb47ccdaaf5apassed run 39767107404, attempt 1, with all 69 jobs completed successfully or skipped. Earlier runs belong to superseded headsThe earlier HTML local replay reached a 300-second setup watchdog before browser launch and remains inconclusive. Run 39756934355 subsequently passed all UI E2E and real-Gateway shards but failed
chat-session-sharing-mobile.test.tsx > keeps sharing busy through refresh and retires it for a same-key successor. The six-case file passed on both its exact base and head, so no inherited-failure claim was made. Diagnostic head04f847then passed full CI 39760197525. Main’s independent refresh-barrier fix (#180498) is now merged intact; the focused six-case test and UI tsrs pass on merged head5c03b734f06, and final corrected-head full CI 39767107404 passed. The old auto request was confirmed cancelled before head replacement.A late exact-head typecheck caught a remaining reference after the attempted projection-memo cleanup on
c9e16ade972. That head is superseded. The final head restores the originalaffects/refreshmemo and uses a typed form-helper parameter; exact source typecheck, lint/page-size gate, all 44 page cases, and independent review pass.5b4f83ce8611b47ccdaaf5aBoth builds and strict performance checks passed with zero violations and warnings. All measured surfaces stay below their current caps (startup 325,081 B, Chat 1,500,000 B, New Session 1,035,000 B); the original Devices lazy boundary and request counts are preserved. Both builds use identical fixed timestamp, build ID, branch and revision metadata.
Production physical LOC across the five changed production files: 1,285 → 1,462 (+177). Nonblank LOC: 1,234 → 1,406 (+172). The increase contains two scope-aware receipt observers and one shared readiness wrapper. Net PR diff: 11 files, +360/−58; no dependency, CSS, route, tag or selector change.