Skip to content

improve(agents): explain unknown tool outcomes and assert append-only request history - #163379

Merged
steipete merged 5 commits into
mainfrom
steipete/tool-outcome-text-history-assert
Oct 2, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/tool-outcome-text-history-assert

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

An interrupted tool call can look like an ordinary failure even when its operation already had side effects, and rewritten request history can silently invalidate prompt-cache reuse.

User Impact

Unrecorded tool results now tell the model that the outcome is unknown, to retry only read-only or idempotent operations, and to verify state before repeating operations with side effects. Responses-family APIs retain aborted. Undeclared history edits warn once per session key; OPENCLAW_PROMPT_CACHE_ASSERT=1 makes them fail immediately during development and testing.

Why This Change Was Made

One shared constant owns the recovery guidance. Model-context hydration and projection preserve the existing synthetic marker, so a late real result still replaces a placeholder while opaque tool details stay out of model context. Existing persisted rows, storage format, and synthetic-result detection remain unchanged.

The observer compares ordered fingerprints of converted messages between requests. Per-block memos check primitive keys and values before reuse; nested block values and message envelopes are checked on every observation. This detects in-place edits under both reused messages and rebuilt wrappers while avoiding repeated hashing of large unchanged text or image data. String-content hashes live with the bounded history baseline. Compaction, new pruning rounds, runtime-carrier removal/movement, and image cleanup declare their changes at their existing owners; replaying an unchanged projection does not repeatedly waive the assertion. Model, transport, and retention changes restart history comparison. Tool schemas now use the cycle-safe serializer with an identity memo, so each schema object is hashed once rather than traversed on every request. In a synthetic benchmark with 100 schemas over 500 calls, repeated collection decreased from 149.4 ms to 16.8 ms.

Production LOC is +122: +25 for guidance/provenance and +97 for history observation. Tests/support are +306, docs +7. The obsolete assertion-baseline row is removed separately (one configuration line). The non-test-source count includes four lines of UI test configuration. The custom schema walker and redundant transport/tracker code were removed; the remaining growth preserves late-result replacement and handles legitimate history changes. Further reductions would require broader transcript-normalization changes or removing tested legacy behavior, so the neutral target was not forced through unrelated cleanup.

Evidence

The wrapper extraction repair in 9f821ed19729 changes only scripts/pr-lib/wrapper-components.txt (+1 inventory entry; production/test LOC unchanged). The shared-text files remain packages/llm-core/src/types.ts, packages/agent-core/src/harness/session/tool-result-pairing.ts, and the narrow source alias in ui/vitest.config.ts.

The inventory now includes packages/llm-core/src/types.ts because main commit 93625aa3d10d brought tool-result-pairing.ts into the extracted wrapper graph, making its shared-text import a required source dependency.

Current proof: eager-import closure 17/17, Bun UI headline 25/25, session transcript repair 58/58, and prompt-cache observability 42/42 pass; core/package/UI typechecks, scoped lint, formatting, and diff checks pass. The two Gateway roster failures remain classified as inherited, reproduced on clean main 6046d4fcb687, and are handled by a separate main-side repair.

The earlier import, fixture, and baseline repairs remain folded into the two topic commits:

  • The shared notice now lives in the lightweight @openclaw/llm-core/types module. UI Vitest resolves that leaf directly to source, avoiding generated AI-package artifacts. The headline test passes all 25 cases under Node and under Bun with ui/vitest.config.ts; resolver traces confirm the source path.
  • The skills-policy failure reproduced locally in the same four cases. The real Agent requires and initializes convertToLlm; its shared test fixture now supplies the real converter with the matching required type. All five skills-policy cases and the session-boundary tests pass.
  • The stale two-assertion baseline entry is removed. All five requested ratchets were checked, and over-cap test growth was removed through shared environment capture and coverage-preserving fixture/assertion consolidation. OPENCLAW_PROMPT_CACHE_ASSERT adds one OPENCLAW_* name: 472 against budget 471. The environment budget remains unchanged; a bump is pending owner approval. This is advisory under GitHub Actions, where the max-lines check passes with a warning; strict local budget execution exits 1.

The mutation follow-up adds 46 production lines and six regression cases. Both reported text-mutation cases and nested argument mutation failed on the old code before the fix. All four requested suites now pass (98 tests, 106.78 s combined wrapper wall), along with touched type lanes, lint, formatting, and the line-cap ratchet. Fresh autoreview is scoped-clean at P2 and above. The earlier full build predates these follow-ups; it was not repeated for the fingerprint-only repair.

  • Earlier proof: all 12 changed non-live test files passed, plus 10 owner/sibling files. The registered Gateway regression caught and verified the synthetic-marker preservation fix; the real conversion-boundary test covers transient and append-only tool loops under the assertion flag.
  • The two-turn tool-loop test covers stable messages and rebuilt wrappers sharing content. Across three requests, six messages require 26 hashing-helper calls: six primitive/string block hashes, twelve message-envelope/digest-list hashes, two nested-argument hashes, and six system/tool hashes. Unchanged 1 MB text blocks and string content are each hashed once over three observations; additions, changes, removals, and nested mutations invalidate reuse.
  • Core, package-test, and source-test typechecks passed; changed TypeScript files pass lint; formatting and git diff --check pass.
  • Earlier full build: passed (14m 16.1s). Subsequent corrections were checked with the focused tests, typechecks, and lint described above.
  • Autoreview: scoped-clean at P2 and above on the staged mutation-aware candidate. Earlier review also verified declaration fanout across cache affinities and isolation between session keys.
  • The live cache file collected with its explicit live config; all 15 cases were skipped. No live provider calls or CI reruns/dispatches were performed. No tool descriptions or prompt sections changed, so prompt snapshots were not regenerated (snapshot delta: 0).
Commands and per-file cost

Each table entry ran through node scripts/run-vitest.mjs <file> --maxWorkers=1, using a task-local TMPDIR. Wall times include runner setup; two independent one-worker runners used separate filesystem module caches. Follow-up owner runs passed after the fixture and projection-owner fixes.

File Measured wall time
packages/ai/src/providers/google-interactions-shared.convert.test.ts 8.24 s
packages/ai/src/transports/openai-responses-compaction-replay.test.ts 8.47 s
src/agents/embedded-agent-runner/prompt-cache-observability.test.ts 5.34 s (42 cases; final grouped Vitest duration 1.69 s)
src/agents/embedded-agent-runner/run/attempt-prompt-submit.test.ts 57.99 s
src/agents/embedded-agent-runner/run/attempt-session-boundary.test.ts 75.68 s
src/agents/embedded-agent-runner/run/attempt.llm-boundary.cache-stability.test.ts 28.82 s
src/agents/embedded-agent-runner/run/attempt.test.ts 30.73 s
src/agents/session-transcript-repair.test.ts 4.14 s
src/agents/embedded-agent-runner/run/attempt.skills-policy.test.ts 47.94 s
src/agents/transport-message-transform.test.ts 4.04 s
src/agents/sessions/session-manager-model-context.test.ts 55.25 s
src/gateway/server-methods/chat-send-synthetic-repair.integration.test.ts 63.7 s

Additional owner/sibling targets: packages/agent-core/src/harness/session/session-context.test.ts, packages/ai/src/transcript-transform.import-boundary.test.ts, src/agents/transport-message-transform.async.test.ts, src/agents/embedded-agent-runner/run/attempt.llm-boundary.test.ts, src/agents/embedded-agent-runner/run/history-image-prune.test.ts, src/agents/embedded-agent-runner/run/attempt-execution-phase.test.ts, src/agents/embedded-agent-runner/run.compaction-runtime.test.ts, src/agents/embedded-agent-runner/compact.delegate.test.ts, src/agents/embedded-agent-runner/compact.delegate-resources.test.ts, and src/agents/embedded-agent-runner/tool-result-truncation.cache-ttl.test.ts.

node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
node scripts/run-tsgo-core-test-shards.mjs packages
node scripts/run-tsgo-core-test-shards.mjs src
node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json '["src/agents/embedded-agent-runner/run/attempt-prompt-submit.test-support.ts"]'
# run-oxlint and oxfmt received the changed file list
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <changed-ts-files>
node_modules/.bin/oxfmt --write <changed-files>
git diff --check
pnpm build
OPENCLAW_LIVE_TEST=0 OPENCLAW_LIVE_CACHE_TEST=0 node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts src/agents/embedded-agent-runner.cache.live.test.ts --maxWorkers=1

CI has not yet run the new mutation cases. On the prior head, parent-fork passed all 17 CI cases before a suite teardown admission failure; it also passed 17/17 on three standalone local runs (111.62 s cold, 40.91 s, 30.69 s wrapper walls). That raw-snapshot path does not enter the changed model hydration. Recent main lifecycle work includes 57e0aaa1c190 and 54885d54a038; neither is claimed to fix the observed race. The ACP case timed out at 120,446 ms and left 18 skills watchers open; its owner and test were unchanged, with no test edits in the preceding 48 hours and no established fingerprint link. Both shard failures are classified unrelated and unresolved, not fixed by local replay. The initial end-to-end failure was fixed at synthetic provenance hydration/projection. A subsequent fixture failure was fixed by supplying its required real converter. The ordinary test router excludes live files; explicit live-config collection succeeded.

Current follow-up proof (all pass):

node scripts/run-vitest.mjs src/agents/embedded-agent-runner/prompt-cache-observability.test.ts src/agents/embedded-agent-runner/run/attempt.llm-boundary.cache-stability.test.ts src/agents/embedded-agent-runner/run/attempt-session-boundary.test.ts src/config/sessions/session-accessor.parent-fork.test.ts --maxWorkers=1
# Also ran parent-fork alone three times with --maxWorkers=1.
node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json '["src/agents/embedded-agent-runner/prompt-cache-observability.test.ts"]'
pnpm check:line-cap-ratchet --base origin/main

@clawsweeper

clawsweeper Bot commented Oct 2, 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 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 8:30 AM ET / 12:30 UTC (Revision 6).

ClawSweeper review

What this changes

The PR adds safer guidance for unrecorded tool results, preserves repair provenance during replay, and detects unexpected request-history edits with warnings and an optional strict assertion.

Merge readiness

✅ Ready for maintainer review

This remains useful work: current main lacks the central changes, the earlier mutation finding is resolved, and no new blocking defect was found.

Priority: P2
Reviewed head: 28c8abf9c450a6d4edead449b002d23f9491abcb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused work with relevant live-provider evidence, resolved prior feedback, and no remaining actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Captured direct-Anthropic runs exercise the embedded runner's request observer with strict assertions across tool and image followups, reporting successful append-only behavior. Later fingerprint repairs have focused failing-before/passing-after regression evidence. The storage changes are query-time projections, with no stored-data contract change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Captured direct-Anthropic runs exercise the embedded runner's request observer with strict assertions across tool and image followups, reporting successful append-only behavior. Later fingerprint repairs have focused failing-before/passing-after regression evidence. The storage changes are query-time projections, with no stored-data contract change.
Evidence reviewed 9 items Current-main necessity: Fetched main still uses the old missing-result notice and tracks system/tool fingerprints without comparing request-message history.
Prior finding resolved: Primitive keys and values are checked before block-hash reuse; nested values and message envelopes are serialized on every observation. Regression cases cover reused wrappers, shared content arrays, nested arguments, and property additions/removals.
Re-review continuity: Comparison with the previous completed review shows no change to the observer or shared guidance; the wrapper inventory now includes the required lightweight types module. Main-carried inventory changes were not attributed to this PR.
Findings None None.
Security None None.

How this fits together

The embedded agent runner converts session transcripts into model requests. Transcript repair fills missing tool results, while cache observation checks whether successive requests preserve their earlier conversation prefix.

flowchart TD
  A[Session transcript] --> B[Tool result repair]
  B --> C[Model context projection]
  C --> D[Request history check]
  E[Declared compaction and pruning] --> D
  D --> F[Provider request]
  D --> G[Warning or optional assertion]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +122, Tests +306, Docs +7, Other 0. Total +435 across 41 files.

View PR surface stats
Area Files Added Removed Net
Source 22 421 299 +122
Tests 15 531 225 +306
Docs 2 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 2 1 1 0
Total 41 961 526 +435

Review metrics

Metric Value Why it matters
Production versus test growth production/configuration +122; tests/support +306 The PR explains the production growth as recovery-provenance preservation and mutation-aware history observation.
New diagnostic setting 1 opt-in environment variable OPENCLAW_PROMPT_CACHE_ASSERT enables strict development assertions while normal execution retains warning behavior.

Technical review

Best possible solution:

Keep recovery guidance conservative and let the existing transcript owners distinguish intentional history rewrites from accidental edits.

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

Not applicable as a diagnostic feature review; source inspection confirms the earlier mutation defect is covered by focused regressions, and no runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes. Shared recovery text and observation at the converted-request boundary keep the behavior with its existing owners while preserving legacy transcript recognition.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded recovery-safety and cache-diagnostics improvement without evidence of an urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Captured direct-Anthropic runs exercise the embedded runner's request observer with strict assertions across tool and image followups, reporting successful append-only behavior. Later fingerprint repairs have focused failing-before/passing-after regression evidence. The storage changes are query-time projections, with no stored-data contract change.
  • proof: sufficient: Contributor real behavior proof is sufficient. Captured direct-Anthropic runs exercise the embedded runner's request observer with strict assertions across tool and image followups, reporting successful append-only behavior. Later fingerprint repairs have focused failing-before/passing-after regression evidence. The storage changes are query-time projections, with no stored-data contract change.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vito Cappello: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-10-02T08:09:01.490Z sha c5e329a :: needs changes before merge. :: [P2] Invalidate fingerprints when reused message content changes
  • reviewed 2026-10-02T08:17:50.493Z sha c5e329a :: needs changes before merge. :: [P2] Invalidate fingerprints when reused message content changes
  • reviewed 2026-10-02T08:57:29.252Z sha 5d5aa0449f0bbe2a77619b80c57a9408f1c2376d :: needs changes before merge. :: [P2] Invalidate fingerprints when reused message content changes
  • reviewed 2026-10-02T09:23:50.020Z sha e902736 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T11:50:08.909Z sha 6628074 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review October 2, 2026 08:10
@steipete
steipete force-pushed the steipete/tool-outcome-text-history-assert branch from c5e329a to 5d5aa04 Compare October 2, 2026 08:50
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 2, 2026
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Live Anthropic proof for the append-only history assertion (direct API key, OPENCLAW_PROMPT_CACHE_ASSERT=1, src/agents/embedded-agent-runner.cache.live.test.ts -t anthropic, run twice against this branch):

  • Passed with the assertion armed: warmup/stable-prefix reuse, tool-call followup turns, image-heavy followup turns, retention-disabled. No historyRewrite event was recorded in either run, so the real tool-loop and image flows are append-only as submitted.
  • Four later cases failed on prepared model runtime publication (workspace plugins; agent main) timed out before any model request. The first of them fails identically on an unmodified main checkout on the same host (load average 47-65 during the runs), so this is host load, not a change in this PR.

Note on the ratchet warning: OPENCLAW_PROMPT_CACHE_ASSERT adds one OPENCLAW_* name (472 against the 471 budget). The budget file was left untouched pending owner approval; the check is warn-only.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 2, 2026
Use shared unknown-outcome guidance while preserving the Responses-family aborted convention. Retain synthetic provenance in model context so late real results can replace repair placeholders without changing existing detection or stored transcript rows.
Track converted message prefixes and record declared compaction, pruning, runtime-context, and image rewrites. Notify every cache-affinity baseline for the same session identity. Memoize message/content and schema fingerprints, with strict assertions enabled only by an opt-in environment flag.
@steipete
steipete force-pushed the steipete/tool-outcome-text-history-assert branch from 5d5aa04 to e902736 Compare October 2, 2026 09:17
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the stale fingerprint finding in e902736d1e2753c596014a24610d402f2f953022. Message/content identity shortcuts are gone. Each content block memo now checks every primitive property and its key set before reusing its hash; nested values and message envelopes are serialized again on each observation. String-content hashes are retained only with the bounded history baseline. Provider-owned schema declarations keep their identity memo.

prompt-cache-observability.test.ts covers both reported mutation cases: rebuilt wrapper=false mutates text under the same message, and rebuilt wrapper=true mutates text in the shared content array before rebuilding its wrapper. Both now throw under OPENCLAW_PROMPT_CACHE_ASSERT=1 and record historyRewrite at message 1 (assistant). Nested tool-call arguments and primitive-property additions/removals also have regressions. The mutation tests failed on the old code before the fix. All 42 observability cases pass. Unchanged 1 MB text and string content are hashed once across three observations; the two-turn tool-loop fixture makes 26 total hashing-helper calls, with large primitive values hashed only when new or changed.

The requested observability, cache-stability, session-boundary, and parent-fork suites pass 98/98 in total. Touched production/test type lanes, lint, formatting, and the line-cap ratchet pass. Fresh autoreview is scoped-clean at P2 and above.

For CI run 36986346080 on the preceding head 5d5aa0449f0b:

  • large-5: unrelated SQLite lifecycle/ordering failure. All 17 parent-fork cases passed in CI; the suite then failed during lifecycle retirement with closed execution admission (the group had 305/305 passing cases). The file also passed three local standalone runs, 17/17 each. Its SessionManager.open() path loads raw transcript snapshots and does not invoke the changed withTranscriptContextSnapshot model hydration. Fork token estimation has no synthetic tool-result fixtures to enter the changed marker branch. Recent main history includes 57e0aaa1c190 (worker-draining teardown), a85b58c6afbd (native fork preservation), and 54885d54a038 (admission handling after recoverable contention). These were already ancestors of this PR; they are context, not a claimed fix for the unidentified teardown race.
  • large-24: unrelated ACP test timeout/watcher cleanup failure. The case timed out at 120,446 ms and teardown found 18 live skills watchers. No ACP or watcher owner changed here, no historyRewrite failure appeared, and no edits to that test occurred on main in the preceding 48 hours. Native side questions do traverse the shared embedded runtime, but the available log establishes no causal link to this PR and does not identify the blocked phase. Recent independent watcher work includes 777421df553c, 7570c6d0d952, and e20a82057265.

History was checked with both the requested literal --since=48h and --since='48 hours ago'; the latter supplies the intended interval on this Git version. These CI failures remain recorded as unrelated and unresolved; the local passes are not presented as fixes for them. No CI reruns or dispatches were performed.

@clawsweeper clawsweeper Bot added 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
Include packages/llm-core/src/types.ts in the PR wrapper's extracted source inventory. Main commit 93625aa pulled tool-result-pairing.ts into that graph, so its existing shared tool-result text import must be included for standalone wrapper execution.
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 2, 2026
@steipete steipete self-assigned this Oct 2, 2026
@steipete
steipete merged commit cee0906 into main Oct 2, 2026
177 checks passed
@steipete
steipete deleted the steipete/tool-outcome-text-history-assert branch October 2, 2026 12:50
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 2, 2026
The system-update custom-type constant was counted as an environment variable name; rename it so the
budget only counts real names. Raise the budget to 477 for OPENCLAW_PROMPT_CACHE_ASSERT (#163379),
the owner-approved prompt-cache assertion switch.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
… request history (openclaw#163379)

* fix(agents): describe unrecorded tool results as unknown outcomes

Use shared unknown-outcome guidance while preserving the Responses-family aborted convention. Retain synthetic provenance in model context so late real results can replace repair placeholders without changing existing detection or stored transcript rows.

* improve(agents): assert provider request history stays append-only

Track converted message prefixes and record declared compaction, pruning, runtime-context, and image rewrites. Notify every cache-affinity baseline for the same session identity. Memoize message/content and schema fingerprints, with strict assertions enabled only by an opt-in environment flag.

* fix(agents): pin the shared tool-result text for the request wrapper

Include packages/llm-core/src/types.ts in the PR wrapper's extracted source inventory. Main commit a35612b pulled tool-result-pairing.ts into that graph, so its existing shared tool-result text import must be included for standalone wrapper execution.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
The system-update custom-type constant was counted as an environment variable name; rename it so the
budget only counts real names. Raise the budget to 477 for OPENCLAW_PROMPT_CACHE_ASSERT (openclaw#163379),
the owner-approved prompt-cache assertion switch.
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 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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