Skip to content

fix: preserve canonical context across history reconstruction - #194362

Merged
jalehman merged 4 commits into
openclaw:mainfrom
rabsef-bicrym:codex/canonical-history-replay-upstream
Nov 10, 2026
Merged

jalehman merged 4 commits into
openclaw:mainfrom
rabsef-bicrym:codex/canonical-history-replay-upstream

Conversation

@rabsef-bicrym

@rabsef-bicrym rabsef-bicrym commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A context engine can retain a raw user message after that message leaves the host's bounded hydration window. Reconstructing it from the moving window loses its canonical runtime-context carriers. Inter-session provenance is also rendered before context-engine assembly, so reconstructing a completion can remove its envelope. The next foreground turn then rewrites an already-cached conversation prefix even when the system prompt and tools are unchanged.

Related: #164515 and #159799. This addresses the context-engine reconstruction case, not every hydration-window or cache-expiry issue reported there.

User Impact

Retained raw history can keep its original metadata, attached runtime context, and inter-session presentation across completion-to-chat transitions. The companion LCM change consumes the new public reader; the reader alone does not change LCM reconstruction. No configuration, model, compaction threshold, schema, or stored transcript is changed.

Why This Change Was Made

The host owns canonical transcript identity, active branches, and admission. Expose a bounded readSessionTranscriptReplayGroups through the existing context-engine-transcript-runtime SDK instead of making context engines scan private files or infer missing carriers from text. Reuse the existing provenance renderer after model-prompt projection at the final LLM boundary.

Files Change
src/plugin-sdk/{context-engine-transcript-runtime,session-transcript-runtime}.ts Read retained user IDs and model-adjacent owned carriers
src/config/sessions/session-transcript-*, session-history-read-operation*, src/state/openclaw-agent-execution-* Preserve snapshot, admission, byte budget, and lock ordering
src/config/sessions/session-actor-memory-* Provide the same read without SQLite or a worker
src/agents/replay-provenance.ts, embedded-agent-runner/replay-history.ts, run/attempt-llm-boundary.ts Share the existing idempotent provenance formatter
Reader, memory, and LLM-boundary tests; gateway mock support; test allocation; SDK docs Specify active-branch, ownership, budget, and replay behavior

The reader returns requested IDs in order, deduplicated. Absent, inactive, non-user, and admission-fenced IDs are omitted. A cumulative uncompressed source-byte overflow rejects the whole read; storage failures are not silently treated as empty history. Default budget: 8 MiB; cap: 64 MiB and 10,000 IDs. No new cache, polling, retry loop, storage owner, or direct transcript-file reader is introduced.

Thinking/model changes, ordinary custom bookkeeping, labels, and session information may separate a user from its carriers without adding a model message. The reader skips those records without hydrating their payloads. It still stops at messages, other custom messages, background-result placements, compaction, reset, and branch-summary boundaries. Background-result placements are not bookkeeping: they can insert assistant messages at that position.

Evidence

Captured before/after on an existing long-running session

On November 6, 2026, a real subagent-completion -> image-tool -> foreground-chat transition was captured before and after the paired host/LCM repair. These were private operator turns in the existing main session, with channel delivery disabled. The table contains only numerical evidence; private conversation payloads and identifiers are not published.

Measurement Before After
Completion cache-read tokens 418,583 550,849
Following chat cache-read tokens 38,389 550,849
Following chat cache-write tokens 369,687 664
Following chat uncached input tokens 4 4
Following chat total input tokens 408,080 551,517
Identical leading provider message entries 340 854
System prompt identical within transition Yes Yes
Tools identical within transition Yes Yes
Gap between captured requests 29.093 seconds 10.571 seconds

The repaired chat reused 99.88% of input from cache; cache writes fell 99.82%. The repaired prompt is larger because canonical context that previously disappeared is retained. Model selections and compaction settings were unchanged. After a cleanup restart, another successful reply reported 551,513 cache-read, 469 cache-write, and 4 uncached input tokens.

Evidence boundary: the live capture used a patched 2026.10.8 deployment with both repairs. This PR ports the host repair onto current upstream; its current-head tests are listed separately below. No live deployment was changed while preparing these PRs. Ordinary new input, compaction, expiry, and logged assembly-error fallback can still create cache writes; this is not a claim that all subscription-limit causes disappear.

Gateway and companion-consumer proof at f49e92e

Tested host f49e92e4d8151ff1d6a7a8078081934351c60691 with the unchanged companion LCM head 7fd2091a1dfccca8efce7c21432719541135fb6b. The host build, runtime-postbuild, and build-info stamps all match that committed head. The LCM bundle SHA-256 is 9cc5dabedecad265eec2aae80615ed1fbac7fe2c369da68d44ef7e3c00ff31ad.

An isolated built Gateway used a fresh workspace/state, disabled cron and external delivery, and a local Anthropic-protocol HTTP/SSE capture server. The sequence was real chat.send warmup -> agent with a synthetic internal completion event -> native read of a synthetic image -> foreground chat.send. This exercises the Gateway completion endpoint, not a real child-task settlement. Model responses and usage counters were synthetic; no provider credentials, paid model requests, or live Gateway changes were involved.

The actual companion engine ran through the public SDK. An observation-only wrapper logged its assemble inputs/outputs without modifying them. The image moved both historical users and their carriers outside the host hydration window. The first run on f13368e3b2b exposed a real missing case: thinking-level/model-snapshot bookkeeping between the warmup user and its carrier stopped the reader. The follow-up fixes that case in both storage readers, with a separate stop boundary for background-result placements.

Sanitized terminal observations:

                                      f13368e3b2b   f49e92e4d81
Retained users outside hydration                2              2
Hydrated messages (assistant only)              1              1
Reconstructed history messages                  7              8
Restored historical runtime carriers            1              2
Identical leading provider content blocks       1              6
System prompt unchanged                      true           true
Tool definitions unchanged                    true           true
Cache identity unchanged                      true           true

Current-head completion: status=ok, successfulTools=[read]
Native image reached provider: 2,190,526 bytes
Current-head foreground: status=ok, visible terminal reply
Gateway shutdown: exit=0
LCM assembly calls observed: 7; assembly errors: 0
PASS: two retained users and both runtime carriers reconstructed
PASS: six pre-image provider content blocks preserved in order
PASS: cache-marker retention policy and old-prefix coverage preserved
Stable six-block content SHA-256:
8f9d8ce8621b0e89644beb09bfd697fc52c4c7c61ce95b1b3603aafe81c120ca

Comparison boundary: the seventh block is the image tool result, which LCM intentionally replaces with a stored-file reference. The six preceding blocks include both canonical users, both runtime carriers, the earlier assistant reply, and the image tool call. The repository's snapshotProviderPrefix / assertStableProviderPrefix checks preserve their ordered content while accounting for Anthropic's equivalent text-string/block forms and moving cache-control markers. This is not full raw HTTP-byte equality or live Anthropic cache-hit proof; the older deployment's real cache counters remain separately labeled above. No compaction or assembly fallback occurred in this current-head run.

Regression red/green

  • Existing completion-provenance boundary cases copied onto parent 9f9471128ace: both failed with the missing inter-session envelope (29.18s). On the initial PR head, both passed (31.78s). The same test source was used; unrelated fixture setup failures were excluded from these results.
  • Bookkeeping regressions on f13368e3b2b: the durable reader and memory reader both returned empty carrier lists, failing their expected canonical groups. The repaired readers pass both cases, including oversized metadata that must not consume the replay payload budget.
  • Manual review identified background-result placement as a real model boundary. Regression fixtures now place a valid pending automation result before the selected user and its placement before a later carrier, proving that the reader does not borrow that carrier across the placement.

Functional checks at f49e92e and its predecessor

On Node 24, with one Vitest worker:

pnpm test src/plugin-sdk/session-transcript-runtime-replay.test.ts src/config/sessions/session-transcript-memory-read.test.ts --maxWorkers=1
pnpm test src/agents/embedded-agent-runner/run/attempt.llm-boundary.test.ts src/agents/agent-tools.prefix-stability.test.ts --maxWorkers=1
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
node scripts/run-tsgo-core-test-shards.mjs --ci-graphs-json '["core-test-plugin-sdk","core-test-agents-sessions","core-test-agents-other"]' --concurrency 1
pnpm build:ci-artifacts
pnpm plugin-sdk:check-exports
  • 48 focused cases covered: 5 canonical-reader and 9 memory-reader tests passed on the follow-up (27.97s wall time including the cold worker build); the unchanged 20 LLM-boundary and 14 tool-prefix tests passed on the initial PR head (2.71s and 16.07s respectively). Tests ran through the repository's scripts/run-vitest.mjs entrypoint.
  • Core and the two affected test typecheck graphs passed on the follow-up; the third graph passed on the initial head. Scoped formatting, lint, docs markdown lint, export checks, and git diff --check passed.
  • Exact-head build:ci-artifacts passed in 1m57.8s. Its non-fatal UI performance report flagged gzip budgets by 0.3 KiB (largest JS), 0.4 KiB (chat boot), and 0.7 KiB (new boot); no UI source or budget was changed by this PR. This is recorded, not claimed as a clean UI-performance gate.
  • The subsequent pnpm ui:check-performance:base 9f9471128ace7cff27cecfbad387a3129ef7daac check failed. Attribution found that the only module with changed raw size was the generated packaged-plugin inventory (ui/src/plugins/control-ui-distribution.ts: 4,162 versus 1,432 bytes); the candidate had the full built plugin distribution and the source archive did not. That run measured 560,795/560,533 bytes for largest-JS actual/limit and 797,633/797,380 for new-boot actual/limit. No budgets were raised or UI changes added. The source comparison's artifact asymmetry remains a validation limitation, not a passing gate or a claimed inherited failure.
  • An independent manual review caught and verified fixes for stale durable admission generations and memory branch selection before admission clipping.
  • The scoped test-line allocation is 473 lines, covering the new reader contract, branch/admission interaction, byte budgets, bookkeeping/placement boundaries, provider prefix, and reader mock shape.
  • The test-line ratchet against the pinned parent reports 6,556,272 lines against a 6,556,267 ceiling, five over. Its measured PR delta and added allocation are both exactly 473, so the parent accounts for the same five-line deficit (6,555,799 against 6,555,794). The PR does not add unallocated lines; no unrelated tests or shared ceiling were changed to hide this gate failure.

Public SDK declaration comparison on the initial PR head completed successfully against 9f9471128ace (pnpm plugin-sdk:api:diff --base 9f9471128ac --head f13368e3b2b). It reports three added exports on the existing context-engine transcript subpath, no removed entrypoints or exports, and 171 existing exports with changed reachable declarations from the added read operation/types (digest f06acae8). The follow-up does not change the public signature; its built SDK is exercised by the companion consumer above. Maintainer approval of this additive public contract remains a merge decision, not something this proof grants.

November 9 CI repair

Marked ready for review to run normal hosted CI. Run 42711889355 identified an incomplete repository-file transcript mock, two missing wrapper inventory entries, undocumented provenance cast invariants, and missing worker-only classification for the replay kernel. Commit 49bab6c47a1c74ad6760b7022244b8c34bbb7909 repairs those integration omissions without changing production execution or public SDK behavior. Both replay-kernel callers are existing worker modules: session-history-read-operation.worker.ts and openclaw-agent-execution-transcript.worker.ts.

Focused local verification:

  • Repository-file tests: 15 passed, 37.35s wall time.
  • Wrapper inventory and extracted dependency tests: 2 passed, 8.44s wall time.
  • Gateway-methods test type graph: passed, 2.3s.
  • Assertion safety, SQLite worker ratchet, scoped lint/format, and git diff --check: passed. Main-thread SQLite count remains 167 -> 167.
  • Test allocation is now 476, matching the original 473 plus the missing three-line mock implementation. The pinned parent retains its previously documented five-line deficit; no shared ceiling was raised.

Hosted CI run 42713758431 completed successfully on 49bab6c47a1c74ad6760b7022244b8c34bbb7909, including all three previously failing jobs, build artifacts, and all three PostgreSQL conformance shards. The separate PR-tooling Darwin workflow also passed. The Gateway/companion-consumer evidence above remains explicitly pinned to f49e92e4d815; it was not rerun for these non-behavioral integration changes. No full test suite or auto-review was run locally, per operator instruction. Maintainer acceptance of the public SDK contract remains outstanding.

Companion LCM PR: Martian-Engineering/lossless-claw#1288. The host capability must be available for that plugin's canonical replay path; older hosts retain the existing bounded-live-window behavior.

- Expose bounded active-branch replay groups through the context-engine SDK.

- Carry admission and snapshot ownership through worker and memory readers.

- Render persisted inter-session provenance at the final model boundary.

- Cover canonical replay, branch admission, byte budgets, and stable provider prefixes.
@clawsweeper

clawsweeper Bot commented Nov 6, 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 plugin: file-transfer labels Nov 6, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: ready, awaiting a maintainer decision.

What this changes

Adds bounded canonical transcript replay for context engines and restores inter-session provenance at the final model boundary.

Example: A completion followed by a 2,190,526-byte image moves two historical users outside the hydration window.

  • Before: Reconstruction loses historical runtime carriers and changes previously sent provider content.
  • After: The supplied Gateway trace restores both users and both carriers while preserving six preceding provider content blocks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The updated shipped-entry-point evidence clears the previous proof blocker, and source review found no definite defect; overall readiness remains limited by the public SDK decision and partial scope.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Supplied exact-head terminal output exercises the built isolated Gateway through chat.send and agent completion with the actual companion LCM consumer and a real local HTTP/SSE transport, restoring two users and both carriers outside hydration while preserving six preceding provider content blocks; synthetic responses establish content continuity rather than vendor cache hits and resolve the previous proof request.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial
User problem: Retained history can lose canonical runtime context and inter-session presentation when older messages leave hydration, changing previously sent conversation content.
Reason: The reconstruction repair has demonstrated value and a concrete companion consumer; the broader linked reports remain open and the new public SDK surface needs the decision recorded above.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open: this PR addresses a concrete history-reconstruction gap still present on main, and no definite introduced correctness defect was found.

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

Decision needed

  • Question: Should the public context-engine transcript SDK expose canonical user messages and attached carriers through this bounded replay-group contract?
  • Recommendation: Approve the bounded public reader: Accept the documented identity, carrier, admission, and byte-budget contract on the existing transcript subpath.
  • Why: The companion consumer demonstrates a concrete need, but accepting these public return types and limits creates a supported SDK commitment without recorded owner approval.

Before merge

None.

Findings

None.

Agent review details

How this fits together

Context engines select retained conversation history; the host transcript owner supplies canonical messages and carriers, which the final model boundary projects into provider requests.

flowchart LR
  A[Canonical transcript] --> B[Existing history owner]
  B --> C[Bounded replay reader]
  C --> D[Context engine assembly]
  D --> E[Final model projection]
  E --> F[Provider request]
Loading

Technical review

Best possible solution:

Keep canonical replay under the existing transcript owner and reuse the established provenance renderer after context-engine assembly.

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

Current main exposes no canonical replay-group reader and annotates provenance before reconstruction; supplied red/green and Gateway observations support the reported path, while this read-only review ran no code.

Is this the best way to solve the issue?

The implementation uses the existing storage and projection owners, with necessary durable and memory adapters and one shared provenance renderer; it does not resolve the broader hydration-policy requests.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit cadffe5 adds src/plugin-sdk/context-engine-transcript-runtime.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cadffe56b139; files: src/plugin-sdk/context-engine-transcript-runtime.ts)

PR surface

Source +384, Tests +473, Docs +36, Other +2. Total +895 across 27 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 20 436 52 +384
Tests 4 473 0 +473
Docs 2 37 1 +36
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 27 948 53 +895

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Public SDK additions 1 function and 2 types The existing context-engine transcript subpath gains a supported replay contract without removing existing exports.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: Addresses context loss and prefix-cache churn during retained-history reconstruction in long-running context-engine sessions.
  • merge-risk: 🚨 compatibility: Publishing canonical replay groups establishes a new third-party SDK contract whose shape needs owner acceptance.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

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

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-06T23:54:14.574Z sha f13368e :: needs real behavior proof before merge. :: none

Reviewed November 6, 2026, 7:29 PM ET / November 7, 2026, 00:29 UTC (Revision 2).

- Skip model and thinking metadata between retained users and their context carriers.
- Stop at background-result placements and all existing model-history boundaries.
- Cover durable and memory readers with oversized metadata and placement regressions.
@rabsef-bicrym

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated to f49e92e4d8151ff1d6a7a8078081934351c60691 with the requested exact-head Gateway + companion LCM proof and host regression red/green results in the PR body.

The combined test exposed an additional defect: thinking/model bookkeeping interrupted the canonical user/carrier group. Both storage readers now skip non-model bookkeeping while retaining background-result placement and other model-history boundaries. The focused reader tests pass (14 cases), and the isolated built Gateway restores both historical users and both carriers from outside hydration. The six preceding provider content blocks remain stable across completion -> image -> foreground chat. The image's own externalization, text-shorthand equivalence, synthetic-provider scope, and current validation gaps are explicitly separated from the older live cache-hit evidence.

Please reassess the proof blocker and the bookkeeping/placement boundaries. Public SDK acceptance remains a maintainer decision. No live Gateway or configuration was changed.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 7, 2026
@rabsef-bicrym
rabsef-bicrym marked this pull request as ready for review November 9, 2026 22:26
- Complete the repository transcript-reader mock and wrapper file inventory.
- Document provenance cast invariants and verified worker-only replay ownership.
- Tighten the moved assertion baseline and account for the three mock lines.
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 9, 2026
@jalehman

jalehman commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Review/repair update for 812bebeff078238708ee7d085cced36a74aa9c4b (adds one repair commit without rewriting the contributor's commits).

Independent Astra review of the original change found a P2: both replay readers could restore a prompt-update carrier that the canonical model projection had retired after a system-prefix restart, compaction, or reset. The repair shares the existing retirement predicate and applies it before replay hydration/byte accounting in the durable reader and before projection in memory. Runtime facts remain retained. The SDK docs and exact regression-line allocation are updated.

A fresh independent Astra review examined all eight repair files and their unchanged projection, admission, custody, and worker callers. No verified P0–P2 findings remained. The reviewed working diff SHA-256 was 4a42e52eb5dd9595cc6821078f31f33b762e6596b2ea2e72399c8dfa7aa92712; it is the committed repair. These are narrative independent reviews, not a claim of helper-owned machine attestation or a human GitHub approval.

Validation on the repaired source:

  • node scripts/run-vitest.mjs src/plugin-sdk/session-transcript-runtime-replay.test.ts src/config/sessions/session-transcript-memory-read.test.ts --maxWorkers=1: 20/20 passed, including all six retirement cases and oversized retired-payload omission, with completed worker-generation verification.
  • Canonical owner packages/agent-core/src/harness/session/session-context.test.ts: 16/16 passed with identical production source. That earlier combined invocation was not wholly green: a later memory reset fixture lacked its required reason; the final 20-test run includes the corrected fixture.
  • Affected test typegraphs, scoped lint, formatting, and diff checks passed. Core types succeeded per the implementing worker's terminal result; its empty log alone is not independent proof.
  • Local test-line ratchet reports an inherited five-line excess. The repair adds exactly 105 test lines and exactly 105 allocation credit; the global baseline is unchanged. No guard was relaxed. This is not a claim that the ratchet passed; exact-head hosted CI is still required and any failure will be investigated.
  • No new live-provider/Gateway roundtrip was run. Earlier contributor proof is not represented as our own live execution.

Public SDK disposition: the narrow, read-only replay-groups capability fits the existing transcript-runtime surface, uses existing projection/admission ownership, selects caller-retained identities under bounded hydration, and has the concrete lossless-claw companion consumer. I recommend retaining it on those merits under Josh's requested review/landing scope; this does not manufacture a separate named owner's approval or waive enforced review/security checks. The companion review found no P0–P2 issues, passes 2,161 JS tests plus types/build/TUI/package and native SDK probes, and remains unchanged pending host-first landing.

The earlier ClawSweeper no-findings comment covers its recorded older head, not this repair. Final landing remains subject to current-head feedback and applicable GitHub gates.

Parent follow-up on the same published head: core types were independently rerun to terminal exit 0. The final committed ratchet is 6,556,380 LF versus ceiling 6,556,375 (five over). Direct immutable-Git-blob measurement at introduction base 9f9471128ace7cff27cecfbad387a3129ef7daac is 6,555,799 LF versus ceiling 6,555,794 (the same five over). The net 581 test lines have exactly 581 allocation credit; no unrelated tests or baseline were altered. Current-head hosted CI is attached at https://github.com/openclaw/openclaw/actions/runs/42795456139 and remains pending, not passed.

CI attribution follow-up for unchanged 812bebeff078: run 42795456139, attempt 1, is failed, not green. Both root failures are inherited from its exact base 802bc3c61b562f3c45a73b780ee740e10d51bf11; inspected synthetic checkout 73ccc5481c2fd3a267d45b662f05b9fa35fc0c15 has that base and this PR head as ordered parents.

  • check-docs / job129760403952: formatting rejects three untouched files: test/scripts/full-release-receipt-recovery.test.ts, test/scripts/plugin-npm-cli-process.test.ts, test/scripts/plugin-npm-cli-recovery.test-support.mjs. Their base/merge blobs are identical; parent reproduced exactly these three formatting failures on the exact base, exit1.
  • checks-node-changed-compact-large-31 / job129760404575: two Anthropic prefix tests lose the15byte cache_control system-key on request2turn1. Independent exact-base and exact-merge archives both reproduce these two failures with identical location/key/leaf hash, while both OpenAI controls pass. Node24.22.1 and checkout-pinned Bun1.4.4-canary.1+191755ec1 were used. Serializer/test/assertion blobs match. Opening-only checkpoint behavior originates in base commit e95289326a7907f6ce926afbb4e81a03bbedef98 (fix(anthropic): reuse shared system prompt across sessions #196471), not this PR.
  • openclaw/ci-gate / job129773230876 fails downstream of these roots. All other CI jobs passed or skipped. No unrelated repair, CI rerun, dependency change, or test relaxation was made.
    Under Josh’s existing scoped landing instruction and the repository’s attributed-pre-existing-failure policy, proceeding only through native evidence-qualified recovery; enforced reviews/security remain required and are not waived. No claim of current-head CI success.

@jalehman
jalehman enabled auto-merge (squash) November 10, 2026 10:01
@jalehman
jalehman disabled auto-merge November 10, 2026 10:37
@jalehman
jalehman merged commit a10341b into openclaw:main Nov 10, 2026
142 of 148 checks passed
@jalehman

Copy link
Copy Markdown
Contributor

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…aw#194362)

* fix: Preserve canonical context through history reconstruction

- Expose bounded active-branch replay groups through the context-engine SDK.

- Carry admission and snapshot ownership through worker and memory readers.

- Render persisted inter-session provenance at the final model boundary.

- Cover canonical replay, branch admission, byte budgets, and stable provider prefixes.

* fix: preserve replay carriers across transcript bookkeeping

- Skip model and thinking metadata between retained users and their context carriers.
- Stop at background-result placements and all existing model-history boundaries.
- Cover durable and memory readers with oversized metadata and placement regressions.

* fix: complete canonical replay CI integration

- Complete the repository transcript-reader mock and wrapper file inventory.
- Document provenance cast invariants and verified worker-only replay ownership.
- Tighten the moved assertion baseline and account for the three mock lines.

* fix: exclude retired prompt overrides from canonical replay

---------

Co-authored-by: jalehman <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Nov 13, 2026
Refresh the complete v2026.11.3..09aa644
history: 99 in-range PRs, 35 issues, and direct-commit editorial coverage.
Preserve all 62 prior contribution records and original main PR credits.
Include typed Telegram callbacks, worker-heartbeat lease renewal, and the
narrow large-store startup adaptations without claiming post-ready recovery.

Source product: 09aa644
Source tree: f10a88c
Main metadata: 3577724
Notes tooling: 514a224

Release provenance: 3768440 -> openclaw#194840, openclaw#179219, openclaw#196984, openclaw#196337
Release provenance: 00275d2 -> openclaw#194362
Release provenance: 66f0339 -> openclaw#186998
Release provenance: 915956a -> openclaw#186998

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[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 docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants