Repository navigation
fix(updates): keep state inspection on the selected profile - #184384
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 changesBind update workers’ metadata discovery to the explicitly selected state directory. Example: The selected profile has schema 7 while the default profile has incompatible schema 999.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a source-verifiable profile-selection bug with a focused change, and current main still lacks the repair. No introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe updater sends state-directory, configuration, and restricted environment inputs to an isolated worker, which discovers databases and plugins and returns inspection or snapshot results. flowchart TD
A[Installed updater] --> B[Selected state directory]
B --> C[State worker ingress]
C --> D[Profile-bound environment]
D --> E[Plugin metadata discovery]
E --> F[Database inspection or snapshot]
F --> G[Updater result]
Technical reviewBest possible solution: Keep the single worker-ingress binding so every affected worker operation uses the selected installation’s existing state owner. Do we have a high-confidence way to reproduce the issue? Source shows the restricted sender dropping the profile environment field before metadata discovery resolves machine state; the PR reports red/green subprocess regressions, which this read-only review did not execute. Is this the best way to solve the issue? Yes: normalizing the existing environment at the shared worker boundary fixes both senders without duplicate workarounds, new configuration, or another state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2499f2be3e88. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +34, Docs +6. Total +45 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 26, 2026, 4:28 AM ET / 08:28 UTC. |
|
Merged via squash.
|
…#184384) Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit dc07bb8) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes updates failing on a selected profile because inspection accidentally reads a different profile's newer database schema.
User Impact
Update inspection and snapshots use the selected installation's state directory even when an older updater omits that field from its restricted environment payload. No configuration or database schema changes are required. An old updater that runs its own inspection worker still needs an updated runtime; the candidate-side repair applies when it delegates to the new worker.
Why This Change Was Made
The worker already receives an authoritative
stateDir, but plugin metadata discovery also resolves machine state through the supplied environment. Bind that existing environment field once at worker ingress, preserving the restricted payload and leaving physical-path-only requests unchanged. This covers both inspection and snapshot senders without adding separate sender workarounds.The regression also exposed an incomplete existing WAL test fixture: its machine-state table omitted
updated_at_ms. Complete that fixture rather than weakening its assertions. Production delta: +5 lines, including the ownership comment.Evidence
A real subprocess regression with a healthy selected database and an incompatible default-profile database failed before the fix with the wrong-profile schema error and passes afterward. The snapshot row also supplies a contradictory environment root and verifies that explicit
stateDirwins; unrelated database bytes remain unchanged.Proof uses synthetic databases through the actual inspection/snapshot subprocesses; it does not claim a full published-package upgrade run.