Repository navigation
fix(secrets): retain confirmed writes when inventory refresh fails - #199414
Conversation
Co-authored-by: vyctorbrzezowski <[email protected]>
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR preserves confirmed save, delete, and completed-import outcomes when the subsequent inventory read fails. Example: Saving AUDIT_API_KEY succeeds, then secrets.store.list fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current Secrets UI bug with a focused change and no actionable correctness or security findings; it remains a draft. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI Secrets store sends Gateway mutations and inventory reads, then supplies receipts, cached rows, and errors to the Secrets page. flowchart LR
A[Secrets page] --> B[Existing store owner]
B --> C[Gateway mutation]
C --> D[Confirmed receipt]
B --> E[Inventory read]
D --> F[Completion notice]
E --> G[Rows or error with Retry]
Technical reviewBest possible solution: Use acknowledged receipts and saved counts to determine completion, and retain inventory failure recovery in the existing store owner. Do we have a high-confidence way to reproduce the issue? Current main demonstrably discards a successful mutation receipt after a list rejection, matching the supplied before screenshot; no target code was executed during this read-only review. Is this the best way to solve the issue? The violated invariant is that a failed read cannot undo an acknowledged write; preserving the existing receipt/count and invalidating inventory readiness is the smallest complete fix without another owner or cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5fbdf6989130. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +269. Total +275 across 5 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 14, 2026, 11:16 PM ET / November 15, 2026, 04:16 UTC. |
vyctorbrzezowski
left a comment
There was a problem hiding this comment.
Reviewed the complete mutation/read owner, caller identity guard, test cases and before/after images. Acknowledged save, delete and complete bulk-write results survive a later inventory-read failure; rejected writes and partial imports remain failures. Context changes still retire old receipts. Fixed the test mock's narrow inferred return type using existing Gateway helpers, removing a double cast without changing production, responses or assertions. All 11 focused tests, the relevant type graph, lint and final-head CI passed.
|
Reviewed and merged. Confirmed secret-store writes remain confirmed when a later inventory refresh fails, while rejected writes and partial imports keep their failure behavior. I corrected the test mock typing using the existing Gateway helpers and removed the double cast. All assertions were preserved and final-head CI passed. Thanks for the fix. |
…penclaw#199414) Preserve acknowledged secret-store mutations when a later inventory refresh fails. Keep rejected writes, partial imports, identity guards and error recovery distinct. Use the existing Gateway test helpers for valid receipt typing. Co-authored-by: vyctorbrzezowski <[email protected]>
…penclaw#199414) Preserve acknowledged secret-store mutations when a later inventory refresh fails. Keep rejected writes, partial imports, identity guards and error recovery distinct. Use the existing Gateway test helpers for valid receipt typing. Co-authored-by: vyctorbrzezowski <[email protected]> (cherry picked from commit 5370661) Release adaptation: Keep release-line partial-import copy and existing receipt owner; retain acknowledged save/delete/bulk receipts across inventory errors. Three behavioral baseline failures plus one unrelated source-copy assertion, fixed 10 tests. Browser interaction qualification remains outstanding. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 93b1724be4ba603ec490f30c5011ef379b58f13c)
What Problem This Solves
Fixes: Settings → Secrets treats a confirmed save, completed import or deletion as unfinished when the following inventory refresh fails.
User Impact
Successful changes keep their confirmation and runtime warnings. Saved dialogs close instead of inviting another write, while the real inventory error and Retry remain available. A newly saved entry also stops the old empty inventory from claiming “No secrets yet.” Genuine failed writes, incomplete imports and deletion safeguards are unchanged.
Why This Change Was Made
The existing store owner already has the acknowledged receipt and saved-entry count. Those facts—not a later read error—now decide whether the write completed. Acknowledged changes invalidate the existing inventory-readiness flag until the next accepted list. Previously read rows remain visible during recovery; no new cache, request, state owner or permission rule is added.
The empty-state view uses the same accepted-inventory boundary as #199116. That small guard is included here so this draft works directly on main; the existing draft has not been modified. Gateway-reported write/runtime-refresh failures still keep their original recovery because they are not successful mutation receipts.
Evidence
e345d2240d2869bfails the three owning receipt regressions and the three actual-browser save/delete/import scenarios.Actual compiled Control UI, light theme, 1280×1000 viewport; matching 960×920 annotated crops. Orange marks the already-saved dialog still offering Save. Green marks the preserved completion; the real inventory error remains above it.
Before — main
After — this change
Requested and co-authored by @vyctorbrzezowski.
Work sessions
Linked for team reference; these sessions aren’t public.
Maintainer CI repair: receipt mock typing
The test's inferred mock return type omitted the valid warningCount field. Reused the existing typed Gateway request/client test helpers and removed the local double cast. Production, fixture response values and all assertions are unchanged. All 11 focused tests, the relevant core-test-ui-other type graph, lint and formatting passed.