Repository navigation
fix(gateway): apply config despite delayed file notifications - #157906
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: needs maintainer review before merge. Reviewed September 25, 2026, 2:09 AM ET / 06:09 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch rechecks Gateway config ownership before publishing prepared secrets and adds cases for an unchanged watcher echo and a newer write. Merge readiness✅ Ready for maintainer review Current main still has the delayed-notification race. This PR addresses it at the config owner's publication boundary, and the timing evidence requested in the prior review is now in the PR body. No actionable patch defect remains. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway config reloader receives saved writes and file notifications, then prepares runtime settings and secrets. It publishes the accepted snapshot before reporting that a change took effect. flowchart LR
A[Saved config write] --> C[Gateway reload owner]
B[File notification] --> C
C --> D[Prepare secrets and policy]
D --> E{Ownership checkpoint}
E -->|Current| F[Publish runtime snapshot]
E -->|Superseded| G[Keep prior runtime]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +84. Total +91 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the config owner responsible for reconciling watcher observations at the final secrets publication edge, with both accepted-echo and newer-write regression coverage. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source and the added regression define the watcher echo during awaited policy preparation; the PR reports a pre-fix failure, though this read-only review did not run it. Is this the best way to solve the issue? Yes. Reusing the config owner's checkpoint at publication is a narrow fix that retains its newer-write and credential guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 73d1fc7458c7. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Measured standalone suite and case timings are now recorded in the PR body. Please review current head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…4-prep * commit '8fe893da516ebdc817692fb2d272e27bc3c88376': (31 commits) fix(test): wait for reload admission before restart polling (#157964) refactor(mattermost): reuse DM retry option selection (#157800) chore(i18n): refresh native locales (#157850) perf(sessions): reuse current participants across transcript appends (#157622) refactor(signal): share pending transport migration results (#157777) fix(tui): open model pickers without waiting for the Gateway (#157839) fix(gateway): apply config despite delayed file notifications (#157906) fix(auth): clear deleted account selections and support account recovery (#157745) fix: plugin reloads lose tool results and strand subagent settlement (#157339) fix(gateway): avoid preview errors during worker metadata updates (#157943) refactor(diffs): reuse native promisify for compression (#157835) fix(models): keep current choices on the first picker page (#157869) fix(plugins): retain existing quarantine across unrelated reloads (#157907) fix(openai): prioritize ChatGPT sign-in and clarify auth choices (#157792) chore(ui): refresh control ui locales (#157955) fix(ui): refresh connected accounts after auth changes (#157950) fix(scripts): avoid redundant npm version process in package checks (#157809) refactor(usage): capture hosted pricing once per operation (#157838) refactor(ui): share slash-command failure results (#157649) fix(cron): announce runs miss the channel's formatting rules (#157877) ...
What Problem This Solves
Fixes config reloads being mistaken for superseded work when the file watcher reports the same write during asynchronous Gateway policy preparation.
User Impact
Settings hot reloads can finish without an unnecessary plugin rollback and retry. A genuinely newer config write or changed credentials still prevents the old candidate from publishing.
Why This Change Was Made
Forward secrets publication now uses the config owner's existing checkpoint after asynchronous preparation. That owner reconciles unchanged filesystem observations and rejects genuine supersession. Final secrets, credential, and shared-session checks stay synchronous with publication; rollback and survivor-policy recovery remain independent of the rejected transaction.
This complements @joshavant's safe plugin-reload retry repair, which remains responsible for genuinely refreshed secrets after a completed rollback.
Evidence
818b0092reproduced 80 passing / 1 failing cases in the original config-RPC order. The new regression also failed on the original activation implementation.902a8b6with mainabd2d8dbpasses all 913 tests across five owning and sibling suites, including the original 81-case config-RPC flow, safe retry controls, matching-observation acceptance, and newer-write refusal with policy reconciliation.902a8b6(14 cases): 34.81s wrapper wall / 29.78s Vitest wall; the two new cases took 1.127s and 0.471s. Transform preparation was 81% of Vitest wall. The 81-case RPC suite starts an isolated Gateway and drives config apply/patch through its WebSocket client.The separate include-only CI hook timeout did not reproduce and is not claimed fixed here. The first PR CI run exposed a queued-collector cancellation failure. The branch now includes the canonical publication-before-cleanup repair; both original native cases and 113 affected sibling cases passed locally on this final integration.