Repository navigation
Conversation
PER-564 Persist effective workspace snapshots through the existing session metadata owner. Keep ordinary turns and restarts stable, refresh at new-session/compaction boundaries, and isolate native history when workspace context scope changes. Default to every-turn refresh and reject unsupported harnesses explicitly.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR separates changing turn facts from reusable instructions and adds opt-in workspace snapshots that refresh at compaction. Example: AGENTS.md changes from FIRST_WORKSPACE to EDITED_WORKSPACE during a session with workspaceContextRefresh="compaction".
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this PR contains meaningful cache-efficiency work that current main does not supersede, with an unresolved freshness and plugin-contract decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherReply and command preparation assemble workspace instructions and current conversation facts; the agent runtime projects them into system instructions, private native context, and transcript-backed prompt state before model dispatch. flowchart TD
A[Incoming message or internal command] --> B[Conversation preparation]
C[Workspace files] --> D[Transcript snapshot owner]
B --> E[Agent prompt preparation]
D --> E
E --> F[Reusable system instructions]
E --> G[Current private context]
F --> H[Native or embedded runtime]
G --> H
Technical reviewBest possible solution: Reuse the existing private-context and transcript prompt owners, with turn-fact relocation as an independent stage and snapshots governed by an approved freshness and callback contract. Do we have a high-confidence way to reproduce the issue? Source shows refreshed workspace files and changing conversation guidance entering early Claude instructions; supplied traces support cache churn, but do not establish subscription savings or universal provider impact. Is this the best way to solve the issue? The turn-fact correction extends existing private-context ownership and preserves caller instructions; persisted snapshots are a separate freshness feature whose product contract should be decided independently. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 140dda0308c3. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1259, Tests +2535, Docs +57. Total +3851 across 75 files. Added test files: 6. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (6 earlier review cycles)
Reviewed October 17, 2026, 4:17 PM ET / 20:17 UTC (Revision 7). |
PER-564 Share durable raw workspace files across supported harnesses and refresh through the existing embedded prompt preparation owner. Preserve dynamic prompt guidance, native scope isolation and durable compaction recovery.
PER-564 Support native subscription login through the admitted transcript metadata owner while preserving unknown-history restrictions. Guard first-enable native continuity, reapply current file budgets, and prove profile isolation and revoked refresh at the managed transport. Refresh compaction diagnostics and prevent stale same-input replay.
|
Review repairs are in Reported defects
Stronger behavior proofThe fixture composes actual OpenClaw CLI preparation, native-login policy, profile/file selection, SQLite metadata and managed subprocess transport. Its native peer is deterministic and synthetic; it is not the Claude provider. Assertions inspect the bytes received by the subprocess:
Controlled replays of the old P1 writer requirement and old P2 saved-render behavior failed these regressions; repaired semantics pass. These are controlled old-semantics replays, not a claim that this new fixture ran unchanged on the pristine old revision. The mocked profile-forwarding-only test was removed. Existing native subscription compaction behavior is retained. The opt-in mode requires a regular turn to establish its snapshot before a first native control operation; it does not claim first-ever Scope and remaining gatesThe implementation supports managed local Claude and local embedded built-in compaction. Codex remains explicitly unsupported for this opt-in contract until first-post-compaction ordering is proven. Existing append-only prompt-series owners and current permissions, skills and job instructions are preserved. Maintainer approval of the opt-in policy/public callback remains outstanding. These deterministic production-boundary tests do not establish a complete shipped Gateway/provider automatic-compaction run or a real upgrade from v2026.10.4. No provider quota was consumed, and no cache/allowance-saving percentage is claimed. The PR remains a draft with those proof boundaries stated. Feedback repair proofThe regressions exercise real CLI preparation, admitted transcript metadata, retained raw file inputs, and the managed Claude transport talking to a synthetic Node subprocess. They make no provider calls.
Controlled old-semantics replays failed: reintroducing the prior absent-history-writer check rejects native login; reintroducing saved rendered-context reuse delivers LEGACY_UNBOUNDED at the subprocess. These were targeted temporary source-condition replays restored byte-for-byte, not pristine baseline checkout runs. Before the host reboot,90 distinct focused tests across8 files passed through scoped reruns; final affected suite was31/31, and maintained native declarations passed in116.3s. The14 approved source-file bytes were recovered unchanged (manifest40174180aa95c69d088f9cdff852fb67be6b2dd1901aa768e57a7cce2d758cdf). Temporary pre-reboot stdout logs were lost during reboot; this summary records reported results rather than claiming preserved terminal artifacts. Post-reboot runtime build and lint are PENDING while the sole maintained builder reads a cold external APFS disk image. Draft publication does not imply those checks passed. Limits: no real-provider/native automatic-compaction trace, shipped Gateway upgrade trace, or provider cache-savings measurement is claimed. Maintainer approval of the opt-in product policy remains an upstream decision. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Live deployment follow-up: snapshot mode in our exact older-version local port failed before the Claude call with Source tracing found an integration gap to verify: the real auto-reply CLI admission path does not establish the transcript-owner scope expected by the snapshot reader, while the existing synthetic preparation fixture explicitly supplies that scope. We are adding an actual entrypoint regression and preserving canonical writer/lifecycle admission, revocation and final-write checks. The pending generalization is not claimed to repair this outage yet. Fresh post-reboot native preparation fixture execution also timed out at120seconds (no assertion result); it is not passing current-head execution evidence. Runtime build passed, but final scoped lint and corrected entrypoint proof remain pending. We will update with reviewed source and durable results before requesting another review. No provider-quota or subscription-savings claim is made. |
|
@clawsweeper re-review Head Please review provenance, end-to-end forwarding, policy parity and simplicity. The description records the executed passes, unresolved native timeout/cleanup failures, repaired but unrerun fixtures, and incomplete changed-test type check. Exact-version local runtime/payload validation is ongoing; this is not a fully-green or deployment claim. Earlier compaction/upgrade and maintainer-policy gates remain open. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Added executed native-boundary and deployment evidence to the rewritten description. The exact older installed-version port passed official declarations/lint/runtime build, preservation/import audits, seven copied-installer cases and eleven actual host/native-transport behavior groups with a synthetic peer. Four ordinary/internal/completion/ordinary turns have identical host system bytes and actual native policy/settings argv except session selectors, with fresh private facts/account formats. Ownership/permission/compaction/cleanup controls pass. After independent exact-payload approval, that port is deployed: all24,935 original events across569 history sessions, main/native bindings, native transcript prefix, settings and schemas are preserved; gateway/WhatsApp health passed. Final result SHA256 This is explicitly older-port evidence, not a current-head upstream runtime-build/native-control pass or real Claude cache/allowance measurement. The upstream timeout/cleanup, upgrade continuity, shipped real-provider automatic-compaction and maintainer-contract gaps remain open. The description retains your recommendation to separate the automatic correction from the snapshot setting/public callback; no maintainer decision is claimed. |
|
🦞👀 Re-review progress:
|
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Closing due to inactivity. |
What Problem This Solves
OpenClaw can change an early instruction block when workspace Markdown files are edited or when an otherwise unchanged conversation moves between ordinary input, internal handoffs and completion turns. That can invalidate a large reusable prompt prefix. The reporting user experienced rapid Claude allowance depletion that made the PA feel practically unusable.
This is a cache-efficiency bug, with two distinct causes addressed here. Three observed resumed Claude calls recorded
system_changedand about 943,000 total cache-created input tokens despite identical retained workspace content. An offline regression also reproduced three system variants across four turns with unchanged intended authority/tools/workspace. Historical full system bodies were not retained, so the exact avoidable share cannot be reconstructed. Cache-token counts do not measure subscription allowance consumed or prove this alone exhausted it.Changes
Automatic correction: current turn facts leave reusable system instructions
Producers identify their exact generated routing, delivery, account-format and inbound-metadata contribution. On the existing eligible per-turn context path, preparation carries those current facts through that carrier—private turn context on native Claude—while enduring conditional rules stay authoritative system instructions.
For example, the current account/thread is turn context; authorization, privacy, progress/final delivery and reaction rules remain system policy. Exact producer-recorded offsets/components establish ownership. Missing or mismatched provenance preserves the original caller instructions; there is no heading matching or arbitrary text stripping. Required facts survive optional-context failure.
This correction applies automatically on the eligible path, independently of the workspace setting. It does not freeze the whole system prompt. Genuine owner, permissions, tools, plugin and caller instruction changes remain current and may legitimately invalidate a cache prefix. Ineligible paths retain existing behavior.
Opt-in workspace freshness cadence
"compaction": load current workspace files for a new session, retain their snapshot across ordinary turns/process restarts, and refresh at compaction before continuation."every-turn": immediate file refresh; remains the default. Per-agent overrides are supported.An agent's own edits and tool results are normally already in the conversation, so reloading the file into an earlier block can be redundant. External edits may not be: operators selecting compaction mode intentionally defer their visibility. Snapshots cover workspace-file input, not dynamic permissions/tools/skills. Saved raw files rerender under current privacy filters and injection budgets; scope changes cannot reuse another scope's private native context.
The implementation reuses existing session metadata and lifecycle ownership, without a new database schema or sidecar. The opt-in supports managed local Claude and embedded execution with built-in compaction; unsupported harnesses/remote snapshot paths/opaque compaction owners reject it explicitly. Codex support for this snapshot mode is not claimed. An optional public CLI workspace lifecycle callback is part of the proposed contract and needs maintainer approval.
General mechanism versus Claude integration
Changing an early prefix can affect any exact-prefix cache; OpenAI documents the same requirement. This is not established as a Claude Code cache defect.
OpenClaw's managed Claude transport receives rebuilt
appendSystemPromptwithsystemPromptSnapshot:false, exposing host prefix changes on resume. Codex's parent-local persona/skills/memory instructions also expose early-prefix changes, although its AGENTS snapshot differs. Embedded exposure depends on the final carrier: eligible native OpenAI Responses and direct Anthropic on this newer base already preserve prompt-series prefixes and append updates. Builder changes alone do not prove a changed outgoing prefix on every route. GPT cache loss, comparative allowance impact and universal provider coverage have not been measured.Evidence
Current PR head:
585915a9020e96a69e2110540f23977197db5111.2026.10.2/b8952d4plus existing local patches, not an executed runtime build of this newer PR head.2026.10.4package wrote isolated settings/history/binding state; normal Doctor migration24→28 passed. Feature-disabled reading timed out on the original attempt and one unchanged authorized retry. Activation, restart and compaction phases did not execute. This is migration proof only, not upgrade continuity.Executed compiled native-boundary proof on the older port
Actual ordinary reply producer/queue and public command producer/prepared-generation/attempt compose through actual admission, plugin loading and the unchanged Anthropic transport, with a synthetic stdio peer. Final run: exit0, eleven behavior groups.
Proof inputs/payload were unchanged before/after. Final result SHA256:
7fa6f83023807cfafa0be750607d736ae3751472e23d2c79848f5773aab2e74b. Exact reviewed payload manifest SHA256:a1af6a27393d83a57fe76b411a81fec40ce00b7a84192923e6c45f54c733360c. Failed setup attempts remain retained; the earlier isolated default-CLI/login failure is not described as zero provider activity.This proves host system bytes, launch policy, host resume selection/history and transport lifecycle with a synthetic peer. It does not prove Claude consumes that native history, full native built-in prompt stability, live provider cache reuse, actual reply delivery or subscription savings. Raw
reuse-with-driftlabels can remain despite stable rendered system bytes.Local deployment
The exact older-version port is deployed after cooperative drain, fresh backups and independent final payload approval. Twelve existing runtime files plus one pure source-owned chunk changed. All 24,935 original events across569 history sessions, including13,162 main events, original session windows, main/native bindings, native transcript prefix, settings and schemas are preserved. All55 runtime/preservation fingerprints and609 dependency hashes match. Gateway health passed; WhatsApp is running/connected/healthy, with no plugin errors. Existing main-only compaction mode is unchanged. No live model or WhatsApp test message was generated for deployment. Rollback must retain the compatible raw-snapshot reader and must not restore old history.
Before merge
The PR remains a draft. The current review has no code findings, but requires: