refactor: add session patch projection seam#93739
Merged
jalehman merged 1 commit intoJun 17, 2026
Merged
Conversation
jalehman
force-pushed
the
clawdbot-d02.1.9.1.16/31b-session-patch-projection-seam
branch
from
June 17, 2026 13:50
db9fd2c to
b428461
Compare
jalehman
force-pushed
the
clawdbot-d02.1.9.1.16/31b-session-patch-projection-seam
branch
from
June 17, 2026 13:55
b428461 to
8b78f55
Compare
jalehman
marked this pull request as ready for review
June 17, 2026 14:07
This was referenced Jun 17, 2026
crh-code
pushed a commit
to crh-code/openclaw
that referenced
this pull request
Jun 18, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a storage-neutral session patch projection seam for Path 3 so Gateway
sessions.patchand embedded TUIpatchSessionno longer wrapapplySessionsPatchToStore(...)in a mutable whole-storeupdateSessionStore(...)callback.Why
The SQLite session-store follow-up needs a transaction-sized operation that applies key migration/pruning and the projected entry update together without exposing a mutable whole-store callback to Gateway/TUI callers.
Changes
Testing
PNPM_CONFIG_MODULES_DIR=<hydrated-node_modules> node scripts/run-vitest.mjs src/config/sessions/session-accessor.test.ts src/gateway/sessions-patch.test.ts src/tui/embedded-backend.test.ts test/scripts/check-session-accessor-boundary.test.tsnode scripts/check-session-accessor-boundary.mjsnode scripts/run-oxlint.mjs src/config/sessions/store.ts src/config/sessions/session-accessor.ts src/config/sessions/session-accessor.test.ts src/gateway/sessions-patch.ts src/gateway/server-methods/sessions.ts src/tui/embedded-backend.ts src/tui/embedded-backend.test.ts scripts/check-session-accessor-boundary.mjs test/scripts/check-session-accessor-boundary.test.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfonode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo<hydrated-node_modules>/.bin/oxfmt --check --threads=1 src/config/sessions/store.ts src/config/sessions/session-accessor.ts src/config/sessions/session-accessor.test.ts src/gateway/sessions-patch.ts src/gateway/server-methods/sessions.ts src/tui/embedded-backend.ts src/tui/embedded-backend.test.ts scripts/check-session-accessor-boundary.mjs test/scripts/check-session-accessor-boundary.test.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/mainpnpm buildReal behavior proof
Behavior addressed: Gateway
sessions.patchstill applies and persists session metadata through the new patch projection seam after the Path 3 rebase.Real environment tested: Local live Gateway LaunchAgent from this checkout at SHA
8b78f55f8de6b86e6b869ab37e36e1b0adba56cb, baseec3f76b3806aa9731854fd8b1249f458c2df6f6b, OpenClaw2026.6.8 (8b78f55), Nodev24.15.0.Exact steps or command run after this patch:
Evidence after fix:
/healthzreturned{"ok":true,"status":"live"}and/readyzreturned{"ready":true,"failing":[]...}.gateway status --jsonreported RPCok: true, server version2026.6.8, andadmin_capableoperator auth.sessions.patchreturnedok: true, keyagent:main:subagent:path3-proof-93739, labelPath 3 proof 93739,sendPolicy: "deny",verboseLevel: "off", and resolved model metadata.sessions.describereturned the same label, display name, send policy, verbose level, model, and runtime. Direct persisted session-store inspection returned{"exists":true,"label":"Path 3 proof 93739","sendPolicy":"deny","verboseLevel":"off","sessionId":true}. Cleanup viasessions.deletereturneddeleted: true, and the final store check returned{"existsAfterCleanup":false}.Observed result after fix: The live Gateway accepted a real
sessions.patchRPC, persisted the projected metadata, served it back throughsessions.describe, and removed the proof-only session entry throughsessions.delete.What was not tested: The future SQLite backend implementation, doctor migration from file-backed stores to SQLite, SDK compatibility beyond the focused test set, and unrelated session lifecycle mutations outside this patch-projection slice.
SQLite Follow-up
Implement the SQLite backend for
applySessionPatchProjection(...)as one transaction that resolves the target key/candidates, applies legacy migration/pruning semantics, validates/projects the patch, and writes the projected entry metadata atomically.Refs #88838.