fix(images): skip CLI image cache refs#87501
Conversation
|
Codex review: passed. Reviewed May 28, 2026, 12:35 AM ET / 04:35 UTC. Summary PR surface: Source +13, Tests +45. Total +58 across 3 files. Reproducibility: yes. Current main source shows cache-path prompt text flows from Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the scoped detector/test fix after required merge gates, while keeping the separate group-chat selective-reply policy work tracked on #86687. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows cache-path prompt text flows from Is this the best way to solve the issue? Yes for the sticky-image half. Skipping the internal CLI cache directories in the shared detector is a narrow fix with direct parser/helper coverage; the group-chat selective-reply half remains a separate maintainer/product decision. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 771ddcf1846f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +13, Tests +45. Total +58 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
ClawSweeper PR egg: ✨ hatched 💎 rare Cosmic Proofling. Rarity: 💎 rare. Trait: guards the happy path. DetailsShare on X: post this hatch
About:
|
|
@clawsweeper visualize |
|
🦞👀 I queued a read-only visual pass. It will create or update one marker-backed visual brief comment and will not trigger close, merge, repair, label, or branch changes. Lens: |
|
Source: #87501 (comment) Visual briefRequested lens: state PR: #87501 Legend: ✅ expected/proven; ❌ broken/dropped path; Maintainer rulingBenefit: Stops OpenClaw-written CLI image cache paths from being re-detected as fresh user image references on later turns, while preserving ordinary image-path detection. Risk: Path-part filtering may also ignore a user-authored image path if it intentionally lives inside a directory named Proof needed: Maintainer/CI confirmation on the submitted branch, plus any desired review that the directory-name filter is the right product boundary. Recommended next action: Maintainer review of the narrow image-cache filter and its tests. Question presented: Is skipping any path segment named |
|
@clawsweeper auto merge |
|
🦞🔧 Source: I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix. Automerge progress:
|
|
@clawsweeper automerge |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
ClawSweeper 🐠 reef update Thanks for the contribution. The source branch was not safely writable by ClawSweeper, so it opened a replacement PR and kept the credit trail visible. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against c166f8b. |
Fixes the sticky-image reattachment portion of #86687.
Summary
.openclaw-cli-imagesandopenclaw-cli-imagespaths during prompt image-reference detection.openclaw-cli-imagesprompt text is not reloaded throughloadImageFromRefScope note
This intentionally does not change the group-chat selective-reply policy. The issue review marks that half as needing a maintainer/product decision, while the sticky-image loop has a narrow source-proven fix.
Real behavior proof
Behavior or issue addressed: Prior OpenClaw-written CLI image cache paths in prompt history should not be detected or loaded as fresh user image references on later turns.
Real environment tested: Local OpenClaw checkout at
/Users/andy/openclaw/openclaw-86687, branchfix/skip-cli-image-cache-86687, dependencies installed withpnpm install --frozen-lockfile.Exact steps or command run after this patch: Ran
pnpm exec tsx -e ...against the realdetectImageReferencesandloadPromptRefImageshelpers using prior prompt text containing/workspace/.openclaw-cli-images/stale.png, then ran ClawSweeper's requested surrounding test suite.Evidence after fix:
{ "refs": [ { "raw": "/workspace/current.png", "type": "path", "resolved": "/workspace/current.png" } ], "cacheOnlyLoadCount": 0, "cachePathDetected": false }Additional command output:
node scripts/run-vitest.mjs src/agents/cli-runner.helpers.test.ts src/agents/embedded-agent-runner/run/images.test.ts src/auto-reply/reply/groups.test.ts src/config/silent-reply.test.ts --reporter dot-> 6 test files passed, 132 tests passed.Observed result after fix: The stale
.openclaw-cli-imagestranscript path was ignored,loadPromptRefImagesreturned zero images for a cache-only prompt, and an unrelated normal image path remained detectable.What was not tested: I did not run a live Discord channel replay; the fix is scoped to the shared prompt image-reference detector used by the CLI image reload path.
Author attribution
If this PR is squash-merged or reworked, please preserve author attribution for
Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>or include:Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>