Skip to content

perf(sessions): read model context and watermarks through the history reader - #164989

Merged
steipete merged 5 commits into
mainfrom
dbasync/transcriptctx
Oct 4, 2026
Merged

steipete merged 5 commits into
mainfrom
dbasync/transcriptctx

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #119055, #162433.

What Problem This Solves

Normal chat turns still synchronously read transcript context validation, watermarks, and message presence on the Gateway thread, even when the surrounding workflow is asynchronous.

Why This Change Was Made

Route those reads through the existing history reader and carry acknowledged transcript-start facts from the native SessionManager through the bundled reply paths. CLI/custom harness, ACP, inline-tool, and early-event paths prepare missing facts asynchronously. The final model-context acceptance runs synchronously inside the existing anchor reader's FIFO/native-mutation fence, so a rewrite after worker validation cannot publish stale context.

The read source captures physical store identity before yielding and retains existing admission and close custody. Cold markers and hot message probes stay in one synchronous snapshot; restoration retains its existing owner. Final writer and turn authority, completion acknowledgement, and synchronous public SDK/incognito contracts remain intact. No new service, cache, schema, retention, durability, dependency, or environment-variable name.

User Impact

No intended user-visible behavior change. This reduces synchronous database work during chat turns while preserving stored transcript bytes and context selection. Measurements below establish SQL placement, not a latency improvement or reduction in total SQL.

Evidence

SQL measurements and the original focused suites below apply to 64e09112bae776421ec2d690c205d6d494b8bb30. Later landing repairs have separate evidence below; the SQL workload was not remeasured.

MAIN SQL execution counts Before Measured head Delta
Warmed per turn (10 turns) 222.1 201.6 −20.5 (9.2%)
Whole workload 7,869 7,597 −272 (3.5%)
Selected lane per turn 28 6 −22 (78.6%)
Selected lane whole workload 409 78 −331
Selected caller cohort (including its read envelope) Before / 10 warm turns Final / 10 warm turns Per turn
Watermark (session-accessor.sqlite-transcript-watermark.ts:38, session-accessor.sqlite-transcript-watermark-read.ts:45) 140 0 14 → 0
Context version (session-accessor.sqlite-transcript-state.ts:75, through validateSessionTranscriptContextVersion) 90 60 9 → 6
Attempt message presence (session-accessor.sqlite-read.ts:498/502 on the base) 50 0 5 → 0

The lane's 28/turn baseline yields a measured 22/turn saving. The remaining 6/turn are two existing current-turn replay authority checks at pre-persisted-user-turn.ts:126, reached from preparation :133 and synchronous admission :158; each performs a freshness PRAGMA, cold marker read, and version read. The moved model-context acceptance uses worker validation; these final-authority checks remain explicit debt. The anchor sibling has focused boundary coverage but is not independently countable in this workload.

Compared clean base 82adb7a49d36e844e4ea1989bc5d865abac916f0 with measured reviewed commit 64e09112bae776421ec2d690c205d6d494b8bb30, using the unchanged sqlmeasure3 workload/observer/analyzers on Node 24.21.0, SQLite 3.53.4, macOS arm64. Source manifests before build, after build, and after run match. Counts include successful SQL executions and background work; prepares and failed executions are excluded.

The selected lane saves 220 warm statements; overall warm savings are 205 because other background/settling work differs by 15. Final first-turn MAIN counts are 769 → 742; the second-session phase is 866 → 865. A preserved earlier after sample (20628e04414c3a, before mechanical lint cleanup) measured 200.7/turn and 7,682 overall, with the same 22/turn lane saving. Its first turn included 105 existing session-sharing authority fallback statements while projected facts were unavailable; the final first turn has none. Both after samples have nine such statements in their first warm turn. Background reconciliation also shifts across phase windows. The trace does not establish why projection readiness differed or exclude scheduling effects from the added awaits. No final MAIN stack contains the new read-source helpers.

Both baseline and final passed all 13 top-level turns, the separately awaited child, all RPCs, real scheduled cron, committed compaction, and graceful shutdown ([0, null]). Final counts exclude two MAIN startup catalog BEGIN IMMEDIATE lock failures before the first turn, in unchanged src/model-catalog/remote-store.ts:79 through the existing state transaction owner, plus one worker shutdown audit-pruning lock failure. All report database is locked; prepare errors are zero. Baseline excludes one worker shutdown audit failure and has no MAIN failures. These failures remain in the raw evidence; no rerun was made to obtain a cleaner result.

Total successful SQL increased 46,130 → 46,502 (worker-thread 37,783 → 38,419; helpers 478 → 486). This is SQL-placement evidence, not a total-SQL or latency improvement claim. Final build: 343.6s; instrumented workload: 151.24s. All owned fixture processes settled, the temporary harness is parked outside the repository, and the worktree is clean.

The zero-caller-SQL boundary covers both cold and warm native handles, admission/version/completed-turn context, watermarks, and present/absent message checks. Lifetime/replacement coverage rejects closed owners and copied database replacement. The delayed-validation-reply regression verifies an actual synchronous SDK rewrite before asserting rejection. A negative control that bypassed only the native mutation comparison failed by resolving a SessionManager instead of rejecting (83.50s); the repair was restored byte-for-byte.

  • Focused context/admission/snapshot/native-start suite: 21 tests passed, 490.44s wall.
  • Reader boundary/lifetime/race, legacy unindexed-message import, and Bun worker-entry checks: 7 tests passed, 320.39s wall.
  • Shared-registry import rule: runtime process build graph, eager import closure, reply import closure, session-history imports, and state-worker imports passed, 287.73s wall.
  • node scripts/check-changed.mjs: passed, 2,524.13s wall.
  • Madge: 0 cycles. Database worker ratchet against the pinned merge base: no T1 call-count growth (static baseline 895).
  • Local SDK API diff (realpath private TMPDIR, pinned base → final head): 172 reachable export changes; no entrypoints added or removed. Reviewed additions are prepared start facts, an optional fourth callback argument and optional event field, the internal native symbol getter, and the history-worker presence request; the subscriber parameter label also changes. Existing synchronous callback contracts remain supported. Acknowledgement digest: 92abd951; 1,274.50s wall.
  • Fresh isolated Codex P2 autoreview against the pinned merge base: scoped-clean, no actionable findings. The earlier delayed-validation-reply finding was repaired and the complete candidate re-reviewed.

All focused test commands used --maxWorkers=1. Wall times include local compiler/shard setup; CI timing has not yet been measured.

Focused test commands and local wall time
# 490.44s, 21 passed
pnpm test src/config/sessions/session-transcript-context-read.worker.test.ts src/auto-reply/reply/agent-runner-execution-timing.test.ts src/agents/sessions/session-manager-model-context.test.ts src/agents/sessions/session-manager-model-context-snapshot.test.ts --maxWorkers=1 -t 'caller SQL|after final worker validation|closed after scanning|copied replacement|native start facts|validates admission|validates unadmitted|completed-turn snapshot|context queue overload'

# 320.39s, 7 passed
pnpm test src/config/sessions/session-transcript-context-read.worker.test.ts src/config/sessions/session-accessor.sqlite-import.test.ts src/infra/bun-sqlite-library.worker.test.ts --maxWorkers=1 -t 'caller SQL|after final worker validation|closed after scanning|copied replacement|reads legacy handoff|prepares SQLite before a cold model-context'

# 287.73s, all selected shards passed
pnpm test test/scripts/runtime-process-build-graph.test.ts test/scripts/eager-import-closure.test.ts src/auto-reply/reply/get-reply.imports.test.ts src/config/sessions/session-history-read.imports.test.ts src/state/openclaw-state.worker.imports.test.ts --maxWorkers=1

The worker/native SQLite boundary requires real workers to detect caller-thread SQL and delayed replies; these are local gate costs, not latency measurements.

Overlaps and retained boundaries

This intentionally overlaps Vincent Koc's draft #119055 at openModelContextAsync; it builds on main with focused hunks. It also touches functions in the #162433 ownership-design draft without adopting that restructuring. The lane does not take lifecycle/deletion's commit-side snapshot or sibling-lane ownership.

Released synchronous SDK entry points and legacy callbacks that omit prepared start facts retain their compatibility path; the bundled callers of the moved model-context/history/reply-start seams are cut over. Existing live session-owner reads remain follow-up debt: src/gateway/server-methods/chat-send-reply-dispatch.ts:230 inside final reply authority and src/gateway/session-activity-summaries.ts:273 in current-entry assertions. The moved transcript operations' boundary excludes these retained authority reads. Unchanged synchronous final-authority consumers also remain in src/agents/embedded-agent-runner/run/pre-persisted-user-turn.ts:126 (current-turn replay), src/agents/cli-runner/history-boundary.ts:181 (CLI history commit), and src/skills/workshop/experience-review.ts:210 (source revocation). These are not claimed as migrated SDK-only paths or counted as lane savings.

Update behavior preserves the existing history-reader owner, admission rules, writer owner, and close lifecycle. The reader transport cutover requires a published-driver update cell; its result is recorded with the landing evidence below. The compatibility record is static SDK migration metadata, not a database schema, backfill, or stored-data change.

Landing repairs and current proof

7081b391df1017442adbe0bd9f4f5d237afd59af repairs source-chat versus bound-ACP transcript ownership, clears obsolete boundaries after failed recapture, and scopes prepared facts and callbacks to each fallback candidate. The ACP regression and two fallback negative controls failed on their corresponding pre-fix states. Lifecycle fixtures now emit the actual start event before model phase; strict subscriber expectations include the first-event facts. b08ded31c392925e154f2d311c42a0a413c18b75 incorporates main with a merge commit; the sole conflict was compatibility documentation, resolved by retaining both records.

The latest released SDK surface (v2026.9.8) keeps the synchronous three-argument onAgentRunStart contract. New fourth-argument facts are optional; legacy omitted-facts behavior is retained by reply-run-start-unprepared-transcript, with migration documentation and type coverage. The refreshed local SDK report for e9edda349fae → b08ded31c392 has 206 reachable exports across 30 entrypoints, 22 changed declarations, and zero export or entrypoint additions/removals. Inspection found no breaking released contract. Acknowledgement digest: 0145bec2.

  • Complete-candidate isolated Codex P2 autoreview: scoped-clean, no actionable findings after the fallback repair. Main integration preserved the reviewed runtime bytes.
  • On b08ded31c392, six affected files passed 238 tests with --maxWorkers=1, 264.93s wall: Gateway reply dispatch, ACP completion, Talk consult history, directive tags, execution timing, and execution lifecycle. Isolated proof run.
  • Earlier repair proof passed 66 lifecycle/compaction/reasoning tests (270.65s), 18 SDK/registry tests, SDK types, production core types, messaging test types, docs anchors, scoped lint/format, and the final five timing cases (257.79s).
  • A local Gateway attempt passed Talk but timed out during ACP under heavy host load (402s import/setup, 62s test). It remains failed/incomplete evidence; the later isolated pass does not establish the cause of that timeout. Its owned process was stopped and no fix or passing claim is inferred from a replay.

Initial CI run 37213585148 exposed five PR-caused files: each failed 5/5 single-file runs at 64e09112 and passed 5/5 at base 82adb7a. Those failures are repaired above. The UI setup-flow placement-authority race was independently reproduced on main ancestor 2851e89750f5 with byte-identical relevant files; exact PR and base each passed 5/5. It is inherited and intermittent, not a fixed flake. CI run 37220851923 then stopped at the assertion-safety ratchet because the repaired reply state removed two casts while its old baseline allowance remained. The canonical prune removes only that stale line; no assertion or guard is weakened. Sibling jobs cancelled by fail-fast are not passing coverage.

Published-driver update cell passed on exact candidate b08ded31c392925e154f2d311c42a0a413c18b75: published 2026.9.8 → candidate 2026.9.8, with candidate build identity verified. The real updater exited 0 in 364.510s; durable run finished, /readyz returned 200, and running version was verified. Managed-service teardown passed. Whole cell: 436s; canonical package and tarball integrity/import-graph validation: 673s. The package build logged a nonfatal startup UI budget diagnostic (365.0 KiB versus 364.7 KiB); the package and update gates exited 0. Final head 934fb29c279fd9bf177a1535f5aa19a46ae90f50 changes only the one-line assertion-baseline prune, so these runtime/package inputs are unchanged.

ClawSweeper completed on 934fb29c279fd9bf177a1535f5aa19a46ae90f50 at 2026-10-04 17:57 UTC with no actionable introduced defect. Its narrative confirms unchanged storage contracts; its generic data-model checklist is triggered by the static compatibility-registry path. The required reader-transport upgrade cell above is complete.

Final exact-head CI run 37222131490 passed on 934fb29c279fd9bf177a1535f5aa19a46ae90f50 (662s wall from run start to last update, across parallel jobs). The current rollup has 129 successful checks, 53 intentional skips, one neutral check, and three successful commit statuses including openclaw/ci-gate; no failed or cancelled checks. No CI rerun or admin bypass was used for the final head.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 1:57 PM ET / 17:57 UTC (Revision 5).

ClawSweeper review

What this changes

Moves transcript context validation, watermark reads, and message-presence checks into history workers and carries prepared transcript boundaries through reply callbacks.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a distinct optimization absent from current main. No actionable introduced defect was found, and the previous migration-proof blocker does not apply because this cutover preserves the stored-data contract.

Priority: P2
Reviewed head: 934fb29c279fd9bf177a1535f5aa19a46ae90f50

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong, transparently scoped runtime measurements and ownership regressions support a coherent cutover with preserved released compatibility.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied real Gateway workload demonstrates after-fix SQL placement through the changed history-read path, with successful turns, RPCs, cron, and compaction. Its pinned historical identity is preserved; later callback repairs have supplemental boundary coverage. No stored-data contract changes, so migration proof is not applicable.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied real Gateway workload demonstrates after-fix SQL placement through the changed history-read path, with successful turns, RPCs, cron, and compaction. Its pinned historical identity is preserved; later callback repairs have supplemental boundary coverage. No stored-data contract changes, so migration proof is not applicable.
Evidence reviewed 8 items Pinned ownership and review continuity: Reviewed the introduced e9edda3..934fb29 delta. Since the previous reviewed head b08ded3, only the retired reply-dispatch assertion baseline entry changed; runtime and tests are unchanged. The stale test merge was not used to infer merge-result regressions.
Final context acceptance: Detached context is accepted synchronously inside the existing anchor reader's FIFO and native-mutation fence, after worker admission/version/anchor validation and current-source checks. The new boundary tests exercise actual workers, closed-owner rejection, copied replacement rejection, and a synchronous rewrite after final worker validation.
Released callback compatibility: The v2026.9.8 source confirms the released three-argument callback and synchronous completion acknowledgement. The branch adds only an optional fourth argument, retains the omitted-facts synchronous fallback, supplies a compatibility record and type coverage, and documents removal only at the next SDK major with explicit approval.
Findings None None.
Security None None.

How this fits together

Session history supplies conversation context to agents and transcript boundaries to reply delivery and activity summaries. The history reader moves database work off the Gateway thread while existing owners control admission, writes, and result publication.

flowchart TD
  A[Chat and activity requests] --> B[Captured transcript source]
  B --> C[History worker reads]
  C --> D[Current owner and mutation checks]
  D --> E[Accepted model context]
  D --> F[Prepared reply boundaries]
  F --> G[Reply delivery and activity summaries]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +593, Tests +404, Docs +34, Other -1. Total +1030 across 55 files.

View PR surface stats
Area Files Added Removed Net
Source 35 847 254 +593
Tests 17 459 55 +404
Docs 2 36 2 +34
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 55 1342 312 +1030

Review metrics

Metric Value Why it matters
Production and test growth Production +845/-254 (net +591); tests/support +461/-55 (net +406) Growth is explained by reader custody, final validation, and bundled caller cutover; these counts use the pinned introduced delta.
Public callback extension 1 optional callback argument added The released three-argument contract, synchronous acknowledgement, and omitted-facts fallback remain supported.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugins/compat/session-persistence-records.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep transcript reads within the existing history owner while preserving synchronous SDK compatibility and final writer and turn checks.

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

Not applicable as a bug reproduction; current-main source and the supplied before/after workload establish the synchronous-read placement this PR targets.

Is this the best way to solve the issue?

Yes. It extends the existing history reader and preserves final publication fences rather than introducing another database owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2be4d4fc561b.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded internal performance improvement with no intended change to user-visible behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied real Gateway workload demonstrates after-fix SQL placement through the changed history-read path, with successful turns, RPCs, cron, and compaction. Its pinned historical identity is preserved; later callback repairs have supplemental boundary coverage. No stored-data contract changes, so migration proof is not applicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied real Gateway workload demonstrates after-fix SQL placement through the changed history-read path, with successful turns, RPCs, cron, and compaction. Its pinned historical identity is preserved; later callback repairs have supplemental boundary coverage. No stored-data contract changes, so migration proof is not applicable.

Evidence

What I checked:

  • Pinned ownership and review continuity: Reviewed the introduced e9edda3..934fb29 delta. Since the previous reviewed head b08ded3, only the retired reply-dispatch assertion baseline entry changed; runtime and tests are unchanged. The stale test merge was not used to infer merge-result regressions. (config/assertion-safety-baseline.txt:2114, 934fb29c279f)
  • Final context acceptance: Detached context is accepted synchronously inside the existing anchor reader's FIFO and native-mutation fence, after worker admission/version/anchor validation and current-source checks. The new boundary tests exercise actual workers, closed-owner rejection, copied replacement rejection, and a synchronous rewrite after final worker validation. (src/config/sessions/session-transcript-context-read.ts:33, 934fb29c279f)
  • Released callback compatibility: The v2026.9.8 source confirms the released three-argument callback and synchronous completion acknowledgement. The branch adds only an optional fourth argument, retains the omitted-facts synchronous fallback, supplies a compatibility record and type coverage, and documents removal only at the next SDK major with explicit approval. Public docs: docs/plugins/sdk-migration/compatibility-policy.md. (docs/plugins/sdk-migration/compatibility-policy.md:214, 934fb29c279f)
  • Previous findings addressed: Execution start is independent of source-chat boundary capture, mismatched recaptures clear the old boundary, subscriber expectations include the added facts, and the lifecycle fixture awaits the start event. Candidate-local callback retirement and timing tests cover settled and pending predecessor preparations. Existing ACP tests still enforce synchronous completion ownership. These were inspected as source coverage, not rerun. (src/auto-reply/reply/agent-runner-execution-timing.test.ts:21, 934fb29c279f)
  • Real SQL-placement evidence: The captured body, source revision b73ba5d1885a41a8831aff8060f53ab0a93b9428567352d03d7ddfbaa113d1ed, records a real macOS Gateway workload comparing 82adb7a with 64e0911: 13 top-level turns, a child, RPCs, scheduled cron, committed compaction, and graceful shutdown passed; selected-lane MAIN SQL fell from 28 to 6 statements per warm turn. This is historical SQL-placement proof, not an exact-current-head latency or total-SQL improvement claim. Startup and shutdown lock failures are disclosed separately. (64e09112bae7)
  • Still necessary on current main: Fetched main still performs synchronous admission, version, and completed-turn anchor validation after the asynchronous model-context scan. The latest release retains the older callback contract. No supplied merged related PR owns this cutover; the two ownership drafts overlap only partially, and the activity-notification PR addresses a separate publication defect. (src/agents/sessions/session-manager.ts:628, 2be4d4fc561b)

Likely related people:

  • Peter Steinberger: Raw commit f9dfa9a adds src/config/sessions/session-transcript-anchor-read.ts:128 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f9dfa9a36f15; files: src/config/sessions/session-transcript-anchor-read.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-04T15:39:38.765Z sha 64e0911 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T15:44:30.044Z sha 64e0911 :: blocked before merge. :: [P1] Preserve source-chat boundaries for bound ACP replies | [P2] Migrate strict subscriber assertions to the added start facts | [P2] Supply the prepared execution event in the lifecycle fixture
  • reviewed 2026-10-04T17:21:54.491Z sha 7081b39 :: blocked before merge. :: none
  • reviewed 2026-10-04T17:38:03.956Z sha b08ded3 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
…aries

Keep bound ACP execution start independent of source-chat transcript capture,
and clear rejected source recaptures instead of retaining an older boundary.
Scope prepared facts and callbacks to each fallback candidate so retired reads
cannot notify or supply a successor's transcript start.

Preserve released reply callback compatibility with a registry record and type
coverage, and update lifecycle fixtures to follow the real execution ordering.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
Merge e9edda3 to resolve the
compatibility-policy documentation conflict. Retain both the reply-start
migration and main's ACP metadata compatibility section.

The reviewed transcript-context and reply-start runtime changes are unchanged.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 4, 2026
@steipete
steipete merged commit 0816aa1 into main Oct 4, 2026
195 checks passed
@steipete
steipete deleted the dbasync/transcriptctx branch October 4, 2026 18:28
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
… reader (openclaw#164989)

* perf(sessions): move context and watermark reads to history reader

* fix(sessions): satisfy transcript reader lint contracts

* fix(sessions): preserve reply-start ownership across transcript boundaries

Keep bound ACP execution start independent of source-chat transcript capture,
and clear rejected source recaptures instead of retaining an older boundary.
Scope prepared facts and callbacks to each fallback candidate so retired reads
cannot notify or supply a successor's transcript start.

Preserve released reply callback compatibility with a registry record and type
coverage, and update lifecycle fixtures to follow the real execution ordering.

* chore: prune retired reply-dispatch assertion baseline
steipete added a commit that referenced this pull request Oct 5, 2026
Prepare the reply transcript boundary before a remote OpenClaw worker
announces execution. Carry its backend through the existing start callback
so chat delivery and cancellation use the same runtime ownership facts.

This prevents duplicate assistant replies and lets the next turn after a
worker cancellation reach the provider instead of silently settling.
Both regressions were introduced by 0816aa1 (#164989) and reported in
#165225. Preserve singleton reply and skill replacement E2E assertions.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Prepare the reply transcript boundary before a remote OpenClaw worker
announces execution. Carry its backend through the existing start callback
so chat delivery and cancellation use the same runtime ownership facts.

This prevents duplicate assistant replies and lets the next turn after a
worker cancellation reach the provider instead of silently settling.
Both regressions were introduced by 91961ee (openclaw#164989) and reported in
openclaw#165225. Preserve singleton reply and skill replacement E2E assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant