Repository navigation
refactor(infra): simplify update campaign cleanup ownership - #146555
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 14, 2026, 2:19 AM ET / 06:19 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR consolidates automatic-update campaign cleanup in the existing clear operation and removes its redundant test-reset path. Merge readiness✅ Ready for maintainer review Keep open: this remains a distinct, useful cleanup with no actionable correctness findings. The earlier merged constructor cleanup did not implement it, and the maintainer-authored, protected PR is not eligible for automatic closure. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway's update scheduler creates campaigns that wait for idle work, count down, and initiate an update. Campaign cleanup cancels its timer and clears process-local state; the scheduler lifecycle separately waits for pending work to finish. flowchart TD
A[Update checks] --> B[Campaign controller]
B --> C[Idle wait and countdown]
C --> D[Update handoff]
E[Lifecycle stop or test reset] --> F[Clear timer and campaign state]
F --> G[Notify schedule observers]
E --> H[Wait for pending work]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -9. Total -9 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep campaign state cleanup in clear() and pending-work settlement in the existing lifecycle owner, preserving notification order and update behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports redundant cleanup plumbing rather than a user-facing defect; source inspection confirms that redundancy. Is this the best way to solve the issue? Yes: inlining the single-use helper and relying on the existing lifecycle stop removes duplication without changing the production reset sequence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8c776697bf3f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Inline the single-use campaign reset into clear and remove the redundant test reset call. Keep the startup reset API, synchronous observer ordering, timer cancellation, and lifecycle-owned joining unchanged. Production: +5/-14, net -9. No shipping test changes. Validation: the unchanged owner and Gateway sibling selection passed all 173 cases on both original and candidate. Lifecycle controls passed on both roles and detected omitted timer cancellation, reordered notification, and omitted startup stopping. The configured changed-check command completed its 29-check local fallback with exit 0 after the remote wrapper hit a cleanup-status TLS timeout. Remote cleanup exit 1 is retained; no separate remote command success is claimed. No real updater service or Gateway restart was exercised.
b139ee1 to
6ed954d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* commit '069710f909f0a7158777d0fc0bf1eab84e20c699': (45 commits) refactor(infra): consolidate update campaign reset ownership (openclaw#146555) refactor: simplify Gateway health response parsing (openclaw#147834) fix: avoid Gateway stalls when renaming sessions (openclaw#147869) refactor(plugins): reuse worker optional-method validation (openclaw#147925) refactor(infra): remove unreachable firewall diagnostic fallback (openclaw#147882) fix(ui): open attached automations from session hovercards (openclaw#147749) refactor(reply): share usage-bar numeric coercion (openclaw#147863) fix(doctor): report warnings for keyed agent configs (openclaw#123058) perf(plugins): reuse complete registry comparisons (openclaw#147893) fix(workboard): await lifecycle sweep completion in tests (openclaw#147950) fix: reduce stalls when browsing large session inventories (openclaw#147911) refactor(onboard): share custom model definition (openclaw#147915) feat(ios): collapse completed chat work above replies (openclaw#148002) fix(voice-call): retain state runtime for deferred streams (openclaw#147689) test(qa): compare Telegram entities semantically (openclaw#147752) fix(plugins): preserve runtime scope for deferred CLI actions (openclaw#147688) test(qa): keep Slack progress marker visible (openclaw#147748) test(qa): finish channel picker prompts (openclaw#147730) test(tui): handle auth restriction prompt (openclaw#147729) fix(qa): retain onboarding prompts across redraw bursts (openclaw#147687) ...
* commit 'a08cdc50bc049074ed7ad2db9e18e0ed3f5415ec': (81 commits) perf: reuse stateless plugin scope defaults (#148080) fix(gateway): flush slow-consumer 1008 close frame before terminating socket (#147707) fix: keep model catalogs loading during other session updates (#147878) fix: show queued external chat messages and their source (#147848) refactor(chat): share math label configuration (#148073) perf(ui): trim eager debug overlay icon payload (#147954) improve(logbook): sample batch frame metadata in SQLite (#147999) fix(ui): dismiss suggested task cards without waiting (#148021) fix(maturity): cover governance, interoperability, fleet, and state (#143528) chore(ui): restore core lint and startup budget checks (#148010) fix: chat startup loads unnecessary session setup text (#147973) perf: speed up fresh cloud worker activation (#147945) fix: recover PR preparation after committed merge conflicts (#148063) test(plugins): isolate ClawHub Docker fixture identity (#148074) fix(release): acknowledge ClawHub risk on moving installs (#148041) fix: restore context reads for installed official Discord and Slack plugins (#143341) fix: identify source capsule filesystem failures (#147778) fix(linux): keep Quick Chat widgets bound to their Gateway (#146049) refactor(infra): consolidate update campaign reset ownership (#146555) refactor: simplify Gateway health response parsing (#147834) ...
* commit '7d485aa2e89af7fdbd09e8ed0489b06d250b07e3': test(scripts): check the configurable ClawHub sweep spec fix: show queued external chat messages and their source (openclaw#147848) refactor(chat): share math label configuration (openclaw#148073) perf(ui): trim eager debug overlay icon payload (openclaw#147954) improve(logbook): sample batch frame metadata in SQLite (openclaw#147999) fix(ui): dismiss suggested task cards without waiting (openclaw#148021) fix(maturity): cover governance, interoperability, fleet, and state (openclaw#143528) chore(ui): restore core lint and startup budget checks (openclaw#148010) fix: chat startup loads unnecessary session setup text (openclaw#147973) perf: speed up fresh cloud worker activation (openclaw#147945) fix: recover PR preparation after committed merge conflicts (openclaw#148063) test(plugins): isolate ClawHub Docker fixture identity (openclaw#148074) fix(release): acknowledge ClawHub risk on moving installs (openclaw#148041) fix: restore context reads for installed official Discord and Slack plugins (openclaw#143341) fix: identify source capsule filesystem failures (openclaw#147778) fix(linux): keep Quick Chat widgets bound to their Gateway (openclaw#146049) refactor(infra): consolidate update campaign reset ownership (openclaw#146555) refactor: simplify Gateway health response parsing (openclaw#147834)
…w#146555) Inline the single-use campaign reset into clear and remove the redundant test reset call. Keep the startup reset API, synchronous observer ordering, timer cancellation, and lifecycle-owned joining unchanged. Production: +5/-14, net -9. No shipping test changes. Validation: the unchanged owner and Gateway sibling selection passed all 173 cases on both original and candidate. Lifecycle controls passed on both roles and detected omitted timer cancellation, reordered notification, and omitted startup stopping. The configured changed-check command completed its 29-check local fallback with exit 0 after the remote wrapper hit a cleanup-status TLS timeout. Remote cleanup exit 1 is retained; no separate remote command success is claimed. No real updater service or Gateway restart was exercised.
Related: #138398
What Problem This Solves
Update-campaign lifecycle cleanup needs one clear, auditable owner.
User Impact
User impact: no intended user-visible change; this is internal maintenance, not a reported update failure. Automatic-update countdown, hold, cancellation, and pending-work cleanup remain unchanged. No configuration, dependency, schema, or RPC change is introduced by this patch.
Why This Change Was Made
Remove duplicate reset plumbing while preserving cleanup order and the lifecycle owner's responsibility for pending work. The startup test-reset API stays in place. Production is +5/-14, net -9 lines, with no shipping test changes.
Evidence
The refreshed head passed 177 macOS cases and the original 125-file Linux group: 3,067 cases, including the previously timed-out lifetime test. Fresh exact-commit review returned no findings at the P0-only threshold. The current changed-check command passed 29 local checks after automatic fallback; its remote command verdict remains unknown, not a clean remote pass. New-head hosted CI is pending.
No real package update, updater-service handoff, or Gateway restart was exercised; this patch preserves the existing reset sequence rather than changing those workflows.
Detailed proof, refresh reason and retained limits
The lifecycle stop and campaign
clear()remain the cleanup owner. This removes the redundant campaign test-reset method and inlines its now-single-use private helper, preserving timer cancellation, state-reset ordering and synchronous observer notification. Pending update work is still joined by the lifecycle owner. The earlier constructor cleanup in #138398 is not counted again.inspectas its reserved debugger command; correcting that metadata argument did not replay tests.