Skip to content

perf(sessions): move target lookups and callers to workers - #169757

Merged
steipete merged 271 commits into
mainfrom
dbasync/t1cut-s8-targets
Oct 13, 2026
Merged

steipete merged 271 commits into
mainfrom
dbasync/t1cut-s8-targets

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway target discovery and entry preparation could still open SQLite through synchronous lookup APIs during turn preparation, session selection, and later action checks. Durable callers now use the existing session read worker. Bundled callers await the replacement APIs, and mutations receive the selected canonical target instead of rediscovering it.

There is no new configuration or user-facing feature. Deprecated synchronous SDK methods retain their documented compatibility window; bundled callers use their async replacements.

Design and ownership

Prepared facts stay alive through the action they authorize and are updated by the existing writer receipts. File, media, sharing, publication, Talk, and tool effects consume those facts. Real execution, revocation, replacement, and disclosure boundaries retain their current authority check. The actor entry replica does not certify live authority.

The cutover preserves full entry snapshots by default, list-only child discovery, qualified-address selection, configured-store initialization, physical source identity, and SQL-side copies of opaque retained payloads. It removes the superseded synchronous Gateway loader exports, the sharing snapshot cache, ordinary steering/cron bookkeeping rereads, and projection rebuild per-chunk ownership reads. Rebuild publication uses its final conditional UPDATE result.

Both async combined-store merge callers prepare missing-owner lineage facts through the existing async reader, including explicit parents, spawn parents, and implicit thread parents. Captured absence remains absent for that selection; merging cannot reopen a native store. The synchronous durable compatibility loader retains its named native resolver. Incognito rows come from the memory actor and are captured once before lineage preparation, so the same rows are used during final assembly.

T1 accounting

Against integrated main 44d880a42258d0, this PR reduces conservative T1 sites 16→15 (raw primitive sites 19→18). Across the three lane PRs the independently attributable reduction remains 27→21. Main's separately landed Phase E removes three native-incognito sites and makes three search sites worker-only; the combined current tree has 15 conservative T1 sites. These are source-audited counts, not 15 ordinary Gateway-main-thread executions. No ordinary durable host path was found after the combined-lineage repair.

Original lane file Original sites Current raw sites Current T1 Reachability after integration
session-transcript-match.ts 1 0 0 Worker matching or memory actor.
session-transcript-projection-rebuild.ts 12 9 9 Shared worker publication, deprecated synchronous transcript APIs, offline maintenance.
session-transcript-projection-writer.ts 2 2 2 Worker publication; native fallback only under maintenance custody.
session-transcript-read-fence.ts 1 0 0 Published admission facts replace SQL reread.
session-transcript-reconcile-memory.ts 2 0 0 Deleted by Phase E on main.
session-transcript-reconcile-readiness.ts 1 1 1 Worker reads; native maintenance fallback.
session-transcript-retained-data.ts 1 1 1 Worker rewrite or opaque synchronous transcript transaction; large payload stays in SQL.
session-transcript-search.ts 4 3 0 Existing inventory rule classifies all three as worker-only.
targets.ts 2 0 0 Ordinary host callers use async inventory.
transcript-payload.ts 1 0 0 Encoding comes from admitted schema facts.
New targets-discovery.native.ts — 2 2 Worker topology and deprecated synchronous discovery compatibility.
Total 27 18 15 No ordinary durable host path found; mixed kernels are not blanket worker exemptions.

The current PR removes projectionClaimIsOwned, one SQL site used by deletion, append, and finalization. It does not claim Phase E's independent six-site T1 reduction. Remaining mixed native kernels serve deprecated synchronous SDK compatibility or offline Doctor/migration; ordinary durable Gateway consumers use workers. Incognito now uses main's memory actor, with no native fallback.

The retained effect-authority chain is followup-turn-execution → prepareGatewaySessionEntryReadOnlyInWorker → reply-tool-authority, with final uses in host-private capabilities and question access. The actor entry replica does not replace this live authority. Deprecated SessionManager methods warn and name their Async replacements; they will be removed in a later release after the deprecation has shipped in a stable release.

Live measurement (prior-head frozen pair)

Base e78a253059eb07d70ea3f7140e1c4e9b9fadc383 → candidate 7f33ab94d1d553280bc17a7646e3ea25488774c9.

One alternating harness 2.1.0 pair, 10 warmed turns per run. Successful native executions are counted using the shared harness splitter; prepare calls and failed executions are excluded. Turn scopes follow originating trace, not wall-clock windows. Family SQL counts include descendants of the named SQL owner; requests_with_family_sql count unique logical requests containing that family SQL and overlap across families. Operation statements join SQL to logical requestId; rows are disjoint by origin operation. All foreground cache/retry work remains included. No latency claims.

Both runs: exit 0; evidence.ok; 13/13 top-level turns; native child OK; 39/39 RPCs; cron completed; compaction completed; clean shutdown; complete warmed causal coverage. Neither wrapper is partial. Candidate records one failed worker BEGIN IMMEDIATE (database is locked) in shutdown; the harness completes successfully and excludes that failed attempt from successful-statement counts.

Metric Base mean; median [min–max] Candidate mean; median [min–max]
Causal warmed SQL/turn 170.1; 170 [170–171] 170; 170 [170–170]
Causal warmed requests/turn 41.1; 41 [41–42] 41; 41 [41–41]
Causal warmed MAIN/turn 0; 0 [0–0] 0; 0 [0–0]
Legacy window SQL/turn 201.6; 201 [180–225] 197.3; 182 [180–223]
Legacy window requests/turn 50.8; 51 [44–59] 49.4; 44.5 [44–58]
Legacy window MAIN/turn 0; 0 [0–0] 0; 0 [0–0]

Background SQL/min during warmed windows: 659.02 → 773.92. Loaded host; this is an observed maintenance rate, not a latency or per-turn saving.

Whole workload Base Candidate Delta
statements 6645 6482 -163
requests 1203 1167 -36
main 826 825 -1
Shared family Causal warm SQL/turn (B→C) Warm requests containing family SQL/turn (B→C) Whole SQL (B→C)
exact-entry facts 4→4 4→4 79→83
actor hydration 1→1 1→1 22→21
entry-cache snapshots 0→0 0→0 31→26
row facts 0→0 0→0 14→14
watermark reads 1→1 1→1 19→19

Family rows overlap and must not be summed. Entry-cache counts include participant rows called by loadSessionEntrySnapshot. Row-facts SQL includes its transaction and descendant watermark reads. All five causal warmed families are unchanged. Whole exact-entry facts are 79→83: turn-caused 60→61 (the extra one is in second-session), background 19→22. The extra cold foreground read remains counted; it is not classified as timer noise. Whole turn-caused SQL is 2911→2927 (+16), requests 671→671; all-cause workload SQL falls 6645→6482.

The only causal warmed source delta is readAuthProfileRows: 11→10 SQL over ten turns, accounting for the complete −0.1 SQL/turn and −0.1 requests/turn. The lane does not claim this incidental auth-read difference as an optimization saving. Matched lane-owned SQL footprints are unchanged: read-fence 47→47 whole (36 turn-caused), targets 11→11 whole (background), transcript-payload 100→100 whole and 50→50 across warm turns; other listed lane-owned files have no successful SQL execution stack in this workload. Those zeroes are coverage limits, not a claim that the harness proves those flows.

History worker operation Warm SQL (B→C, total 10 turns) Warm requests (B→C) Whole SQL (B→C) Whole requests (B→C)
session-transcript-worker-readers.ts:readActivitySummarySource 0→0 0→0 28→28 5→5
session-transcript-worker-readers.ts:readAnchors 0→0 0→0 23→23 7→7
session-transcript-worker-readers.ts:readConversations 0→0 0→0 1→1 1→1
session-transcript-worker-readers.ts:readCorpusInventory 0→0 0→0 48→33 11→10
session-transcript-worker-readers.ts:readEntries 0→0 0→0 8→4 2→1
session-transcript-worker-readers.ts:readEntryResult 0→0 0→0 3→3 3→3
session-transcript-worker-readers.ts:readExactEntries 40→40 20→20 114→104 48→49
session-transcript-worker-readers.ts:readIdentityEvidence 0→0 0→0 5→6 2→2
session-transcript-worker-readers.ts:readMembershipFacts 0→0 0→0 10→5 2→1
session-transcript-worker-readers.ts:readMessagePresence 0→0 0→0 10→10 2→2
session-transcript-worker-readers.ts:readPendingArchives 0→0 0→0 1→1 1→1
session-transcript-worker-readers.ts:readPendingInputHistory 30→30 10→10 50→50 16→16
session-transcript-worker-readers.ts:readRowBackfill 0→0 0→0 16→16 4→4
session-transcript-worker-readers.ts:readRowFacts 0→0 0→0 22→17 5→4
session-transcript-worker-readers.ts:readRuntimeTarget 0→0 0→0 1→1 1→1
session-transcript-worker-readers.ts:readStats 0→0 0→0 1→1 1→1
session-transcript-worker-readers.ts:readTrajectoryRetention 0→0 0→0 1→1 1→1
session-transcript-worker-readers.ts:readTranscript 110→110 10→10 224→224 23→23
session-transcript-worker-readers.ts:readWatermark 0→0 0→0 2→2 2→2
session-transcript-worker-readers.ts:run 80→80 10→10 151→151 19→19

The JSON retains all source and operation counts, exact warmed arrays, owner-file counts, originating phase totals, and observed host load. No warmer family increase or MAIN increase is hidden as background. Whole/window changes include differing counts of timer-driven memory indexing and registry maintenance.

Cold causal attribution

Phase SQL B→C Requests B→C MAIN B→C
First turn 372→398 (+26) 77→79 (+2) 33→32 (−1)
Second session 838→829 (−9) 183→182 (−1) 0→0

Cold first-turn +26 SQL includes the identical 32-SQL existing first-open admission batch moving from background into first-turn scope. The associated prepare operation stays 3 requests/63 SQL over the whole workload. A target-resource request also moves background→first-turn, with whole9 requests/8SQL unchanged. There is one genuine extra deletion-status read/request from assertAgentIngressOpen during first turn; attribute that cold reload to candidate until proven otherwise. Seven other cold reads are removed in this phase. No warm SQL/request/MAIN family increases. Count changes are retained; this report makes no latency or unconditional landing claim.

The structural first-turn delta is −6 SQL / 0 requests after excluding only the identical once-per-open admission batch and the two whole-count-neutral request moves. The raw result remains +26 SQL / +2 requests; the real deletion-status reload +1 SQL / +1 request stays charged to this lane. This decomposition does not replace the reported causal counts. The T1 MOVE exception applies: whole turn-caused SQL rises 0.55%, requests are unchanged, warmed medians do not rise, and the cold increase is attributed to admission routing. The deletion-status check stays because it guards admission of a real agent turn after deletion.

The 32-SQL batches are equal by normalized SQL/method multiset hash. Base dispatches it through session-entry-read-writable.ts:157; candidate dispatches it through withSessionEntryWorker in session-accessor.sqlite-replacement-worker.ts:252. Candidate admission source wraps the write queue in runWithSqliteDatabaseAdmissionTurn; the changed ordering makes this cold admission count against the foreground turn. It is not an extra whole-workload schema validation.

The extra deletion-status request follows assertAgentIngressOpen → loadAgentDeletionJournalStatus → readAgentDeletionJournalStatusInWorker. The earlier background sessions.create read occurs on both sides; candidate additionally reloads for chat-send admission. This is real foreground work, despite the status-loader sources being unchanged.

First-turn +2 requests are +1 preparation dispatch, +1 target-resource dispatch, +1 deletion-status reload, and −1 readExactEntries request. Only the first two are whole-workload count-neutral moves. Second-session −9 SQL is −2 entry-query, −2 participant reads, −4 cohort transaction statements, and +1 exact-entry facts; it removes one exact-entry worker request.

First-turn SQL source Base Candidate Delta
packages/memory-host-sdk/src/host/memory-schema-recall.ts:readMemoryChunkColumns 0 1 +1
src/config/sessions/session-accessor.sqlite-entry-query.ts:<anonymous> 13 12 -1
src/config/sessions/session-accessor.sqlite-participant-projection.ts:<anonymous> 16 15 -1
src/config/sessions/session-actor-hydration.worker.ts:hydrateSessionActorState 4 3 -1
src/config/sessions/session-entry-cohort.worker.ts:snapshot 4 2 -2
src/config/sessions/session-sharing-store.kernel.ts:listSessionMembersInDatabase 1 0 -1
src/state/agent-deletion-journal.read.ts:readAgentDeletionJournalStatusInDatabase 0 1 +1
src/state/openclaw-agent-db-metadata.ts:readExistingAgentSchemaMeta 1 2 +1
src/state/openclaw-agent-db-schema-helpers.ts:assertOpenClawAgentSchemaContains 0 12 +12
src/state/openclaw-agent-db-schema-helpers.ts:hasLegacyMemoryChunkProvenanceTrigger 0 1 +1
src/state/openclaw-agent-db-schema-helpers.ts:hasRetiredAgentStateLeaseSchema 0 3 +3
src/state/openclaw-agent-db-schema.ts:agentDatabaseIntegrityBeforeMutationSteps 0 9 +9
src/state/openclaw-agent-db-schema.ts:refreshOpenClawAgentDatabaseSchema 0 1 +1
src/state/openclaw-agent-db-session-migrations.ts:readSqliteTableColumns 0 4 +4
src/state/openclaw-quarantine-store.ts:readQuarantineSchemaVersion 6 5 -1

The earlier pre-repair legacy-window pair was not an aggregate reduction: SQL mean360.1→480.2 and requests114.0→119.2. It identified 15 removed discovery/close requests per turn and an unrelated usage-cache write receipt invalidating shared session replicas. Commit 8feea29d435b1 scopes those four cache kernels to no changed session keys; the final pair above is after that repair, against an updated main baseline. No subtraction or speculative counterfactual saving is claimed.

Removed checks and accepted edges

  • Input actor cache-version expectation: unrelated metadata writes no longer reject input acceptance/adoption; the writer still checks the selected session, lifecycle, custody and live authority at commit.
  • Steering terminal reread: an admitted snapshot may miss a just-completed bookkeeping transition; the live run registry still owns cancellation and execution authority.
  • Cron generation/skill rereads: a concurrent internal bookkeeping change is observed by the next owner operation; current execution authority stays checked at the effect.
  • Duplicate main-thread canonical-readiness lookup: a worker-admitted row is served using its physical identity and committed write receipt even when the separate main-thread validation cache is cold; offline validation remains owned by admission.
  • Same-route read-lifetime recapture: prepared ownership and in-process write receipts govern the read lifetime; foreign-writer polling is not supported.
  • Projection per-chunk ownership reads: reset during a queued derived rebuild may leave a stale derived index until a later rebuild; canonical transcript bytes remain intact.
  • Post-selection registry currency: own/sibling admission and external alias replacement change the next selection; the selected physical source, receipt updates, and effect authority remain bound. Physical close, row replacement, and sharing changes still revoke that source.
  • Duplicate agent admission reader: the next owner operation consumes intervening ordinary metadata; prepared rows and the actual COMMIT receipt govern the current run.
  • Sharing snapshot cache: the duplicate cache and invalidation hooks are removed; prepared reads and the existing projection own visibility facts.
  • Duplicate pre-wait authorization: an unauthorized agent.wait may occupy an observer until completion/timeout; the one current check before returning data prevents disclosure.
  • Ambient Talk default recapture: an already-selected Talk operation keeps its selected agent if the default changes; sharing, incognito, replacement, and relay authority checks remain.
  • Ordinary roster rediscovery after publication: captured absence stays absent for that selection; a fresh selection discovers the store. Security-scoped sharing leases still revoke after unknown registration settlement because the commit receipt was lost.
  • Post-send session bookkeeping recheck: a confirmed built-in message send returns its receipt even when its own route write creates the session. Caller/credential checks remain; reads, dry runs, unconfirmed results, and plugin tools keep full session checks.
  • Self-effect timestamp recapture: an updatedAt-only change does not revoke an otherwise valid selected effect; real identity, sharing, and execution authority remain checked.
  • Read-only worker retirement/private snapshot cleanup: these events no longer force a blanket refresh of unrelated live database caches; owner write receipts still drive invalidation, and write-capable workers retain the default exit invalidation.
  • Readiness wrapper identity: a fresh wrapper of the same admitted live receipt remains valid; missing receipts, changed physical ownership, invalid claims, and invalid execution authority are still rejected.
  • Archive planning: the operation uses its captured row and receipt-updated predicate without an optional cache reread; raw updates that bypass the lifecycle owner are not adopted into that prepared plan.
  • Repeated sharing-preparation activity checks: cancelled preparation may finish consuming an already admitted read; resource acquisition and the final effect still check the retained owner.
  • Duplicate final sharing-preparation read: preparation joins pending writer receipts; a session changed after preparation may fail at the caller's first read/effect instead of during preparation. No unchecked session facts are exposed.
  • Placement ACK and journal pending checks: a retained committed placement remains usable while its own bookkeeping receipt is pending; pending claims and revoked reads still reject execution.
  • Maintenance inventory currency: turn claims, releases, ACKs, results, and journal writes keep preservation ownership unchanged. An overlapping inventory read may retain older bookkeeping metadata until the next publication; lifecycle changes and keyed execution authority still invalidate it.
  • Cancelled media cleanup: a failed OS deletion may retain one transient, unbound cleanup tombstone for the existing sweeper; it remains hidden from artifact downloads and creates no conversation message.
  • Accepted child cancellation: replacing its parent refuses new effects but does not undo an already accepted child interruption; if terminal bookkeeping fails, its exact durable claim remains recoverable until reconciliation publishes. A later best-effort session abort marker may be refused even after terminal cancellation is durable.
  • Retention reply snapshot recheck: placement snapshot currency is validated once when dispatching the retain command; a later bookkeeping update does not discard its accepted reply. Current node/connection identity, session generation, archive state, and real claim checks remain.
  • Cron recovery escalation: a partial monitor reconciliation may finish on its already-scheduled retry while the config is applied; thrown failures still use recovery restart.
  • Inapplicable placement preflight: metadata-only patches do not read placement because no placement policy applies; permission changes, unarchive, and actual runtime selection still run their applicable checks.

The cold admission correction reserves the existing admission turn before entering the writer FIFO (all batch paths together), preventing a usage refresh/prune ↔ history deadlock found in CI. Cancellation races only admission waiting; accepted writes retain settlement and cancelled reservations preserve predecessor order. Media delivery joins the existing pending publication before its effect check. Shared terminal publication receipts keep session/security authority while tolerating workspace changes; pending/latest receipts still compare receipt-updated workspace metadata.

The final integration repairs preserve caller authority after accepted sends, reuse prepared Talk profile policy, and retain the worker-owned read-admission facts for cold publication reads. Detached placement setup retains the existing session authorization alongside its device hold; workspace and archive effects consume receipt-updated metadata rather than optional cache presence. Cold source capture now runs after the existing read admission and before snapshot dispatch, without another query. Recovery notice authority is captured after recovery admission and retained until dispatch settles, including runtimes without a typing adapter.

Evidence and integration

Candidate b8ae4f2ad4d58a3e94b0a1fcac48348ed5921cb8 includes main 44d880a42258d0 and Phase E's memory-only incognito cutover. Conflict resolution preserves main's transcript-pool idle policy alongside read-only database ownership, and main's wire-fixture cleanup alongside serial Git setup, concurrent transfers, and actual terminal waits. Changed-file oxfmt, oxlint, and git diff --check pass.

  • Final integration CI: PASS on head b8ae4f2ad4d58a3e94b0a1fcac48348ed5921cb8, including openclaw/ci-gate, all production/test types, lint, Madge, source contracts, boundaries, T1/dialect/worker ratchets, security, and all ordinary behavioral jobs. 186 successful, 43 skipped, one neutral, zero failed checks.
  • Prior integration CI: on head 6cd0789ff8d04cd4374275b05b82ab3ee233b421, all types, lint, Madge, source contracts, boundaries, and T1/dialect/worker ratchets pass. Two behavioral jobs fail and one UI job times out; disposition is below. The subsequent repair changes only the MCP test watchdog; final integration also adopts main's scoped API-key test diagnostics, preserving its assertion.
  • Carried SDK/static proof: SDK surface check, all seven runtime API guardrails, and independent all-exports Knip pass. Production Knip reported the three inherited findings below. SDK/API and Knip configuration inputs did not change in the final main integration. Ordinary PR CI does not include production Knip. The minimal final-head Knip run reports five unused exports. The frozen-main comparison reproduces the exact same five production findings and three all-exports findings. All declarations and repository references match integrated main. These static failures are inherited; no ignores, baselines, or export contracts were changed to suppress them.
  • Published-driver update cell: PASS. The actual lifecycle job completed in 11m12s; the targeted lane step passed from 22:39:41–22:47:55 UTC. This replaces the earlier passing cell because the prior integration changed reached update finalization. Later main fix(doctor): allow offline state repair for app-owned Gateways #170768 adds only a macOS-app/offline-service repair branch: this isolated Linux npm cell never creates the required app marker, so its reached Doctor path is unchanged.
  • Prior-head SDK API comparison: 237 exports across 35 entrypoints; no added/removed entrypoints. The two signature-text differences only reorder authorized and reason properties. Lane changes are deprecation documentation/removal metadata, with no public signature change. This is explicitly prior-head evidence, not a final-artifact API comparison.

Final-head Knip's five production findings are bindSessionEntryPublicationSource, invalidateSessionEntryPublication, and publishSessionSharingFieldChange in session-accessor.sqlite-entry-cache-publication.ts; withSqliteCommittedPublications in sqlite-post-commit.ts; and sqliteDatabaseSealSchemaFor in openclaw-database-seal-schema.ts. All-exports reports the same three entry-cache publication names. The frozen main run above emits identical findings. Current main d08d23228ab2624820e0548a641465d6aa40bfa9 has no later edits to those declaration files. The earlier three memory/bootstrap findings were separately fixed by integrated main; they are not final-head findings.

The prior integration CI's bootstrap-token reconcile and node-reconnect expectations reproduce on integrated main 5b742a7c787e11a606418e5bb78e4364eb3454f1: the new connection contract returns structured UNAVAILABLE rather than rejecting, and close text is gateway closed (1011): gateway hello delivery failed. Focused base evidence: two failed, 44 skipped; Vitest 135.85s, command 148.90s. Both failing tests and their connection owner are unchanged from that base through the latest integration. The exact prior-head failure appears in job 115559015985 and also in scheduled main job 115550039641.

The MCP cancellation case in job 115559015572 exposed an overbroad test watchdog: it stayed armed after the native request settled, so unrelated full Gateway teardown could set emergencyUsed. The final two-line test repair clears the watchdog on actual request settlement. The five-second cancellation deadline and settlement-before-close assertion are unchanged. A focused base run failed earlier at sessions.create (23.886s case, 119.51s command), so it is not claimed as inherited evidence. On final head, the exact corrected case passes: 1 passed/1 skipped, 15.248s case, 51.03s Vitest, 56.34s command. This fixes the overbroad watchdog; it does not claim the differently failing baseline proved inheritance. The earlier chat-settings timeout did not reproduce on base or candidate; passing replay is not called a fix. Its obsolete diagnostic mock was removed, leaving the test byte-identical to the integrated base. Prior-head job 115559015797 passes that case (10.005s) and all 34 tests in its file.

CI-driven repairs include using the actual worker for usage write/prune regression setup; retaining the memory namespace in incognito creation; detaching App-file metadata from the opening RPC while preserving per-effect authority; and consuming an already-queued auth mutation before settling its publication. Focused regressions pass: usage 1/1 (case 3.3s, command 218.9s), Goal custody 3/3 (command 186.3s), App-file lifetime 1/1 (case 51ms, command 332.4s), incognito creation 1/1 (case 1.5s, command 325.3s), and auth publication (case 1.569s, command 59.66s; original failure reproduced before the fix). Command times include cold worker compilation. Forced termination continues to invalidate receipts; clean worker exit preserves admitted facts.

The live pair above exercises successful turns, child execution, RPCs, cron, compaction, and shutdown; it does not cover every denied filesystem/publication effect. No extra SQL pair was run after integration, and no local latency claim is made.

Codex autoreview completed two rounds across 19 partitions: five P2 findings, zero P0/P1; three fixed, two bookkeeping-reread requests declined under the accepted edges above. Later integration and CI repairs received focused source inspection. Cold media/App-file facts and logical-versus-physical worktree guard behavior remain documented follow-ups under the review cap; neither establishes an authorization bypass.

The prior-head UI 3/3 job reached its 20-minute job limit while still reporting passing tests; the annotations say the job exceeded its maximum execution time, with no failed assertion. This is a CI execution-time cancellation, not a passing UI claim.

Size and compatibility

Parent #169624 is merged. Against integrated main: 479 files, +8180/−5237 lines; production 182 files, +3518/−2935 (net +583); tests/support 292 files, +4644/−2274; docs 3 files, +16/−13; configuration/tooling 2 files, +2/−15. Direct lane kernels are +265/−265. Test classification includes paths and helper filenames containing test, plus .spec. files.

No lane schema/storage-format change or new configuration. Synchronous public SDK compatibility is deprecated with named async replacements and a later-release removal path. Native maintenance/Doctor and mixed compatibility kernels remain explicitly counted above. The Phase E hold is lifted and its memory-only incognito owner is integrated.

@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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 12, 2026
Preserve worker publication and post-commit mention scheduling while keeping session target preparation asynchronous.
Base automatically changed from dbasync/t1cut-s8-encoding to main October 12, 2026 08:48
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: b8ae4f2ad4d58a3e94b0a1fcac48348ed5921cb8
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/prepared-model-runtime-auth-publication.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/http-utils.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/session-sharing-authorization-async.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/session-sharing-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/placement-read-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/placement-turn-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/placement-turn-authority.types.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations labels Oct 12, 2026
Carry selected stores, preserve progress bindings, and keep sharing types out of the Gateway policy graph.
Keep retired standalone-memory tests removed and preserve async preparation with current owner authorization.
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation commands Command implementations labels Oct 12, 2026
Keep existing file and current authorization guards while allowing the owning writer to create an initially absent database. Preserve mock module contracts and projection-backed event fixtures.
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Oct 12, 2026
@steipete
steipete merged commit 949dbc5 into main Oct 13, 2026
239 checks passed
@steipete
steipete deleted the dbasync/t1cut-s8-targets branch October 13, 2026 22:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…169757)

Route durable Gateway target discovery, entry preparation, and combined-store lineage reads through the existing session worker. Migrate bundled callers to async APIs and keep prepared facts current through owner write receipts. Retain live authorization at real effects and documented deprecated SDK compatibility.

Remove redundant internal bookkeeping checks and preserve SQL-side retained-payload projections. Fix asynchronous fixture assumptions, the monotonic fake test clock, and the extracted wrapper source inventory.

Warmed causal median stays 170 statements / 41 requests / 0 MAIN; the lane removes six source-audited T1 sites across the three-PR series. Integrated Phase E independently removes six more; 15 conservative mixed SDK/worker/maintenance sites remain documented in the PR.

Join targeted recovery to an existing recovery receipt before acknowledging final placement state, while preserving active-operation progress.

Integrate the memory-only incognito owner without restoring native fallbacks; share captured memory rows during async lineage assembly.
@giodl73-repo

giodl73-repo commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Update: the focused test-only repair is now #171789, head 082a1ea24d57af07ad86b1268d654b2a324d0840. Exact-base execution reproduces the failure (1failed,231filtered); the repaired suite passes all232 tests both locally and in ordinary PR CI. The owning messaging type graph also passes in hosted CI. All original recovery assertions remain, with native authorization retained through the effect and released in finally. ClawSweeper found no actionable defect; maintainer disposition remains. No production change or CI waiver.

The original source-only report below is historical; its then-unexecuted repair and baseline statements are superseded by the proof above.


A concrete fixture follow-up from #151242 CI, head b51ae3f:

agent-runner.runreplyagent.e2e.test.ts reports 231 passes and one failure in tombstones a redelivered source whose recovery claim is already terminal. At agent-runner.runreplyagent.admission.cases.ts:265, authorization returns UNAVAILABLE: Session facts are unavailable; retry the request instead of null, before duplicate.run().

The fixture calls synchronous resolveSessionMutationAuthorization without prepared session facts. Merge 949dbc578efe9da59510fbc5f11683b51618a0b4 adds that fail-closed response for an ordinary durable target without prepared facts. The existing resolveSessionMutationAuthorizationAsync prepares and retains those facts.

The fixture and three inspected authorization/preparation modules are byte-identical between #151242 and its pinned base f36667c0b167e20b3704cb644055bd463529413b; the fixture still uses the same synchronous call at inspected main 670270edc060858b41a04589910002d4dcf97313. This is source attribution, not an executed baseline reproduction or CI waiver.

Could this join the existing worker-migration follow-ups? The candidate repair is to await the native preparation owner and retain/release its authority through the test effect, preserving the tombstone and no-model-work assertions. That repair is not yet executed or proved. No production authority fallback or relaxed assertion is requested. Reusing this owner thread rather than opening a duplicate issue or folding session changes into the streaming PR.

roboclaw-bot added a commit that referenced this pull request Oct 14, 2026
… source (#172579)

sessions.files list/get for managed-worktree sessions re-reads the session
entry during settlement to detect a reset or worktree change. Since #169757
that re-read passed the logical store path to readRetainedSessionEntryFacts,
which only knows the physical SQLite path, so it always returned undefined
and every request failed with "Session workspace changed during file read".

Use the captured read source path, matching the other retained-facts callers.

Co-authored-by: Patrick-Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
… source (openclaw#172579)

sessions.files list/get for managed-worktree sessions re-reads the session
entry during settlement to detect a reset or worktree change. Since openclaw#169757
that re-read passed the logical store path to readRetainedSessionEntryFacts,
which only knows the physical SQLite path, so it always returned undefined
and every request failed with "Session workspace changed during file read".

Use the captured read source path, matching the other retained-facts callers.

Co-authored-by: Patrick-Erichsen <[email protected]>
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 ci:full Keep ordinary native-locale CI selection on the next PR run. cli CLI command changes docs Improvements or additions to documentation extensions: codex extensions: memory-core Extension: memory-core extensions: qa-lab gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants