Skip to content

refactor(sessions): activate memory-only incognito ownership - #170712

Merged
steipete merged 193 commits into
mainfrom
dbasync/phasee4-cutover
Oct 13, 2026
Merged

steipete merged 193 commits into
mainfrom
dbasync/phasee4-cutover

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the atomic ownership cutover in #169363 after the independent fixture repairs in #170667 (merged as c6546e217ed5aff7fe3b8e553075b84e4111878b). Completes Phase E after #169124, #169227, and #169327.

What Problem This Solves

Incognito sessions still used a separate SQLite owner on the Gateway thread. This activates the session actor’s memory backend for all incognito flows and removes the native and inactive pinned-worker alternatives in the same change. Durable sessions retain the SQLite-worker backend. Acquisition selects one backend once; there is never a second writer for a native session.

Creation, turns/continuations, SessionManager/SDK, history/search, collaboration, Boards, usage, reset/delete and close now consume actor operations and committed facts. Memory state survives handle release, disappears on owner/session close or process exit, and keeps the existing nonrenewing 24-hour expiry. Reads of absent state never create it or fall back to SQLite. Source and built SDK modules share the process owner registry. Deprecated synchronous SDK persistence/history calls reject incognito targets and identify their awaited replacements; durable compatibility remains within its existing window.

The native owner, SQL kernels, pinned-worker adapter, generations, bindings, reverse RPCs, repeated bookkeeping checks and obsolete tests are deleted. While activation was in flight, #169621 removed the inactive prerequisite and #169811 restored it on main. This PR activates that backend while preserving main’s subsequent async readers, immutable snapshots and receipt changes. Schemas, retention and large-payload SQL projections are unchanged.

Boundaries and accepted edges

The memory backend opens no SQLite database and consumes no database-worker slot. Creation retains one worker batch checking for a real durable row, so an incognito key cannot hide user data. Global ACP, Talk, audit, placement and publication metadata retain their existing owners. Content-free audit identifiers and global placement identifiers are retained as documented; incognito entry/transcript content is not persisted.

GitHub publication reads small session/member facts from the actor and shared facts from the existing state worker. One memory admission runs before the destination transaction because its requester policy callback may write state. Shared facts are validated within that transaction; durable source fencing and live checks before external publication remain unchanged.

Removed checks and accepted edges:

  • Native generations, admission/read claims, repeated target capture and suggestion generation comparisons: accepted work uses its captured target; later caller mutation does not retarget it.
  • Per-frame currency reads and post-read revision handshakes: a read may finish with its committed snapshot while later actor commands proceed. Low-level transcript deletion does not itself revoke an already admitted run; actual effect authority remains current.
  • Whole-roster recapture and repeated placement-evidence reads: new owners and later placement changes appear on the next listing/sweep; captured facts do not authorize effects.
  • Post-write sharing rereads: receipts are authoritative; later writes publish their own receipts.
  • Progress-card config recapture: accepted work finishes against its captured store; later operations use the new configuration.
  • FTS revision/index checks and projection rebuild admission: memory search reads committed events; uncommon Unicode tokenization or equally ranked snippets may differ from SQLite.
  • Usage refresh-lock handshakes: overlapping memory refreshes may reuse the next request. A bookkeeping ACP failure event may follow a direct durable metadata rewrite; backend/tool effects still require live authority.
  • Unbound incognito identity recapture: a logical lookup may follow a recreated namespace at the same key when session ID and lifecycle still match; retained actor handles remain closed. Policy lookups use the current policy at that key.
  • Transport revocation generations: close plus existing transport teardown is sufficient; already handed-off transport work may finish during close.
  • Per-checkpoint borrowed-worker file identity rereads: the borrower trusts its admitted live owner; reopen/repair checks remain.
  • Absent creation-witness rejection after an earlier lazy owner capture: a lazy capture alone does not reserve or refuse creation; a later creator may use the already observed path identity when that owner has no creation witness. Existing file-identity and effect checks remain.
  • Repeated cleanup authority forwarding through synchronous memory reads: the caller is checked once by the cleanup guard; selected actor and owner-close authority remain, and later effects check their own authority.
  • Memory publication source fencing: close after preparation admission may leave an internal request/receipt; external publication still checks live authority.

Credentials, approvals, tool/command execution, destructive transcript effects, external sends and cross-user disclosure retain their real authority checks.

Evidence

Measurement

One live shared-harness pair under the revised proof rules: baseline b9119c5435bcd54cfd6e37e38b0dcd70cfc29c7a, candidate f0b7763478e3bf3189727ee95528e4c1523f3a31. Ranges are across ten warmed turns within each run, not independent repeated pairs. Later integration/fixture/publication fixes are separate source and CI evidence; this is not relabeled as final-head runtime proof.

Metric Baseline Candidate
Warmed all-thread statements, median [min–max] 354.5 [302–549] 375 [340–483]
Warmed database requests, median [min–max] 108 [95–148] 103.5 [94–124]
Warmed MAIN statements, median [min–max] 0 [0–2] 0 [0–2]
First-turn statements / requests / MAIN 798 / 164 / 38 1,169 / 205 / 48
Whole-workload statements / requests 10,119 / 2,119 10,215 / 1,994

Per-operation attribution over warmed turns (statements / requests):

Actor operation Baseline Candidate
Accept input 153 / 21 150 / 20
Adopt run 42 / 10 40 / 10
Append transcript event 260 / 20 260 / 20
Complete turn 60 / 10 60 / 10
Delivery settled 63 / 20 60 / 20
Read 31 / 31 37 / 37

These operations add no SQL forms. Actor reads rise because unchanged background index writes invalidate cached snapshots between turns: three normal reads per turn remain identical; extra hydration occurs at precisely the boundaries with intervening unscoped index writes (one baseline turn, seven candidate turns). Publisher, write-receipt and SQLite executor code are unchanged between measured heads.

Background memory indexing/cache publication adds 170 warmed statements. First-turn actor commands and request counts are unchanged; deferred schema admission (+128), memory reindex/FTS publication (+56), and write preparation (+62) explain most of its increase. Candidate warmed duration was 9.34 s versus 5.26 s. The raw increase is scheduling/background variance under the attribution rule, not a timing-controlled speed benchmark. Both runs completed all thirteen turns, cron, compaction and shutdown; both returned the same non-warmed mentions.dismiss UNAVAILABLE result.

Shared read-family audit under the tightened attribution rule follows. Counts are successful native SQL; families overlap and must not be summed. Requests count distinct requests executing the family. Mean, median and ranges are across the same ten warmed turns.

Family Base SQL/turn mean; median [range] Candidate SQL/turn mean; median [range] Base → candidate requests/turn
Exact-entry facts 10.9; 10.5 [10–12] 11.9; 11.5 [11–14] 10.9 → 11.9
Actor hydration 5.7; 5.5 [5–7] 5.7; 6 [5–6] 5.7 → 5.7
Entry-cache snapshot loads 2; 2 [0–4] 3.4; 4 [2–6] 1 → 1.7
Row facts 27.5; 30 [20–30] 25; 25 [20–30] 5.5 → 5
Watermark reads 14.5; 15 [13–15] 7; 7 [6–8] 13.5 → 7

Exact-entry statements increase 109 → 119. The complete partition is corpus writable admission 9 → 15 (+6), pre-input reads following background index writes 1 → 6 (+5), and remaining exact-entry reads 99 → 98 (−1). Each corpus-admission read pairs one-to-one with the next corpus request within one second, sharing the empty-session-key argument fingerprint. Source readSessionTranscriptCorpusInWorker deliberately performs this read before corpus discovery; its durable branch is unchanged. The additional pre-input reads all follow cache.write.inline / source.replace.inline commits after the preceding final delivery, the same windows recorded in the actor-read trace analysis. Normal runtime reads during the turn remain 10 → 10. Background index commits and actor reads use the same writer connection in each run; the unchanged write-receipt implementation advances the unscoped revision included in session replica tokens.

Actor hydration remains 57 → 57 SQL: actor.read 31 → 37 is offset by acceptInput/adoptRun/deliverySettled hydration 6 → 0; appendTranscriptEvent stays 20 → 20. The six extra actor.read requests are already attributed in the actor-read trace analysis to background index writes invalidating the existing replica before the next input.

Snapshot statements increase 20 → 34: corpus inventory scans 9 → 15 each execute exactly two snapshot SELECTs (18 → 30); periodic session-registry-maintenance scans 1 → 2 each execute the same two SELECTs (2 → 4). Source blob identities prove that the memory sync scheduler, cache loader, ordered/retained read helper, and registry-maintenance scheduler are unchanged. Candidate sends preserve the maintenance caller stack; baseline redispatch lost its original caller.

Row-facts work falls 55 → 50 requests and 275 → 250 SQL. Watermark reads fall 145 → 70: patch.commit 70 → 10, lifecycle.project 10 → 0, row-facts 55 → 50, transcript-anchors 10 → 10.

Attribution limit: traces expose SQL stacks, request keys, timestamps and argument fingerprints, but not an explicit replica-invalidation reason. The pre-input link combines unchanged source with preceding index commits on the same writer connection; it is not a directly logged invalidation reason. Every net increase is accounted for; raw family counts are not presented as flat.

The isolated public CLI incognito lifecycle passed on measured candidate f0b7763: two creations, two provider-backed turns, both history reads, reset and deletion. Three persistence scans found no incognito entry/transcript content or backing file; the backend opened zero SQLite connections and issued zero SQLite statements or worker requests. Only exact documented audit/placement identity fields were retained. The initial overly broad scanner was corrected against those field contracts, not by excluding whole tables. The native baseline accepted creation/send but timed out before the provider; its 351 create and 396 partial-send native statements are incomplete-flow evidence, not a comparable full-lifecycle saving.

The measured delete path still executed 297 global placement authority reads and two secret-store reads on MAIN. These belong to existing global owners, so the whole lifecycle is not SQL-free. Inspection found duplicate forwarding of the same cleanup callback through synchronous memory reads; the final source removes that forwarding while preserving one explicit cleanup authority check and memory-owner closure checks. No unmeasured post-fix count is claimed.

Split, review, and size

The independent fixture repairs landed in #170667 (c6546e217ed5aff7fe3b8e553075b84e4111878b) after CI 38350649661 passed. Remaining acquisition, transcript reads/writes, execution, and close must transfer together: deleting native ownership first breaks callers; activating memory while native remains an active writer violates single ownership.

Two Codex review rounds completed. Missing pre-creation manager visibility and the live-source check before destructive compaction were fixed with negative controls. The null-lifecycle concern was declined because null means an absent lifecycle; session identity, non-null lifecycle and writer checks remain. Later CI and conflict repairs were source-reviewed, not represented as part of those automated rounds. P2 follow-ups after the two-round limit concern surfacing a listener/projection publication failure after memory state has already committed, without retrying the write: ACP, reactions, message-tool outcomes, outbox, trajectory, heartbeat, conversation delivery, progress cards, usage rollups, and Boards. These remain explicit follow-ups under the review-round limit; the committed state and effect authority checks remain intact.

Completed CI evidence head c0fb66ec68e7623b2cffb8c1c96b3ddb313ad281 integrates main 3e5eff31690aefaaa95d9cb2d688db5ff2c025aa: 890 files, +30,561 / −63,910 lines (net −33,349). No native-incognito path is restored. Changed-file oxfmt, focused syntax oxlint, and whitespace checks pass for the 25 resolved files and two related membership-guard updates. Required proof below is labeled by the head that actually executed it.

Completed CI and static evidence

CI 38431370576 completed on c0fb66ec68e7623b2cffb8c1c96b3ddb313ad281: 123 passed, 22 skipped, and three failed jobs. All selected static jobs passed. The only test failures are the native workspace-discovery case in job115417211113 and two OpenAI realtime credential-custody cases in job115417203911; both have exact main/baseline receipts below. The third red is their aggregate openclaw/ci-gate. Its job-name classifier reports unknown because current main uses different shard names; the test-level evidence resolves that classification. Knip and the SDK comparison were not selected by this CI plan and remain separate proof. GitHub became conflicting while this run completed; the final conflict-only integration will preserve this evidence under the explicit prior-CI landing exception.

The predecessor CI 38380461797, head b6b29690b9d047d4c9ec2032217fdd22ae35b43b, completed all191 jobs. Production types, lint, architecture/boundary/source guards, build artifacts, all seven UI E2E jobs, and T1/dialect ratchets passed. Its remaining failures are individually accounted for below; it is not labeled clean evidence for a later head.

Required evidence Executed result
Incognito-reachable T1 29 → 0:18 deleted, ten worker-only, one durable-only reader bypassed by memory
Global T1 / compatibility Current CI job115417199568: 424 → 396 / 9 → 9
Dialect ratchet Current CI job115417199568: mechanical 1 → 1, design 7 → 7, engine-maintenance 9 → 5
Madge CI 38431370576/job 115417199579: zero import cycles on evidence head c0fb66ec; the job explicitly enabled and executed the Madge check
Knip pnpm deadcode:dependencies on 99ecffc8 completes in287.17 s with only exact inherited findings: unlisted @solidjs/web and solid-js in scripts/bundle-a2ui.mts, and unused readPluginMetadataStateRowsInDatabase in src/plugins/installed-plugin-index-row.ts. Same findings in scheduled-main38432046450/job115417046598, head bdb31e995c792c6d99f3a0dbf64ea9d867191173. The production-phase failure short-circuits the all-exports phase in both runs; no all-exports pass is claimed.
SDK API Source comparison 9b041a9e → 99ecffc8 completed with immutable source/dependency fingerprints: no added/removed entrypoints or exports; 237 reachable-type closure changes and two structurally identical property-order signature differences. Baseline render 2005.47 s, candidate 1098.60 s, comparison 0.72 s. Acknowledgment digest 9e5aaac3ed5585693c11d8935bd691860644efb9c011a8311209351345100158. Later main/conflict-only integration reuses this evidence.
Update/package Package Acceptance38374749361,24/24 jobs passed, including published-driver × candidate update, package integrity and npm12 install. Executed package source 2372fb1bd79201c3aa0c1b56ae766fec343cef46; tooling head fada6e0812ce163dfc39d4ca19dacf0acc3a4c1b. Reused for later fixture/conflict-only integrations under the authorized rules; no later-head execution implied
Live Gateway boundary CI 38380461797/job 115241870382 passes gateway-usage-memory-apis.e2e.test.ts,1/1 case,18.048 s; measured isolated CLI lifecycle described above

The standalone inventory regeneration was stopped under host contention; its generated document remains main's snapshot. Source-derived CI ratchets above are the executed evidence. No third review, second SQL pair, or repeated package dispatch is requested.

Failure diagnosis and fixes

Family Verdict and evidence
History Fixed on main by #170668 (7fbd58bc3ad8), compiled-worker registration. Seven requested item-limit, field-limit, bounded native evidence and oversized mirrored-frame cases pass on integrated cc446cc726a53432c71b10577f7118d36acfa4d7, durable and incognito variants;37 skipped, exit0. Vitest 1311.87 s (86% transform), wrapper 1513.87 s including585.341 s worker preparation. Delayed fork teardown recovered without timeout changes or retry. No rerun
Codex auth Main 592b7e4aea9386e05912e6df2d3ba5493e629aaa reproduces missing-email and Token expired errors with the same pinned client and raised diagnostic budgets. Candidate's original timeout stopped before the assertion. Diagnostic fixtures restored
Native session Inherited current discovery failure: candidate 0813ec09 and main fcb89a331a1f59eedde59c4b3a338febdb199cb7 both fail REQUIRED-NATIVE-0-A before inference with Remote workspace skill discovery failed, preceded by pairing-change errors. Case148.633 s/140.185 s; runner355.18 s/297.12 s. Evidence head c0fb66ec repeats this exact pre-inference error in CI job115417211113,25.745 s case/35.29 s runner. Historical receipt cancellation is a different signature; native startup remains with its owner
Telegram / hour shard Slow-album case passes on 0813ec09 after main fixture repair 989e66ac6a354:1 passed/19 skipped, case 12.158 s, wrapper 264.08 s. Historical hour shard ran Telegram after Codex isolated-completion passed, not history. This is repaired-fixture evidence, not attribution of the old timeout
Memory batch export Regression fixed in 3848ef684b3e3: main's new batch helper called removed native classifiers. It now uses actor capture as the single-entry helper does. Focused missing/live/closed memory and durable export:3 passed/7 skipped, Vitest 774.06 s/wall 904.00 s. Fix also resolves the dependent type/declaration/boundary failures
Restart-abort Fixture repaired: manager acquisition now uses transcript.withOwnedTranscriptWrite, matching production attempt authority. Terminal settlement and active/detached ordinary-write rejection assertions remain. Focused1 passed/39 skipped on 2372fb1bd7920, Vitest 327.46 s/wrapper 680.11 s; same-head CI passes all40 cases
Memory project recents Fixture repaired in df90bc7bb5c62: mutation moved from unused repository identity resolution to awaited registry listing after memory capture. Unchanged, unrelated-visibility, and contributing-visibility cases pass on d99d9626259f8:3 passed/5 skipped, Vitest 261.23 s/wall 328.54 s
Completion types Fixture repaired in d99d9626259f8: remove obsolete hasUsage/hasBilling fields after main made billing derive from actual usage. All lost-update, token/cost, final-custody and zero-SQLite assertions remain. All production and test type jobs on evidence head c0fb66ec pass
Refusal E2E Fixture repaired in 67dde3984e17d: main #170820 (b957f1a…) records terminal errors as run notices. Assert each notice's exact safe summary and first run ID separately from successful assistant output; retryable completion still requires zero notices. All four cases pass on evidence head c0fb66ec in CI job115417211113,150.17 s runner
Usage-refresh timers Main 394be69a4d068db353c837c3590a13df0efae329 prepares directory facts before fake timers, excluding the process-owned30 s observer from refresh timer accounting. Included here; no timer assertion failed in completed CI 38431370576. Exact per-case logs were not extracted
Inference timers Main 3fce262259acad2c9e1e063c78706e416a9cf306 isolates discovery from the process-owned directory observer. Included here; no timer assertion failed in completed CI 38431370576. Exact per-case logs were not extracted

Refresh's five cases and inference's concurrency case passed earlier on both baseline 92063ce6c86fadc5aa87f7bac8b7483627ad0db0 and candidate d99d9626259f8fa0b9e2b5fabc2403fbc9c7ebab. These replays do not establish the timer failures' cause or inheritance. The current head includes the upstream fixes and retains bounded callback/type/delay diagnostics if they recur. No production timeout changed.

Other executed focused evidence: orphan recovery4 passed/32 skipped (Vitest 444.90 s/wall 494.02 s); active reclamation observation now follows the actual close join, with all17 cases passing in CI 38373550479/job 115218590523; title-recovery fixture matches main's pre-dispatch background naming, all eight cases passing in job 115218591131; main's reload clock repair passes all four cases in job 115218591292.

Local limitations remain explicit. Title-recovery timed out locally on 2372fb1bd7920 while exact-same-head CI passed all eight cases; this is not presented as a root-cause repair. The question-refresh attempt was stopped during CPU-active collection without a selected case result (exit143/wall 437.56 s); main's clock repair 7a5529f4c9640 is integrated, and CI owns confirmation. No latency claim comes from this loaded host.

Exact inherited-failure receipts

  • Nine OpenAI embedding/realtime credential-custody failures: scheduled main38365765461/job 115191094319.
  • Both Alibaba profile-precedence cases reproduce on baseline 27aef9ac6a0231b9fa494905a79361b30097fe67: identical Auth profile credential writes require an admitted worker, credential-write-custody.ts:72 → sqlite.ts:485 → store.ts:1710 → video-generation-provider.test.ts:160. Two failed/five skipped, Vitest 632.11 s/wrapper 703.07 s; total1331.07 s including600 s slot wait. Test unchanged by cutover.
  • Doctor unoccupied destination/padded references: exact cached baseline a959e70b417b1f933556c102db452b1d08e96a1b reproduces child statusnull at runDoctor:45, caller439 (one failed/two skipped; case 71.173 s/Vitest 263.59 s). Source-SHA guard, matching metadata/build-info and three artifact hashes verified; baseline is an ancestor. Full runtime-byte manifest unavailable; child's stalled phase unknown,60 s timeout inferred because signal/error were omitted. Existing red-main owner continues diagnosis. Phase E's missing-ACP-artifact baseline attempt is excluded.
  • Chat membership: exact chat.send completed before its authorization read was held at lines310/307 matches scheduled main38371740449/job 115210402594; file unchanged by this PR.
  • Earlier Feishu rich-post, auth-state and transcript-corpus fixtures have matching main receipts: Feishu, auth-state, transcript-corpus. These are not blanket attribution for new signatures.

Conflict integration

Final integration head f1151754b82b24b94ce8b665f9c37dce83f82e0d merges main e52278fc9831b85e35a609d404a95880819b0d82 into completed CI evidence head c0fb66ec68e7623b2cffb8c1c96b3ddb313ad281. The delta consists only of main and conflict resolution. Final diff against that main: 891 files, +30,608 / −63,910 lines (net −33,302).

The integrations resolved these files and one related extraction:

  • src/config/sessions/session-accessor.reset.ts: keep main's deferred durable maintenance; memory commits skip the SQLite maintenance kick and retain lifecycle-reset conflict handling.

  • src/config/sessions/session-actor.test.ts: keep memory acquisition and main's native-publication reconciliation cases.

  • src/gateway/server-runtime-subscriptions.ts: preserve main's terminal-outcome import, recovery custody, and detached transcript publication.

  • src/infra/session-cost-usage-worker.ts: preserve main's extracted collection helper and receipt-covered usage cache; remove native-memory host branches.

  • src/infra/session-cost-usage-cache.kernel.ts: preserve write-scope publication around rollup pruning; delete the retired native-incognito partition exception.

  • src/infra/session-cost-usage-refresh-inputs.worker.ts: carry the same native-owner deletion into main's newly extracted helper while preserving bounded receipt-covered stats and rollup reuse.

  • src/agents/main-session-recovery/main-session-restart-dispatch.ts: keep the captured memory reader and main’s session-ID/lifecycle-revision predicate, shared interrupted-run helper, and completion-source assertion.

  • src/gateway/server-methods/sessions-archive.incognito.test.ts: retain memory fixtures with main’s initialTarget snapshot and awaited archive release.

  • test/e2e/qa-lab/runtime/gateway-codex-refusal-product-proof.e2e.test.ts: retain the existing typed notice and run-ID assertions; resolution is byte-identical to the candidate file already passing all four cases in the completed CI evidence.

  • src/agents/sessions/session-manager-write-admission.ts: preserve operation-scoped memory acquisition/release and terminal binding restoration while adopting main’s per-manager FIFO, durable writer labels, and release between actor appends.

  • src/config/sessions/session-transcript-hydration.ts: preserve the early memory reader and durable-only cohort contract; add main’s history.hydration admission label.

  • src/agents/subagents/spawn/subagent-spawn-session-patch.ts, subagent-spawn.incognito.test.ts, and subagent-spawn.memory.test.ts: retain memory acquisition/isolation and the current skill effect guard while adopting main refactor(subagents): reduce spawn and completion database overhead #171137’s captured-parent row reuse; fixtures supply committed memory rows.

  • src/gateway/server-methods/chat-send-handler.ts and its extracted chat-send-input-dispatch.ts: retain memory storage ownership and port main fix(gateway): attribute slow chat admission and persistence waits #171250’s six timing scope/finish lines into the extracted dispatch owner. Related admission/setup/timing-test auto-merges preserve both changes.

Changed-file oxfmt, oxlint and git diff --check pass. The nine-file filtered conflict proof passes on 18f38aec: 24 selected cases, 245 unselected cases skipped, wrapper wall 550.75 s. Knip and SDK results are recorded above. The manager/hydration, spawn, and chat diagnostics resolutions pass on f1151754: fourteen selected cases across six files, fifty unselected cases skipped, no missing filter matches, exit0, wrapper wall251.64 s (worker preparation45.459 s). All source readers and the proof slot are released. The earlier six-case invocation never acquired a CPU slot or read source and was stopped before integration; no completed cases were repeated. Under the explicit operator prior-CI exception, later conflict-only integration reuses the completed, inherited-only run above; this does not label the final head's CI green.

The latest integration retains main's membership authority and publication/release ordering, companion projection reads, actual generated-media delivery evidence, conversation resume observation and clean-close seals with the memory-only path. The membership writer guard removes only the retired native-incognito forwarding exception. The prior session-turn.ts resolution retains main's prepared expectations, optional hot snapshot and transaction preimage alongside memory reads and initial-input phase selection.

Resolved files in the completed CI evidence head
  • docs/reference/database-schemas/worker-access.md
  • src/agents/command/post-run.ts
  • src/agents/main-session-recovery/main-session-restart-recovery-marking.test.ts
  • src/config/sessions/cleanup-service.readonly.test.ts
  • src/config/sessions/conversation-registry.memory.test.ts
  • src/config/sessions/session-accessor.entry-mutation.ts
  • src/config/sessions/session-accessor.sqlite-deletion-receipts.test.ts
  • src/config/sessions/session-actor-memory-collaboration.test.ts
  • src/config/sessions/session-sharing-store.test.ts
  • src/config/sessions/session-sharing-store.ts
  • src/gateway/server-methods/session-metadata.admission.test.ts
  • src/gateway/server-methods/sessions-rewind.storage.test.ts
  • src/gateway/server-methods/sessions-sharing.identities.test.ts
  • src/gateway/server-methods/skills-library.ts
  • src/gateway/session-companion-rpc.test.ts
  • src/gateway/session-companion-rpc.ts
  • src/gateway/session-sharing-policy.ts
  • src/gateway/session-sharing-preparation.test.ts
  • src/gateway/session-sharing-preparation.ts
  • src/gateway/session-sharing-worker-grant.ts
  • src/gateway/session-sharing.memory.test.ts
  • src/gateway/tools-invoke-authorization.test.ts
  • src/gateway/tools-invoke-shared.ts
  • src/state/openclaw-agent-db-close.ts
  • src/state/openclaw-agent-db.ts

# Conflicts:
#	src/config/sessions/session-actor-memory-goals.test.ts
#	src/config/sessions/session-actor-memory-pending.test.ts
#	src/config/sessions/session-actor-scope.ts
#	src/config/sessions/session-pending-input-store.ts
#	src/config/sessions/session-transcript-reconcile.ts
#	src/config/sessions/session-turn.ts
#	src/gateway/session-row-projection-read.ts
# Conflicts:
#	src/gateway/session-row-projection-read.ts
# Conflicts:
#	scripts/pr-lib/wrapper-components.txt
#	src/config/sessions/session-accessor.sqlite-replacement-state.ts
#	src/config/sessions/session-turn.kernel.ts
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 20, 2026
…ump merge

One merge from the step-72 lane tip (8c4f725, upstream d0dbb62) to
upstream main f20c3c7 (BRIEF addendum
2026-10-20 17:25Z). 170 conflicted files (166 content, 3 modify/delete, 1
add/add), resolved in eight parallel slices (agents/subagents, agents other,
auto-reply x2, infra, gateway, config/sessions, rest) plus the lead's
src/state, schema, generated and baseline files. Rules per hunk: keep
continuation behaviour, adopt upstream everywhere else, port upstream changes
into the fork's split-out helpers, honour the Gate 2.7 reviewer ledgers.

Agent schema: upstream went 26 -> 31 (27 outbox sequence, 28 write layout,
29 index retirement, 30 trajectory storage, 31 memory revision; version
constant now in openclaw-schema-versions.ts). Continuation's recipient
authority, the lane's unreleased v27, is v32 on top of 31. The fleet's
schemas 25 and 26 (03de0ce runs agent 26 with the authority table) are
still recognised by shape: they run upstream's 26..31 steps, then the
idempotent authority step. The fleet-26 migration schema is anchored on
upstream's historical 26 plus the authority table, no longer on the authority
version. The lane's unreleased 27 is not recognised (upstream's 27 is the
outbox sequence): such dev databases are refused, not migrated (named in
agent-schema-history.md). Witness accepts 24..32. PostgreSQL: recipient
authority is SQLite-only; v32 is a version-only PG step and the port
descriptor accepts sources 27..31.

Structural ports onto upstream owners:
- shared state worker: upstream retired the eager dispatcher (openclaw#174420);
  continuation custody registers as the `continuationCustody` registry domain
  with typed per-command handlers; schema ensurer moved to
  createSqliteSchemaEnsurer + getOpenClawStateFeatureSchemaSql, run inside the
  write transaction; custody kernels take EngineConnection.
- session controller (openclaw#175837): continuation admission, election and idle
  waits use isSessionRunActiveForKey / resolveActiveSessionRunId /
  waitForSessionRunIdle; the folded provenance note uses
  steerSessionControllerOperation with waitForTranscriptCommit; session lanes
  are gone, so a subagent's continuation turn takes the subagent lane.
- incognito became memory-only (openclaw#170712): the fork's incognito branches in
  owner assignment and sharing follow upstream; recipient-authority capture is
  still refused for incognito sessions.
- openclaw#169714 (prepared runtime config): fork suites publish config per suite as
  upstream's do; announce's continuation owner loader carries the run's config.
- deleted, fully carried by upstream replacements: core-tool-factory-
  descriptors.ts (tool-catalog.ts), status.command-report-data.ts
  (status.command-report.ts), openclaw-state-worker-runtime.ts (registry);
  unused fork leftovers subagent-announce-reply.ts and the nested-matrix
  test-support.
- line-cap extractions of upstream code: openclaw-tools.pdf-tool.ts,
  subagent-registry-kill-confirmation.ts, agent-runner-recovery-read.ts,
  session-event-wake.merge.ts, user-turn-transcript.metadata.ts helpers.

Generated: worker inventory and config baseline regenerated; plugin SDK
surface measured on this tree: 3821 exports / 2212 callable (upstream 3810 /
2208, +11 / +4 continuation). Mock-factory baseline pruned to the exact tree
(9854 -> 8014; no entry outside either parent).

Proof on this tree: tsgo core 0, extensions 0, scripts 0, ui 0. Not yet run
(follow-up commits): test-shard typecheck, pnpm build, lint/line-cap and the
other static gates, Gate 2.7/2.5, tests. Known follow-ups: witness line cap,
system-events test shadowing, the restart-sentinel continuation-delivery
harness and the incognito-actor authority test ports, ledger MANUAL rows
marked ABSORB-8083-LEAD.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 20, 2026
…fecycle suites

- session-recipient-authority.incognito-actor: upstream made incognito
  sessions memory-only actor owned (openclaw#170712) and deleted the old actor
  modules. The suite now creates and writes incognito sessions through the
  memory owner (acquireSessionActorStorage + commitMemory, bound with
  runWithSessionActorStorage) and keeps every invariant: capture through the
  collaboration path is refused with the dedicated-owner message; capture
  while the binding is active is refused (and never creates the native store);
  a native epoch for the key is not current; a narrowing visibility patch
  through the memory writer does not run afterPersistInTransaction and leaves
  authority non-current. Ownership is now decided by the incognito key, so
  the old "native capture before any actor exists" step has no equivalent:
  the suite seeds the epoch row directly and checks a durable control key is
  current while the incognito key is not.
- session-history-budget-owner: `typescript/unstable/ast` became
  `typescript/ast` with the TypeScript update, as upstream imports it.
- session-utils.queued-collector-rollback-custody: openclaw#177787 removed
  killSubagentRunAdmin / control.preparePublication and openclaw#175837
  context.chatAbortControllers; the Stop is now held right after its
  committed kill write (spy on markSubagentRunTerminated), still inside the
  retirement publication the collector waits on. Assertions unchanged; the
  failure case fails the Stop after that write.
- session-delivery-queue.storage-lifecycle: upstream openclaw#174696 removed
  suppressTextDelivery from SessionDeliveryAgentRunUpdate and deleted the same
  two lines from its own copy of this case; this fork split does the same.

Proof on this tree (run-vitest, 3 shards): storage-lifecycle 7/7,
incognito-actor 2/2, history-budget-owner 13/13, rollback-custody 2/2.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 21, 2026
"keeps process-held incognito authority with its native owner" (fork
3f85769) asserted that an incognito session captures recipient
authority through a native in-process owner. Upstream openclaw#170712 (3de654b)
made incognito sessions memory-only and deleted that native owner, and the
fork's collaboration capture now refuses memory-owned sessions. The
replacement rule is pinned by session-recipient-authority.incognito-actor
(ported in f486a29, 2/2). The other decision cases are unchanged (4/4).

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
amittell added a commit to amittell/openclaw that referenced this pull request Oct 28, 2026
…visibility, tests, baselines, fixtures

- cron: beta.4 moved createCronPromptExecutor into run-prompt-executor.ts; the fork's
  fallback attribution (requested tuple, usedFallback) and its "do not pin a fallback
  model to the session" rule move there. run-executor.ts is beta.4's.
- chat-history compaction span (fork): openclaw#170712 deleted the host's
  session-history-subagent-projection; durable spans now prepare their subagent facts
  through the history worker's inline-visibility lookups
  (chat-history-compaction-span-visibility.ts) and fail closed on a missing fact.
- tests beta.4 removed as low-value (openclaw#172040 and siblings) stay removed in
  run-session-state, agent-runner-failure-reply, mattermost monitor-ingress and
  gateway-request-scope; the fork's own cases stay. dispatch-from-config.ingress-retry
  is beta.4's file plus the fork's appended "re-presented inbound" block.
- baselines by merge-base arithmetic: assertion-safety keeps only
  src/infra/diagnostic-events.ts 2 in the four conflicted rows (the fork's SAFETY comments
  clear compaction-safeguard, oauth, persisted and helpers); plugin-sdk surface budgets
  3760+3 and 2195+3 for the fork's three diagnostics-otel redaction exports.
- prompt-snapshot fixtures: beta.4's, to be regenerated by the snapshot tests once the
  tree builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation extensions: codex extensions: memory-core Extension: memory-core gateway Gateway runtime scripts Repository scripts security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant