Repository navigation
fix(gateway): converge monitors after config publication - #139509
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 5, 2026, 8:00 PM ET / September 6, 2026, 00:00 UTC. ClawSweeper reviewWhat this changesThe PR publishes accepted Gateway configuration before updating heartbeat and Workshop schedules, fences scheduler follow-up work, and removes an obsolete test assertion. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main retains the problematic publication order. No blocking defect was found in the introduced changes, and the prior review supplied no unresolved findings. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway turns accepted configuration into persisted heartbeat and Workshop schedules. Its reload coordinator also manages scheduler replacement, cancellation, and recovery when those schedules cannot converge. flowchart TD
A[Configuration change] --> B[Validate and prepare]
B --> C[Publish accepted runtime]
C --> D[Check scheduler ownership]
D --> E[Update persisted monitors]
E --> F[Scheduled agent work]
E --> G[Recovery and current-config retry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +379, Docs 0. Total +387 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep accepted runtime configuration authoritative and let the existing scheduler owner converge derived monitor rows with explicit recovery on failure. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a concrete path: fail a later monitor write after an earlier row succeeds, then reject publication while the candidate retry remains. The PR supplies targeted failing-before regressions; this review did not execute them. Is this the best way to solve the issue? Yes. Moving convergence behind acceptance and removing config overrides repairs the existing ownership boundary without adding a competing scheduler, public API, setting, or schema. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8964a4d8dc2f. LabelsLabel 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)
|
Keep accepted runtime config authoritative when system monitor convergence partially fails. Remove candidate config overrides from reconciliation and bind retries to the current accepted config. Tie predecessor scheduler cleanup to runtime commit, including later policy publication failures. Fence monitor and startup follow-ups by accepted cron ownership and Gateway lifecycle while allowing pending config candidates. Ref #130706.
The assistant-failure input no longer exposes maybeRetryTransient. Remove the stale matcher while retaining the storage outcome, retry counter, and credential-rotation assertions. Ref #139509.
bc86ad1 to
8c84e25
Compare
|
Merged via squash.
|
…9509) * fix(gateway): publish config before reconciling monitors Keep accepted runtime config authoritative when system monitor convergence partially fails. Remove candidate config overrides from reconciliation and bind retries to the current accepted config. Tie predecessor scheduler cleanup to runtime commit, including later policy publication failures. Fence monitor and startup follow-ups by accepted cron ownership and Gateway lifecycle while allowing pending config candidates. Ref openclaw#130706. * test(agents): drop obsolete storage-failure retry assertion The assistant-failure input no longer exposes maybeRetryTransient. Remove the stale matcher while retaining the storage outcome, retry counter, and credential-rotation assertions. Ref openclaw#139509.
…9509) * fix(gateway): publish config before reconciling monitors Keep accepted runtime config authoritative when system monitor convergence partially fails. Remove candidate config overrides from reconciliation and bind retries to the current accepted config. Tie predecessor scheduler cleanup to runtime commit, including later policy publication failures. Fence monitor and startup follow-ups by accepted cron ownership and Gateway lifecycle while allowing pending config candidates. Ref openclaw#130706. * test(agents): drop obsolete storage-failure retry assertion The assistant-failure input no longer exposes maybeRetryTransient. Remove the stale matcher while retaining the storage outcome, retry counter, and credential-rotation assertions. Ref openclaw#139509. (cherry picked from commit 26178af)
Config reload could change persisted heartbeat or Workshop monitors before accepting the new runtime config. If a later row write failed, the Gateway could roll back config/secrets while rows and a retry still represented the rejected candidate.
Publish runtime config and policy before converging monitor rows, remove the internal config-override reconciliation path, and bind each pass/retry to current accepted config. Partial convergence keeps that config authoritative and uses the existing recovery-required outcome. Cron replacement also owns predecessor cleanup after commit: cleanup now runs even when policy publication fails, while lifecycle/accepted-owner checks prevent retired services from reconciling monitors or restarting. Pending candidates do not interrupt an accepted owner's work.
This is the focused publication/scheduler repair extracted from #130706. Current Workshop execution remains an ordinary isolated agent turn with canonical declaration-key identity. No new config option, protocol, SQLite schema, or public API is added.
Validation:
Production: +94/-86, net +8. Tests/support: +463/-84, net +379. Documentation: net 0. The small production growth enforces accepted cron/lifecycle ownership and commit-bound cleanup; the config-override and pre-publication reconciliation paths are removed. Gateway recovery behavior and monitor ownership are the merge-sensitive surfaces.
Live proof used the QA Lab mock OpenAI provider with an actual compiled Gateway, authenticated RPC, SQLite, and normal tools. The live-tested publication tree was 1bf51d1ae2771c60a421177dde7cd145a39e465e. After the mechanical rebase onto frozen main f284a91, all three publication production files remain byte-for-byte identical to that live-tested source. Testbox run: final command exited0; lease was stopped and native status confirmed completed. The first attempt exposed missing synthetic Workshop material for the mock's generic reader; seeding SKILL.md at the canonical execution root fixed the fixture, with no production change.
{ "passed": true, "sourceTree": "1bf51d1ae2771c60a421177dde7cd145a39e465e", "sourceVerified": true, "samePid": true, "sameBoot": true, "connections": 1, "monitorObservations": 11, "workshopRun": "ok", "workshopReadObserved": true, "leaseStatus": "completed" }The first PR CI run inherited a stale assertion from current main: the storage-failure test referenced
input.failover.maybeRetryTransientafter that member was removed from the owner contract and fixture. This caused both TS2339 and the runtime matcher failure. Remove that one obsolete assertion; retain the storage outcome/counter and both credential-rotation assertions. The failure reproduced on the rebased main, then all 23 tests in the affected file and its canonical agents-other TypeScript graph passed. Independent P2 review of the test-only repair is clean. This follow-up changes no production code, configuration, API, or schema.Current head
8c84e255ee661f48c9e0ffddd05003a63dcab887rebases the publication repair ontof284a91e0aca674ed4771a39415fdaee201c621c. The live proof above remains tied to its original tree; it is not represented as a new live run of the rebased aggregate.At landing, main already contained the identical test repair from #139519. The resulting merge therefore introduces only the eight publication-related paths: production net +8, tests/support net +380, documentation net 0.