Repository navigation
fix: plugin config edits stall busy gateways and report saved before applying - #196570
Conversation
Track actual plugin capability custody per turn, while preserving advance custody for hooks, model-provider fallback, and generation overlap. Keep registry construction outside turn invocation tracking. Defer busy automatic reloads before readiness/admission fencing and reuse the reload owner's saved-revision outcome until retained work and cleanup settle. Make config.set await application and expose saved-but-deferred receipts to config.patch/config.apply and the Control UI without discarding saved edits. Explicit reload drain budgets remain unchanged. Allocate 286 regression-test lines for exact-instance custody, nonblocking reload and watcher retry behavior, and truthful saved/deferred UI outcomes.
|
🦞👀 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 Summary: ✅ CompletedThis 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 changesThis PR tracks actual plugin use, defers busy automatic reloads without blocking unrelated runs, and distinguishes saved settings from applied settings. Example: Change reload-proof configuration from revision 1 to revision 2 while a turn retains the plugin.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it fixes a current Gateway availability and Settings feedback bug, resolves all three prior findings, and introduces no new actionable finding; required CI remains incomplete. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSettings writes enter the Gateway config owner, which persists revisions and coordinates plugin replacement; application receipts and revision polling tell the UI when saved configuration becomes active. flowchart TD
A[Settings edit] --> B[Gateway config owner]
B --> C[Persisted revision]
B --> D[Plugin reload owner]
E[Retained plugin work] --> D
D --> F[Active plugin generation]
D --> G[Application receipt]
G --> A
F --> A
Technical reviewBest possible solution: Retain the existing lifecycle and draft owners, defer busy automatic replacement before admission fencing, and land this repair once required validation is settled. Do we have a high-confidence way to reproduce the issue? Pinned main retains the false-success config.set path and bounded automatic drain; the submitted isolated Gateway reproduction demonstrates the corresponding stalled admission and stale active configuration. Is this the best way to solve the issue? The repair addresses custody and reload admission at their existing owners, preserves explicit drain and overlap contracts, and reconciles persisted receipts through the existing UI draft owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3a1a9cf0de3a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +255, Tests +357, Docs +15, Other +539. Total +1166 across 48 files. Added test files: 0. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 10, 2026, 5:45 AM ET / 10:45 UTC (Revision 2). |
Use each retained instance's declaration for turn handover and preserve exact generation identity. Migrate config receipt and custody consumers, proving foreign-instance handover and release of distinct inventory holds.
|
Addressed all three review items at
Focused final proof passes 23/23 handover/custody tests and 30/30 config-auth, channel lifecycle, and reload-owner tests. The channel consumer validates the structured saved/deferred result and bounded actual application, preserving the unchanged sibling. Fresh Codex autoreview is clean at P0–P2. The changed-file check passes its guards, formatting and typechecks; three new test-variable lint errors were repaired and targeted lint passes. The remaining dead-export findings match the qualified original parent; the test allocation covers all 357 added lines while preserving the 293-line baseline debt. The PR body now records the completed published @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…applying (openclaw#196570) * fix: defer busy plugin config edits without blocking new runs Track actual plugin capability custody per turn, while preserving advance custody for hooks, model-provider fallback, and generation overlap. Keep registry construction outside turn invocation tracking. Defer busy automatic reloads before readiness/admission fencing and reuse the reload owner's saved-revision outcome until retained work and cleanup settle. Make config.set await application and expose saved-but-deferred receipts to config.patch/config.apply and the Control UI without discarding saved edits. Explicit reload drain budgets remain unchanged. Allocate 286 regression-test lines for exact-instance custody, nonblocking reload and watcher retry behavior, and truthful saved/deferred UI outcomes. * fix: preserve handover for late-resolved plugins Use each retained instance's declaration for turn handover and preserve exact generation identity. Migrate config receipt and custody consumers, proving foreign-instance handover and release of distinct inventory holds.
* test(gateway): accept deferred pending-install application receipts Complete the #196570 fixture migration at the pending-install write. Accept only applied or the canonical structured deferred receipt, then observe the installed label within the existing ten-second budget. Preserve account starts, process identity, sibling identity and work retirement protections. CI evidence: full 43209070232, job 131152198636. Focused syntax, formatting and diff checks pass; fresh canonical autoreview through P2 is scoped-clean. Runtime red/green remains with the parent AWS proof owner. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> * fix(test): accept deferred pending-install receipts Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 1ce77483-226e-8415-919a-0c3aa109f7b6 --------- Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
* test(gateway): accept deferred pending-install application receipts Complete the openclaw#196570 fixture migration at the pending-install write. Accept only applied or the canonical structured deferred receipt, then observe the installed label within the existing ten-second budget. Preserve account starts, process identity, sibling identity and work retirement protections. CI evidence: full 43209070232, job 131152198636. Focused syntax, formatting and diff checks pass; fresh canonical autoreview through P2 is scoped-clean. Runtime red/green remains with the parent AWS proof owner. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> * fix(test): accept deferred pending-install receipts Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 1ce77483-226e-8415-919a-0c3aa109f7b6 --------- Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes: editing a busy plugin's configuration can repeatedly hold readiness at 503 and delay unrelated runs for 60 seconds, while Settings reports “Saved” even though the previous configuration remains active.
User Impact
Automatic edits keep the Gateway available and report Saved; waiting to apply, with the reason and application condition. Saved values remain visible; the message clears when the active revision catches up. The previous plugin configuration remains active until its work settles or the Gateway restarts. Explicit plugin reload commands retain their existing bounded drain behavior.
Why This Change Was Made
Turn custody now follows actual capability resolution/invocation instead of every loaded plugin. Nested resolution records the exact instance it uses, including instances outside the initial registry; the loader owns construction outside turn-use tracking. Hooks and model providers keep advance custody for late finalization/fallback, and overlap-capable plugins preserve their existing admitted-consumer contract.
The automatic reload owner defers before reserving replacement or fencing admission. It records that saved revision's outcome and reuses it for watcher echoes until work and cleanup settle.
config.setnow awaits the same owner receipt asconfig.patch/config.apply; deferred application returns an unsuccessful response with additive structured details and the persisted revision. The UI adopts that saved receipt without pretending it applied. Current main already returned generic application failures for hot-applicable patch/apply writes; the reproduced false-success Settings path wasconfig.set.No config options, protocol version bump, SQLite schema changes, or new scan caches. Net production growth is 255 lines: exact-instance custody, deferred outcome ownership, and API/UI reconciliation replace the blanket self-hold scans. The 357-line test allocation covers the distinct custody, nonblocking reload, and saved/deferred UI regressions.
The review follow-up also resolves handover from each retained instance’s own declaration, including plugins discovered outside the initial model registry. This removes the old ID-based registry scan and preserves both whole-run yielding and model-step handover.
Evidence
Real isolated Gateway and Control UI, synthetic plugins and sessions, deterministic local Responses model. Five interleaved A/B runs on the same Node version, with 40 plugins, ten unrelated held turns, one plugin-using held turn, and additional unrelated replacements during deferral:
Several baseline runs repeated the drain and stayed unready for roughly 115–117 seconds. The invoked plugin retains its real work; a fresh actual tool call after application returns the new configuration revision. Owner measurements pinned to
8c4ec655ebaduse 4,000 leases per run, 40 plugins, and 16 resolved tools, with five interleaved pairs and five A/A controls. CPU falls from 62.485 to 55.195 µs/lease (−11.7%), median elapsed time from 50.750 to 43.750 µs (−13.8%), and sampled allocation from 138,520 to 116,423 B/lease (−16.0%). P95 changes from 72.167 to 73.125 µs (+1.3%); no tail-latency improvement is claimed. A/A CPU medians are 58.944/58.258 µs, elapsed time 48.459/48.042 µs, and allocation 138,844/138,162 B. Measurement snapshots and final correctness evidence are recorded separately.Full synthetic-scale proof on
8c4ec655ebad: real btrfs, a 35.19 GiB agent database, 10,800 sessions, 212,888 transcript events, and 62,002 workspace files; Linux/Node 26.12.1 in a 4-CPU/16-GiB container. Save reports deferred in 580 ms, unrelated admission takes 696 ms, and readiness passes 57/57 probes. Releasing the plugin holder applies the edit in 2.7 seconds; a fresh actual tool invocation returns revision 2. Empty-plugin holds remain zero. Native database integrity checking took about 400 seconds before startup and is excluded from the measured reload window; it was not bypassed. The original retained fixture image was never mounted or modified.Focused
8c4ec655ebadsource: 55/55 lease/loader tests and 328 passed, one existing skip across six Gateway suites. UI: 58/58 config owner tests, 32/32 footer/plugin browser tests, 5/5 Settings E2E tests, and the plugin mutation E2E. Regressions fail before the corresponding fixes.pnpm check:changedpasses typechecks, lint, format and other guards except the exact-parent dead-export findings described below. Codex autoreview of the complete final change (8c4ec655ebadagainstcdd7ee54ee8d), including loader-owner context, reports zero actionable P0–P2 findings.Follow-up proof for
fd1dccd06ce1(two naming-only test renames followed, with targeted lint passing): 23/23 handover, real nested-loader, inventory, and borrowed-tool tests; 30/30 config-auth, channel lifecycle, and reload-owner tests. The two foreign-instance handover regressions fail before repair. Fresh Codex autoreview of the complete follow-up reports zero actionable P0–P2 findings. Inventory custody is explicitly checked at 2 → 1 → 0, and the channel test requires eventual application within ten seconds while preserving the untouched sibling. The scale, package-upgrade, and real-model artifacts remain pinned to8c4ec655ebad; the follow-up changes handover eligibility and consumer tests, with targeted proof for that delta.The canonical full package build passes, including SDK declarations and the Control UI. The isolated published
2026.11.2→ exact8c4ec655ebadpackage upgrade passes in 437 seconds through the updater, Doctor, restart, readiness, health, and status checks; no fallback repair was needed. The manual-restart upgrade lane does not run live models.A separate real-model proof on
8c4ec655ebaduses onegpt-4.1-miniturn with two successful Responses requests. The model invokes the actual plugin; its second request is held across the config edit. The deferred receipt takes 526 ms, unrelated admission 191 ms, and readiness passes 18/18 probes. Releasing the holder applies the edit in 2.25 seconds, and a subsequent actual tool call verifies revision 2. Unrelated and post-application model responses remain deterministic. This supplements the synthetic timing fixture rather than relabeling it as real-model traffic.Inherited checks and investigated local failure
The full build's nonfatal UI budget report flags largest JS gzip (551.5 KiB versus 551.3 KiB), chat boot (1,269.5 versus 1,268.3 KiB), and new boot (784.9 versus 784.5 KiB). These warnings are not described as passing budgets or all classified inherited; no budget baseline was changed.
The exact parent reproduces the same 32 production / 10 full-tree unused exports; the final scan introduces none. Per-symbol history attribution includes #192552, #196207, #196252, #191326, #139911, #190205, #132716, #129184, #190544, #191513, #194455, #130634, #103537, #121929, #151777, and direct commit
a7436c8b4a93. These remain main regressions, not passing checks.The test-line ratchet remains 293 lines over its absolute ceiling on both the exact parent and candidate. This change allocates exactly its own 357-line increase. Existing debt comes from #194996 (+71), #188748 (+223), and #194429 (−1); no baseline exception or unrelated budget increase was added.
CI run 42793106430 tested merge
cb60a5886b50with main parent8c9a5cf064ff. Three formatter failures reproduce on that exact main parent and were introduced by #196501 (09723cdcad18); the original branch parent predates them. Two worker context-engine failures also reproduce on that exact main parent, while all three tests pass on #196337’s exact predecessor (54e0bc0c2132). Commitd7aaafe92edfmoves input persistence after prompt/context assembly, causing the missing transcript fences. These are recorded as main regressions requiring owner repair; the worker assertions remain unchanged.Final CI run 42800384505, attempt 1, tested head
fd1dccd06ce18in merge50f53af9fff1over exact main3a1a9cf0de3a. All UI and UI E2E shards, type/lint/guards, PostgreSQL, and security-fast pass. The only failed test shard contains those same two worker fence cases: they reproduce on that exact main parent (two failures, one pass), with the causal predecessor proof above. The old formatting failure is fixed on newer main by5f27b11f9f135; final docs CI passes. The scoped inherited-failure landing exception retains CI as failed and leaves the worker assertions intact. Final-head ClawSweeper re-review has zero open items and zero findings.An earlier run under concurrent workload observed
recoveringinstead ofreloadingin the separate-registry memory recovery case. Narrow baseline/candidate replays and the final six-suite run pass. A full exact-parent run independently fails the sibling early-checkpoint recovery case at the same phase assertion. The fixture/assertion originated in #167756; that establishes provenance, not the causal introduction of an intermittent defect. The original candidate-only failure remains investigated but unattributed; a passing replay is not claimed as a fix or grounds for an inherited-CI waiver.