Skip to content

fix(gateway): apply config despite delayed file notifications - #157906

Merged
steipete merged 3 commits into
mainfrom
codex/config-rpc-runtime-ordering-20260925
Sep 25, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/config-rpc-runtime-ordering-20260925

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Baseline 818b0092 reproduced 80 passing / 1 failing cases in the original config-RPC order. The new regression also failed on the original activation implementation.
  • The local integration of 902a8b6 with main abd2d8db passes 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.
  • Maintained staged checks passed on the integrated tree, including production and all selected test type graphs, lint, structural guards, and dead-export scans.
  • Standalone changed-suite measurement at 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.
  • Independent full-source review found no actionable P0–P2 findings, including the composition with the existing retry owner.

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.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Sep 25, 2026
@steipete
steipete marked this pull request as ready for review September 25, 2026 04:56
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 2:09 AM ET / 06:09 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: eb34402cf2c093f58f21a6964efa67026dbfb8b7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair has positive and negative boundary coverage, with the prior test-cost question resolved.
Proof confidence 🌊 off-meta tidepool Not applicable: The Repository State identifies a member-authored PR, so the external-contributor proof gate does not apply. The added reloader and activator cases inject the relevant observations and check the final snapshot; the reported Gateway WebSocket suite pass does not independently demonstrate that exact race. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The Repository State identifies a member-authored PR, so the external-contributor proof gate does not apply. The added reloader and activator cases inject the relevant observations and check the final snapshot; the reported Gateway WebSocket suite pass does not independently demonstrate that exact race. No stored-data contract changes.
Evidence reviewed 8 items Current main: The fetched main revision checks currentness after asynchronous policy preparation but has no checkpoint at that final publication edge.
Introduced publication check: The pinned introduced diff passes the existing checkpoint into secrets publication and invokes it after awaited policy preparation, before the synchronous currentness check and activation.
Config ownership contract: The existing checkpoint accepts an unchanged observed snapshot after comparing source and plugin install records, and rejects a newer writer revision.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +7, Tests +84. Total +91 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 0 +7
Tests 1 85 1 +84
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 92 1 +91

Review metrics

Metric Value Why it matters
Changed-suite cost 34.81s wall; 2 new cases totaling 1.598s The PR body now supplies the measured cost requested in the previous review.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The race can leave a saved Gateway setting unapplied, but the demonstrated path is limited to a delayed notification during reload.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State identifies a member-authored PR, so the external-contributor proof gate does not apply. The added reloader and activator cases inject the relevant observations and check the final snapshot; the reported Gateway WebSocket suite pass does not independently demonstrate that exact race. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-25T05:00:30.558Z sha 902a8b6 :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Measured standalone suite and case timings are now recorded in the PR body. Please review current head eb34402cf2c093f58f21a6964efa67026dbfb8b7, which includes the canonical queued-cancellation repair already on main.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 3e63b56 into main Sep 25, 2026
207 checks passed
@steipete
steipete deleted the codex/config-rpc-runtime-ordering-20260925 branch September 25, 2026 06:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 25, 2026
…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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant