Skip to content

docs: correct overstated prompt-cache comments from #58036 #58037 #58038#60633

Merged
vincentkoc merged 7 commits into
openclaw:mainfrom
MonkeyLeeT:docs/fix-cache-pr-comments
Apr 5, 2026
Merged

docs: correct overstated prompt-cache comments from #58036 #58037 #58038#60633
vincentkoc merged 7 commits into
openclaw:mainfrom
MonkeyLeeT:docs/fix-cache-pr-comments

Conversation

@MonkeyLeeT

@MonkeyLeeT MonkeyLeeT commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Correct comments that overstated the prompt-cache benefits of #58036, #58037, and #58038. No behavior changes — only comments.

  • tool-result-context-guard.ts: "prefix stays intact" → "more of the prefix survives"; note the model-quality tradeoff (loses recent tool output instead of old).
  • pi-bundle-mcp-materialize.ts: add "usually stable but not guaranteed" context; note that collision suffixes are iteration-order-dependent and the sort cannot fix name collisions.
  • history-image-prune.ts: drop misleading "legacy sessions" framing (this runs on all sessions); replace overstated "byte-identical" cache claim with accurate "reduces churn" + note dependency on replay sanitizer idempotency; document that text-only turns consume the window; fix "user turns" → "user/toolResult turns".
  • attempt.ts: matching callsite comment update.

Test plan

  • Comment-only changes, no behavior change — pnpm check passes.

🤖 Generated with Claude Code

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Apr 4, 2026
@greptile-apps

greptile-apps Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a comment-only cleanup PR that corrects overstatements about prompt-cache benefits introduced in #58036, #58037, and #58038 across four files. No behavior is changed.

  • src/agents/pi-embedded-runner/tool-result-context-guard.ts: Two comments updated from "prefix stays intact" to "more of the cached prefix survives", with a new tradeoff note that the model loses recent tool output (not old) when compacting newest-first. The correction is accurate — older prefix bytes are preserved but the full prefix cannot be guaranteed intact.
  • src/agents/pi-bundle-mcp-materialize.ts: Adds a clarification that the post-loop name sort stabilizes tool ordering across turns but cannot retroactively fix collision suffixes, which are assigned during iteration (order-dependent) before the sort executes.
  • src/agents/pi-embedded-runner/run/history-image-prune.ts: JSDoc reframed from cache-first to legacy-cleanup-first motivation, with a correct addition that prompt-cache prefix stability is a secondary benefit that further depends on the replay sanitizer being idempotent.
  • src/agents/pi-embedded-runner/run/attempt.ts: Callsite comment mirrors the history-image-prune.ts reframing; appropriately brief without duplicating the idempotency caveat from the JSDoc.

Confidence Score: 5/5

Safe to merge — comment-only changes with no behavior impact and all corrections are factually accurate.

All four changed files receive comment-only edits. The technical claims in the revised comments are accurate: compacting newest-first preserves more (not all) of the cached prefix; sort order cannot retroactively fix iteration-order-dependent collision suffixes; and prefix stability has an additional dependency on replay-sanitizer idempotency. No logic, types, or tests are touched.

No files require special attention.

Reviews (1): Last reviewed commit: "docs: restore purpose context in MCP too..." | Re-trigger Greptile

@MonkeyLeeT
MonkeyLeeT force-pushed the docs/fix-cache-pr-comments branch from 951b236 to 9ea6254 Compare April 4, 2026 01:46
@MonkeyLeeT
MonkeyLeeT force-pushed the docs/fix-cache-pr-comments branch from 15ddf1e to 96d4076 Compare April 4, 2026 23:27
@vincentkoc
vincentkoc merged commit b474e09 into openclaw:main Apr 5, 2026
29 of 32 checks passed
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…enclaw#58037 openclaw#58038 (openclaw#60633)

* docs: correct overstated prompt-cache comments from openclaw#58036 openclaw#58037 openclaw#58038

* docs: restore purpose context in MCP tool sort comment

* docs: drop misleading 'legacy' framing from image-prune comments

* docs: restore useful context stripped from image-prune comments

* docs: restore 'deterministically' in MCP tool sort comment

* docs: restore 'idempotent' at attempt.ts callsite

* docs: restore 'provider prompt cache' in context-guard comment
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…enclaw#58037 openclaw#58038 (openclaw#60633)

* docs: correct overstated prompt-cache comments from openclaw#58036 openclaw#58037 openclaw#58038

* docs: restore purpose context in MCP tool sort comment

* docs: drop misleading 'legacy' framing from image-prune comments

* docs: restore useful context stripped from image-prune comments

* docs: restore 'deterministically' in MCP tool sort comment

* docs: restore 'idempotent' at attempt.ts callsite

* docs: restore 'provider prompt cache' in context-guard comment
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…enclaw#58037 openclaw#58038 (openclaw#60633)

* docs: correct overstated prompt-cache comments from openclaw#58036 openclaw#58037 openclaw#58038

* docs: restore purpose context in MCP tool sort comment

* docs: drop misleading 'legacy' framing from image-prune comments

* docs: restore useful context stripped from image-prune comments

* docs: restore 'deterministically' in MCP tool sort comment

* docs: restore 'idempotent' at attempt.ts callsite

* docs: restore 'provider prompt cache' in context-guard comment
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…enclaw#58037 openclaw#58038 (openclaw#60633)

* docs: correct overstated prompt-cache comments from openclaw#58036 openclaw#58037 openclaw#58038

* docs: restore purpose context in MCP tool sort comment

* docs: drop misleading 'legacy' framing from image-prune comments

* docs: restore useful context stripped from image-prune comments

* docs: restore 'deterministically' in MCP tool sort comment

* docs: restore 'idempotent' at attempt.ts callsite

* docs: restore 'provider prompt cache' in context-guard comment
@MonkeyLeeT
MonkeyLeeT deleted the docs/fix-cache-pr-comments branch June 4, 2026 06:19
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
…enclaw#58037 openclaw#58038 (openclaw#60633)

* docs: correct overstated prompt-cache comments from openclaw#58036 openclaw#58037 openclaw#58038

* docs: restore purpose context in MCP tool sort comment

* docs: drop misleading 'legacy' framing from image-prune comments

* docs: restore useful context stripped from image-prune comments

* docs: restore 'deterministically' in MCP tool sort comment

* docs: restore 'idempotent' at attempt.ts callsite

* docs: restore 'provider prompt cache' in context-guard comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants