Skip to content

fix(memory-core): plugin reload times out during slow dreaming cleanup - #169945

Merged
RomneyDa merged 1 commit into
openclaw:mainfrom
Stronggenetics:fix/memory-startup-cleanup
Oct 20, 2026
Merged

RomneyDa merged 1 commit into
openclaw:mainfrom
Stronggenetics:fix/memory-startup-cleanup

Conversation

@Stronggenetics

@Stronggenetics Stronggenetics commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #152275

What Problem This Solves

Fixes: reloading the memory plugin on a running Gateway fails with a start-hook timeout when cleanup of old dreaming sessions takes longer than five seconds.

User Impact

User impact: slow historical dreaming cleanup no longer fails memory-core's start hook during plugin replacement, so reload can complete while maintenance continues. No configuration, migration, or operator action is required. Update behavior: none; no stored state, schema, or config changes, and the new behavior applies the next time the plugin loads.

Why This Change Was Made

Reclaiming historical dreaming sessions is maintenance, not an activation prerequisite. The gateway_start hook now starts that cleanup in the plugin's existing instance-owned background context instead of awaiting it inside the replacement owner's 5-second hook deadline. Relative to the refactored upstream lifecycle, cleanup failures are still logged, the disposed-instance checks stop cleanup before the next agent, the startup age cutoff is unchanged, and service stop still waits for admitted cleanup. The core lifecycle owns instance/generation binding; this change does not restore the removed plugin-local generation counter. The two timers in the same file already start their work this way.

Accepted edge: on a normal boot the hook also returns before the cleanup finishes. The cleanup's cutoff is fixed at service start, so sessions created afterwards are never classified as orphans.

This complements the owner and catalog recovery in #152530. It does not claim to fix every cause in #152275 and adds no automatic Gateway restart.

Evidence

Real behavior proof: memory-core reload on a running Gateway while historical dreaming cleanup takes longer than five seconds.

Historical runtime proof (2026-10-12): a Gateway built from original PR head 6fa06af96d5b29c2a187d7419587f557b1fda8b5 with pnpm build runs from the checkout on loopback with its own empty state directory and config: 12 agents, no channels, no provider credentials, no model calls. While it runs, a script writes 30 leftover dreaming sessions into each agent's session store (360 in all) and one ordinary session. Once they are older than the five-minute orphan guard, memory-core is replaced with plugins reload memory-core --wait. The same script was then run against a build of original base 37064938.

pnpm install --frozen-lockfile && pnpm build
export OPENCLAW_STATE_DIR=<state-root>/state OPENCLAW_CONFIG_PATH=<state-root>/openclaw.json OPENCLAW_SKIP_CHANNELS=1
node openclaw.mjs gateway run --port <port> --bind loopback &
node seed.mjs   # per agent: 30 sessions agent:<id>:dreaming-narrative-<phase>-hist-<n>, 4 messages each, via dist/plugin-sdk
sleep 315       # every leftover is now older than the 5-minute guard
node openclaw.mjs plugins reload memory-core --wait --json
node openclaw.mjs gateway call health --json

With the original PR fix (6fa06af9) the reload succeeds, the Gateway answers while the cleanup runs, and the cleanup ends 10.3 s after the reload call was answered (14.8 s after the replacement was applied). gateway lines are the Gateway's own output; driver is the script; observer reads the stores read-only. Times are UTC; lines are verbatim, with ten identical cleanup lines left out where marked.

15:41:30.429 driver   store before reload: leftover=360 (per agent 30,30,30,30,30,30,30,30,30,30,30,30) active=1 (dreaming-narrative-light-active-before-0000) user=1 (chat-u-0000)
15:41:30.992 driver   reload: plugins reload memory-core --wait --json
15:41:45.992 gateway  [gateway] Plugin replacement applied: memory-core
15:41:48.452 observer store: leftover=330 (per agent 30,30,30,30,30,30,30,30,30,30,30,0) active=1 user=1
15:41:50.518 gateway  [ws] ⇄ res ✓ plugins.reload 10638ms bytes=445 conn=<id> id=<id>
15:41:50.731 driver   reload returned: exit 0 after 19728 ms
15:41:50.811 gateway  [plugins] memory-core: dreaming cleanup scrubbed 30 stale session entries and archived 0 orphan transcripts.
15:41:54.442 gateway  [ws] ⇄ res ✓ health 52ms cached=true bytes=7458 conn=<id> id=<id>
15:41:54.678 driver   health after reload: ok=true memory-core loaded=true plugins loaded=19 errors=0 unavailable=0
             (ten more "scrubbed 30 stale session entries" lines, one per agent store, 15:41:52.514 to 15:41:59.847)
15:42:00.184 observer store: leftover=0 (per agent 0,0,0,0,0,0,0,0,0,0,0,0) active=2 user=1
15:42:00.798 gateway  [plugins] memory-core: dreaming cleanup scrubbed 30 stale session entries and archived 0 orphan transcripts.
15:42:07.594 driver   store after: leftover=0 (per agent 0,0,0,0,0,0,0,0,0,0,0,0) active=2 (dreaming-narrative-light-active-after-0000,dreaming-narrative-light-active-before-0000) user=1 (chat-u-0000)

Without it (base 37064938), same script, same history:

15:50:20.495 driver   reload: plugins reload memory-core --wait --json
15:50:32.281 gateway  [gateway] Plugin replacement applied: memory-core
15:50:36.445 gateway  [plugins] memory-core: dreaming cleanup scrubbed 30 stale session entries and archived 0 orphan transcripts.
15:50:37.312 gateway  [gateway] Plugin activation or recovery failed. Retry openclaw plugins reload <id> after admitted work settles, or restart the Gateway. Inspect the Gateway log for the failure.
15:50:38.825 gateway  [ws] ⇄ res ✗ plugins.reload 11848ms errorCode=UNAVAILABLE errorMessage=Plugin operation failed during activate: [hooks] gateway_start handler from memory-core failed: timed out after 5000ms
15:50:39.039 driver   reload returned: exit 1 after 18540 ms
Original PR head 6fa06af9 Original base 37064938
Reload exit 0; call answered ✓ after 10.6 s exit 1; UNAVAILABLE, start hook timed out after 5000ms
Cleanup 12 stores, 360 leftovers removed; first removal seen 2.5 s after the replacement was applied, last cleanup line 14.8 s after it same cleanup, last line 15.3 s after the replacement was applied (it keeps running after the hook has timed out)
Kept the dreaming session written about a minute before the reload (inside the guard), the one written after it, and the ordinary session the same three

Real: the Gateway process with its plugin loader and hook runner, memory-core with its cleanup code, and the per-agent SQLite session stores. Synthetic: only the session history, written by a script through the shipped plugin-sdk/session-store-runtime and plugin-sdk/session-transcript-runtime exports with real timestamps; nothing was backdated or mocked and no product code was changed. Why 12 agents with 30 sessions each: on the test machine the cleanup costs roughly 0.6 to 0.9 s per agent store that holds leftovers and very little per session at the sizes measured (5 to 40 per store), so the scenario exceeds the deadline through many stores rather than many sessions; 30 per store is ten nights of three dreaming phases.

Not exercised: model or reply ownership after the failed reload on original base (no provider is configured); health still answered there and listed memory-core as loaded, so this proof does not establish loss or recovery of model and reply owners. The session written after the reload landed after its store had already been cleaned in both runs, so the session that shows an active run surviving a cleanup pass over its own store is the one written before the reload.

These runtime observations were not rerun after the lifecycle refactor. The supported reload still reaches the same real hook runner with the same 5,000 ms deadline; the rebuilt change is covered by current-base focused regression and lifecycle tests.

  • Regression, at the owning boundary: the lifecycle test drives the real hook runner with the replacement owner's settings (errors propagate, 5,000 ms start-hook deadline). On the rebuilt branch's unmodified upstream base 89aa2740aa23, the deadline regression fails with gateway_start handler from memory-core failed: timed out after 5000ms. Only that case was run without the fix in this rebuild.
  • With the rebuilt fix (57319cb14bba on base 89aa2740aa23), 17 focused cases pass: 3 lifecycle cases (early hook return with shutdown join; late cleanup warning; retired-instance cleanup stops before the next agent and the successor cleans both agents), 7 existing real-SQLite cleanup contracts, and 7 neighboring background-context and gateway-hook cases.
  • Cost: the final combined memory-core command, pnpm test extensions/memory-core/src/dreaming-startup-lifecycle.test.ts extensions/memory-core/src/dreaming-startup-cleanup.test.ts --maxWorkers=1, passed 10 cases in 84.10 s wall; reported lifecycle case time was 0.139 s and existing SQLite case time was 43.289 s. The storage cases are unchanged apart from awaiting the background work they used to await inside the hook.
  • pnpm build completed successfully on rebuilt head 57319cb14bba (exit 0), taking about 75 min wall on a loaded machine; package declaration generation took about 63 min.
  • Production-source types (pnpm tsgo:extensions) and extension-test types (pnpm tsgo:extensions:test) pass on the rebuilt head. Type-aware oxlint on the three touched files reports 0 warnings and 0 errors, and their pnpm format:check passes. After memory-core package-boundary artifact preparation, node scripts/run-tsgo.mjs -p extensions/memory-core/tsconfig.json --noEmit reports 4 errors in two untouched test-support files, for missing test-only SDK modules plugin-state-test-runtime and sqlite-runtime-testing; the diagnostics are byte-identical with dreaming.ts restored to base 89aa2740aa23, and none is in the changed file. That raw package-boundary command is not a pass; its result does not establish an upstream defect.
  • Historical validation of original head 6fa06af9: pnpm check passed all 25 preflight guards and the production, scripts, and test-root type checks. Its whole-repository lint stage did not complete on the machine used (the SDK boundary declaration step exceeded its default 300 s limit there), so whole-repository lint and format were left to CI. The eight closing policy guards were run separately and passed.
  • Historical validation of original head 6fa06af9: pnpm test:extension memory-core had 1,761 passed and 4 skipped. 18 cases in two files that call a local HTTP server (chunking-upgrade-real-transport.test.ts and memory/generic-embedding-provider.integration.test.ts) failed with fetch failed, because the shell used routes HTTP through a proxy without NO_PROXY. Both files passed, 19 of 19, on original head 6fa06af9 with the proxy variables unset.
  • Not rerun locally for the rebuilt commit: the full test suite, full memory-core suite, repository-wide pnpm check, and the earlier unrelated isolated timeout cases. Current-head hosted CI remains the broad proof.
  • The original head was reviewed independently twice. This rebuild follows upstream's centralized lifecycle; its tests are adapted and the patch is not byte-identical. No new self-review or autoreview round was run for this rebuild. The hosted reviewer subsequently re-reviewed head 57319cb14bba, identified no findings, and marked the proof sufficient.
  • Historical hosted CI for original head 6fa06af9: 38 checks passed, 62 were skipped, none failed. Hosted CI on rebuilt head 57319cb14bba, observed on 2026-10-13, has 39 checks passed, 55 skipped, and 0 failed. Nothing was deployed to a production Gateway and no live provider was used; the runtime proof above used the original head on a local throwaway Gateway.

@clawsweeper

clawsweeper Bot commented Oct 12, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

The PR lets historical dreaming-session cleanup continue in tracked background work after the Gateway start hook returns.

Example: Reload memory-core with 12 agent stores containing 360 stale dreaming sessions.

  • Before: The reload fails when cleanup exceeds the start hook's 5,000 ms deadline.
  • After: The reload succeeds while cleanup continues, preserving active and ordinary sessions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The narrow repair has real Gateway evidence and meaningful lifecycle coverage; readiness remains capped by the unresolved startup-ordering product decision.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The original repaired head ran the supported reload CLI against a throwaway Gateway and real SQLite history, avoiding the timeout while cleanup removed 360 stale sessions and preserved active and ordinary sessions. GitHub verifies the same await-to-void repair in that head; current lifecycle tests cover the rebuild's owner settlement and retirement. The runtime scenario was not rerun after the lifecycle refactor.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Reloading memory-core fails when historical dreaming cleanup takes longer than five seconds.
Reason: The focused timeout repair has clear value, but changing normal-boot hook completion requires an area-owner decision; the broader linked issue correctly remains Related.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR addresses a current memory-core reload timeout with a narrow change; no concrete introduced defects were found.

Priority: P2
Reviewed head: 57319cb14bba6d190acfd8e14ce9c3d308976626
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the Gateway start hook return before historical dreaming cleanup finishes on normal boot as well as plugin replacement?
  • Recommendation: Approve background cleanup for both paths: Accept the documented normal-boot ordering change because cleanup remains age-safe, instance-owned, and joined at stop.
  • Why: This changes startup ordering retained by recent area-owner work; the contributor documents the tradeoff, but no human owner approval of this direction appears in the discussion.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Agent review details

How this fits together

Memory-core's dreaming service owns startup maintenance, timers, and pending cleanup; the Gateway invokes its start hook during boot and plugin replacement.

flowchart TD
A[Plugin reload CLI] --> B[Gateway replacement owner]
B --> C[Gateway start hook]
C --> D[Instance background context]
D --> E[Historical session cleanup]
E --> F[Agent SQLite stores]
G[Dreaming service stop] --> D
Loading

Technical review

Best possible solution:

Use the existing instance-owned task tracker to keep historical cleanup outside the activation deadline while preserving age cutoffs and stop settlement.

Do we have a high-confidence way to reproduce the issue?

Current main awaits cleanup inside the real replacement hook's five-second deadline; supplied historical Gateway traces demonstrate the resulting timeout, and the body reports a failing current-base boundary regression.

Is this the best way to solve the issue?

The change directly removes maintenance from the activation deadline without adding an owner, timeout, retry, or compatibility path; its normal-boot ordering tradeoff needs owner acceptance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 44d880a42258.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced patch: The production change removes the hook's await and retains the existing task tracker, error reporting, cleanup implementation, and service-stop join. (extensions/memory-core/src/dreaming.ts:568, 57319cb14bba)
  • Current main still awaits cleanup: Fetched main retains awaited startup cleanup; comparison against the merge base shows no changes to the two existing touched files. (extensions/memory-core/src/dreaming.ts:577, 44d880a42258)
  • Replacement deadline: The real replacement owner runs gateway_start with the five-second service-replacement deadline and propagates hook failures. (src/gateway/server-plugin-reload-cleanup.ts:224, 57319cb14bba)
  • Shipped-entry-point evidence: The full PR body supplies redacted Gateway and CLI traces: original base times out, original repaired head reloads successfully, historical sessions are removed, and active and ordinary sessions survive. (6fa06af96d5b)
  • Historical proof applicability: GitHub verifies that the runtime-tested original head introduced the same await-to-void change through trackDreamingTask; the rebuild follows main's intentional removal of redundant plugin-local generation bookkeeping. The historical head is unavailable locally, so its patch was read through GitHub. (extensions/memory-core/src/dreaming.ts, 6fa06af96d5b)
  • Current lifecycle contracts: The added tests use real registration and hook execution to protect early hook completion, stop settlement, late cleanup errors, and retirement before another agent is cleaned. (extensions/memory-core/src/dreaming-startup-lifecycle.test.ts:80, 57319cb14bba)

Likely related people:

  • Peter Steinberger: Raw commit 226b033 adds extensions/memory-core/src/dreaming.ts:446 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 226b033a4fff; files: extensions/memory-core/src/dreaming.ts)
  • Robin Winkelewski: Raw commit 1aa3d84 adds extensions/memory-core/src/dreaming.ts:936 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1aa3d8462bfc; files: extensions/memory-core/src/dreaming.ts)

PR surface

Source +2, Tests +187. Total +189 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 2 187 0 +187
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 191 2 +189

Review metrics

Metric Value Why it matters
Production versus test LOC Production +4/-2; tests +187/-0 The small production change reuses existing ownership; added tests protect distinct deadline, settlement, error, and retirement contracts.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Slow historical cleanup causes a concrete memory-core reload failure; broader model or reply unavailability is not established by this PR.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-12T14:23:28.345Z sha 6fa06af96d5b29c2a187d7419587f557b1fda8b5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-12T16:20:15.953Z sha 6fa06af96d5b29c2a187d7419587f557b1fda8b5 :: blocked before merge. :: none
  • reviewed 2026-10-13T20:44:50.948Z sha 57319cb :: blocked before merge. :: none

Reviewed October 13, 2026, 6:20 PM ET / 22:20 UTC (Revision 4).

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@Stronggenetics
Stronggenetics force-pushed the fix/memory-startup-cleanup branch from 6fa06af to 57319cb Compare October 13, 2026 20:37
@RomneyDa
RomneyDa enabled auto-merge (squash) October 20, 2026 03:38
@RomneyDa
RomneyDa merged commit 88dbe36 into openclaw:main Oct 20, 2026
103 checks passed
RomneyDa added a commit that referenced this pull request Oct 20, 2026
#169945)

Run historical dreaming cleanup in the instance-owned background context so plugin replacement is not bound by the five-second start-hook deadline. Preserve the release line generation fence and join cleanup at service stop.

(cherry picked from commit 57319cb)

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 20, 2026
#169945)

Co-authored-by: Stronggenetics <[email protected]>
(cherry picked from commit 88dbe36)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
RomneyDa added a commit that referenced this pull request Oct 20, 2026
* test(discord): classify native registry cases as test support

Keep the backported native routing cases out of production dependency and database-worker inventories while retaining their focused coverage.

Co-authored-by: RomneyDa <[email protected]>

* chore(agents): shrink settings assertion baseline

Co-authored-by: RomneyDa <[email protected]>

* fix(agents): keep the poll vote echo matcher private (#168333)

#167979 moved the matcher's only production caller into suppressPollVoteEcho,
leaving isPollVoteEchoText exported solely for its unit test. The Knip
production unused-export scan rejects that export, so pnpm check:changed fails
on main for local and Testbox runs (GitHub Actions only reports it as advisory).

Make the matcher module-private and drive the unchanged matcher table through
the module's real public pair, recordPollVote -> suppressPollVoteEcho. No
production behavior change.

Co-authored-by: RomneyDa <[email protected]>

* test(cron): await archive RPC after cancellation

The PR-automation archive fixture treated the cron finished event as a
session-patch response receipt. Archiving cancels the occurrence from the
committed cron update while the archive RPC is still finishing, so the
response assertion raced that handler.

Capture and join the actual archive request before inspecting its response.
Hold the real cron update after commit to reproduce this ordering without
timers, while preserving every existing session identity, cancellation,
disabled-job and teardown assertion. Keep worker run rows and launch checks
unchanged.

The forced pre-fix control reproduced the hourly's zero-response failure
(1 failed, 2 passed). The fixed file passed all 3 cases: 100.79s Vitest,
105.94s wrapper with --maxWorkers=1; most elapsed time was compilation/import.
Cron test types, type-aware lint, boundary lint and formatting passed.
P2 autoreview is scoped-clean. Full cron-config proof passed: 1,961 tests
in 251 files, 1090.77s, one worker.

Focused command: pnpm test src/cron/service.pr-automation.test.ts --maxWorkers=1
Full config: node scripts/run-vitest.mjs run --config
test/vitest/vitest.cron.config.ts --maxWorkers=1

Refs: main CI run 38881317413, job 116908788842.
Co-authored-by: RomneyDa <[email protected]>

* fix(update): settle state writers before Doctor schema repair (#177844)

* fix(update): consume SQLite migration source once

* fix(update): retain captured source through Doctor preparation

* fix(update): settle state writers before Doctor schema repair

Drain prior canonical handles before private schema repair so their native-close receipts publish legitimate maintenance writes and release exclusive custody. Keep all migration attribution and strict source checks; remove the source-consumption workaround that lost later Doctor writes.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): close required-backport compatibility gaps

Restore test-only transcript access, classify the extracted update helper as test support, retain the full PR-wrapper runtime closure, align native-bootstrap journal expectations, and point non-isolated fixtures at the extracted state owner.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve JSON output when gateway commands exit (#176795)

Co-authored-by: RomneyDa <[email protected]>

* test(cli): preserve exit semantics in gateway harness

Construct the mocked runtime exit with the production ExitError so JSON completion remains distinguishable from ordinary command failures.

Co-authored-by: RomneyDa <[email protected]>

* test(agents): distinguish hidden recovery prompts from user turns

prompts as hidden internal_system user rows to preserve model-prefix
bytes. The finalization and cron fallback tests still counted those rows
as new user turns.

Require the expected hidden rows and their provenance, retain the single
visible original turn, and verify finalization does not hide the next real
user message. Keep receipt, attempt-count, provider-request, fallback-notice
and final-answer assertions intact. No production behavior changes.

Proof: both hourly failures reproduced on current main; all eight focused
cases pass with --maxWorkers=1, including runtime retry/cold-reopen coverage.
Agents and cron test typechecks, typed lint, boundary lint, formatting and
P2 autoreview pass.

Co-authored-by: RomneyDa <[email protected]>

* test(memory): join background dreaming cleanup at stop

Align the startup-admission proof with #169945: the gateway hook no longer blocks on historical cleanup, while service stop remains the deterministic settlement boundary.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): use typed exits for gateway JSON commands

Backport the narrow runtime exit contract required by #176795 without importing the full #168587 refactor, and keep the gateway harness mock non-throwing outside the explicit typed-exit proof.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): restore initialization selector revalidation

Restore the selector fence omitted by the partial #168882 compatibility backport while keeping the core file within the release line count ratchet.

Co-authored-by: RomneyDa <[email protected]>

* test(agents): align recovery prompts with release behavior

Match the current finalization prompt text while retaining the release-line provider fallback contract of one visible cron user turn.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): finalization ignores TMPDIR for disposable copies

Keep update inspection images and source captures on the candidate helper temporary volume without relocating native admissions or recovery backups.

Co-authored-by: RomneyDa <[email protected]>

* fix: native app messages fail after reconnecting

Co-authored-by: RomneyDa <[email protected]>

* test: prove native reconnect dispatch and stale-session policy

Co-authored-by: RomneyDa <[email protected]>

* fix(codex): previews block replies after context refresh

Co-authored-by: RomneyDa <[email protected]>

* fix(codex): preserve persistent policy checks during context refresh

Co-authored-by: RomneyDa <[email protected]>

* test(codex): narrow active binding before checking successor

Co-authored-by: RomneyDa <[email protected]>

* fix(ui): offer desktop setup instead of Retry when Host Desktop is off

- The chat Desktop panel asks environments.list for desktopSetup only when
  its unresolved automatic target is the Gateway host.
- The panel says desktop access is not enabled on the Gateway host and that
  it shares the Gateway host's screen, shows setup steps worded for the
  Gateway host plus account and network notes, and offers Enable desktop
  access when the connection can patch config (else the administrator
  hint) or Check again, then re-reads inventory and connects the Gateway
  desktop.
- Systems and the panel share the setup state selection and the
  desktop.host.enabled patch helper; other targets, document mode and a
  failed setup check keep desktop.sourceUnavailable.
- The setup helper declares its own runtime-config shape and imports
  nothing from desktop-panel-inputs.ts, so the type import runs one way.
- Docs mention the chat panel path.

Co-authored-by: RomneyDa <[email protected]>

* test(ui): adapt Host Desktop setup proof to Lit

Use the release-line i18n registry, shadow-root assertions, and Lit settlement instead of the upstream Solid-only test helpers.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): repair merged validation fixtures

Co-authored-by: RomneyDa <[email protected]>

* refactor(release): close candidate source ratchets

Co-authored-by: RomneyDa <[email protected]>

* test(update): restore safe managed handoff fixtures

Complete the #168722 fixture integration omitted by the release backport.

Co-authored-by: RomneyDa <[email protected]>

* test(release): drop incompatible question cleanup

The release snapshot does not retain the mainline sharing-read owner introduced after this branch point.

Co-authored-by: RomneyDa <[email protected]>

* test(codex): adapt recovery fixture to release helper

Co-authored-by: RomneyDa <[email protected]>

* refactor(cli): simplify update and offline repair bookkeeping

Use the rehearsed configuration during update activation instead of looping
through candidate checks after late config edits. Rely on the sequential node
auto-update caller and Doctor's exclusive maintenance ownership for internal
pause and title bookkeeping. Preserve validation, schema, authorization,
service-publication, privacy and work-settlement boundaries.

Best-effort tradeoffs accepted:
- Late root/include edits no longer restart rehearsal (b36eb3e's injected
  save cases); incompatible edits can require correction or Doctor/restart.
- Unsupported overlapping pause/resume calls do not retain distinct tokens
  (#149517); the production auto-update loop awaits each pause before resume.
- Concurrent foreground title changes during offline Doctor are unsupported
  (#151211); existing names/incognito sessions and live commit authority stay.

Remove 76 net production lines and 292 test lines. Focused proof covers 177
supported node/update/Doctor cases; core types, both zero-cycle checks, typed
lint, formatting and independent P2 review pass. The lint-suppression test has
an inherited allowlist mismatch already fixed on main in dab6a8d. Full
changed-check and release-matrix proof are not claimed for this branch-only
below-500 simplification.

Co-authored-by: RomneyDa <[email protected]>

* refactor(cli): simplify update and worker lifecycle guards

Carry admitted snapshots through updates and retain live authority at effects. Remove speculative observation, generation, and bookkeeping machinery while preserving rollback, native settlement, bounded resources, and public interfaces.

Co-authored-by: RomneyDa <[email protected]>

* test(cli): align Windows probes with single service inspection

Co-authored-by: RomneyDa <[email protected]>

* test(cli): retire remaining synthetic completion checks

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve shutdown and update fixture contracts

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve full config read failures

Co-authored-by: RomneyDa <[email protected]>

* test: retire obsolete command revalidation scenarios

Co-authored-by: RomneyDa <[email protected]>

* test: revoke publication authority after confirmed service stop

Co-authored-by: RomneyDa <[email protected]>

* test(cli): align progress fixtures with simplified ownership

Co-authored-by: RomneyDa <[email protected]>

* fix(plugins): retain Windows dependency links across Doctor phases

Co-authored-by: RomneyDa <[email protected]>

* fix(update): guide Windows task disable permission failures

Refs #170956 (finding 3). Preserve the autostart disable guard while reporting definite access denials with elevation and manual-update guidance, without attempting an unnecessary enable.

Co-authored-by: RomneyDa <[email protected]>

* fix(doctor): suggest retry after snapshot contention

Co-authored-by: RomneyDa <[email protected]>

* fix: Windows backup scratch cleanup fails with EPERM

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(update): recognize Dutch Scheduled Task access denial

Co-authored-by: RomneyDa <[email protected]>

* fix(release): retain native lifecycle dependencies

Adapt required PR #168882 to the 2026.10.6 architecture without importing unrelated mainline dependency trees.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): preserve initialization revalidation

Retain the later release-specific selector fence while adapting required PR #168882.

Co-authored-by: RomneyDa <[email protected]>

* test(release): adapt Doctor contention fixture

Exercise the required #176779 guidance through the 2026.10.6 database admission interface.

Co-authored-by: RomneyDa <[email protected]>

* test(release): shrink mock export baseline

Remove the obsolete plugin lifecycle config mock exception eliminated by required PR #168882.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): adapt lifecycle refactor interfaces

Preserve required PR #168882 while retaining the 2026.10.6 progress, child-binding, and Doctor convergence contracts.

Co-authored-by: RomneyDa <[email protected]>

* test(release): adapt simplified update lifecycle

Keep the required #168882 validation coverage while retaining the 2026.10.6 sidecar catalog and update-run fixture contracts.

Co-authored-by: RomneyDa <[email protected]>

* test(release): drop unsupported settle-window fixture

Remove the #178170 test-only import that depends on #172069 settlement timing, which is not part of the 2026.10.6 release architecture.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): close expanded candidate lint

Remove stale and redundant constructs while restoring the two pre-existing max-lines suppressions accidentally dropped by the earlier repair commit.

Co-authored-by: RomneyDa <[email protected]>

* refactor(release): split oversized candidate files

Split the BTW runtime helpers and Doctor memory-auth scenarios so the required backports satisfy the source-size ratchet without adding suppressions. Consolidate the duplicated Docker activation marker spelling to close inherited environment-inventory drift.

Co-authored-by: RomneyDa <[email protected]>

* test(release): document split isolation boundaries

Document the intentionally closed Doctor mocks and runtime transcript assertions introduced by the validation-safe file split, and prune the repaired assertion baseline entry.

Co-authored-by: RomneyDa <[email protected]>

* style(release): format validation runner changes

Apply the repository formatter to the backported test runner and workflow guard updates.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve typed exits after output drain

Catch the default runtime's typed ExitError inside the legacy output-drain callback and retain its process status. This keeps the V8-safe typed exit contract while preventing successful help renders from surfacing as uncaught failures.

Co-authored-by: RomneyDa <[email protected]>

* perf(ui): defer page-only English copy from startup

Adapt upstream PR #178054 to the release branch after the TypeScript page migration.

Co-authored-by: RomneyDa <[email protected]>

* chore(ui): refresh Host Desktop locales

Adapt upstream locale refresh PR #178236 to the 20-locale release catalog.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: RomneyDa <[email protected]>

* fix(ui): register lazy secret copy at view boundary

Keep direct page rendering self-contained and retain the current plugin catalog anchor type.

Co-authored-by: RomneyDa <[email protected]>

* docs(changelog): refresh 2026.10.6 contribution record

Co-authored-by: RomneyDa <[email protected]>

* fix(windows): recognize task permission denials in every locale (#178624)

(cherry picked from commit 00cb4b3)

Co-authored-by: RomneyDa <[email protected]>

* docs(changelog): record Windows locale recovery backport

Co-authored-by: RomneyDa <[email protected]>

* fix(apple): Shared OpenClawKit Periphery fails on every OpenClawKit PR (#168171)

The reconnect-backoff hooks added in #168024 lived in OpenClawKit
Sources but were called only from OpenClawKitTests. The shared
Periphery workflow scans the iOS and macOS consumer indexes, and
neither builds OpenClawKitTests, so both reported
_test_setReconnectBackoffMs(_:) and _test_reconnectBackoffMs() as
unused and the intersection failed on every PR touching the kit.

Move the setter into the test file's existing @testable fileprivate
GatewayChannelActor extension, beside seedPathRecoveryConnectBackoff,
and read the internal backoffMs directly. The remaining _test_ hooks
stay because the macOS OpenClawIPCTests call them.

Proof: swift test --filter GatewayNetworkPath (10 tests in 2 suites,
including the reset-both-backoffs case) passes; SwiftFormat clean.

(cherry picked from commit 46d5488)

* chore(ui): move Host Desktop locale refresh out of source PR

This reverts commit f777409.
CI preflight requires generated Control UI locale artifacts to land
isolated from source changes; the refresh lands on the release branch
as its own generated-only commit after this PR merges.

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Jacqueline Henriksen <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: n572770 <[email protected]>
Co-authored-by: xuzhijun <[email protected]>
Co-authored-by: openclaw-mantis[bot] <281431406+openclaw-mantis[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants