Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 22, 2026, 1:10 AM ET / 05:10 UTC. ClawSweeper reviewWhat this changesThis PR stops one-turn image-read failures from marking durable channel-transcript media as permanently suppressed, while retaining prompt-only suppression for the current embedded run. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessThe direct-path repair is sound, but queued collect-mode turns replace the recorder and lose the new transient suppression indexes, so an unresolved image can still be rehydrated during the same collected prompt. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherChannel replies persist inbound media for session replay, while the embedded runner reads that record to build the current model prompt. This patch separates a transient attachment-read failure from durable media state reused by later turns. flowchart LR
A[Inbound channel image] --> B[Reply image resolution]
B --> C[Durable transcript media]
B --> D[Prompt-only suppression]
C --> E[Embedded prompt assembly]
D --> E
E --> F[Model request]
Decision needed
Why: Clearing stored suppression blindly could rehydrate images intentionally suppressed because they were already described or are not image payloads. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +80. Total +89 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Propagate prompt-only suppression indexes through collected transcript recorders with durable-media offsets, while keeping persisted media clean; handle existing ambiguous records only under an explicit upgrade decision. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows collect mode synthesizes a new recorder without the ephemeral indexes that the embedded prompt consumer requires; a two-item collect regression can reproduce the failure. Is this the best way to solve the issue? No. The direct recorder boundary is appropriate, but the same transient state must survive the queue collector that replaces that recorder before prompt assembly. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 80beef6ff736. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
…anscript A turn-time failure to read an inbound image was written into the durable user-turn record as hydrationSuppressed, so every later turn skipped the image and the resend notice never fired. Persist the media facts as they arrived and keep the turn-local suppression on the run-scoped prompt media only.
…lugin harnesses Plugin-owned harness preparation hydrates the current turn from the persisted user-turn record. Carry the unresolved fact indexes on the transcript recorder as a prompt-only view so that path still skips the unreadable attachment without the flag reaching the durable transcript.
2295878 to
664cb71
Compare
|
Closing this PR. The defect is real and still reproduces on current main 259352aaf27, so I have filed it as a standalone bug report with the same before/after runtime proof: #127968. Why close rather than keep iterating: the review is right that removing the persistence mapping here is not sufficient on its own. Queued collect-mode turns replace the transcript recorder and lose the run-scoped unresolved indexes, so an unresolved image can still be rehydrated inside the same collected prompt. Threading the turn-local verdict through recorder replacement means this fix does not live at this call site; the ownership of turn-scoped media suppression belongs with the recorder and prompt-assembly boundary, and picking that shape is a maintainer decision rather than something to keep patching from here. The branch is left in place if anyone wants to pick it up. Happy to reopen or resubmit against whatever boundary the maintainers prefer. |
Summary
When a channel turn carries an inbound image and the turn-time attachment read fails once (the 1 second read budget or the 10 MiB cap in
agent-turn-attachments, a transient EACCES/ENOENT while staging finishes, or any throw from the attachment runtime), the reply executor writeshydrationSuppressed: trueinto the durable user-turn transcript record for that image. Every later turn of the session replays that record, so the image is never loaded again even when the file is readable, and the loader no longer even counts it as a failed attachment, so nothing ever reports the loss. The photo silently disappears from the conversation for good.This keeps the turn-local suppression exactly where it belongs (the run-scoped prompt media that
suppressUnresolvedPromptMediaalready produces) and stops copying the one-turn verdict into the durable record.Root cause
src/auto-reply/reply/get-reply-run-execute.ts(introduced by #122361):unresolvedSourceIndexesis a turn-scoped result ofresolveCurrentTurnImages; it reports that the fast pre-resolver could not read the bytes during this turn.hydrationSuppressedon a persisted media fact, however, is read by every later replay (images.tsskips the fact andimages.media-refs.tsreturnshydrate: false), andbuildPersistedMediaImageLayoutcopies the flag into the persisted layout'ssuppressedFactIndexes. The persisted record therefore turns "unreadable right now" into "never hydrate". The sibling call on the next lines,suppressUnresolvedPromptMedia, applies the same flag to the run-scoped prompt media copy, which is the correct, turn-local place.Fix
The persisted facts and the persisted image layout now describe the attachment as it arrived. The unresolved image keeps an
offloadedlayout slot, so later turns hydrate it again from disk. The run-scopedpromptMediaForRunandpromptMediaImageLayoutstill carry the turn-local suppression, unchanged.Why this is the right boundary
src/gateway/agent-turn/agent-run-user-turn.tspersists image facts and layout slots without any suppression, and the embedded runner hydrates from that record on the current turn. Channel turns now persist the same shape.hydrationSuppressed(media-note.tsfor images already described as text,chat-attachments.tsfor non-image MIME) records a property that is genuinely permanent and is untouched.Related: #122361 introduced the persisted mapping while fixing the all-or-nothing drop; #122101 (open) tracks the current-turn symptom of partial resolution and does not cover the durable record. No other issue or PR describes the later-turn loss.
Verification
node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run.media-only.test.ts: 124 passed (new casekeeps unresolved current-turn images hydratable in the persisted transcript).hydrationSuppressed: truereceived in the persisted media) and passes with this patch.node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run-helpers.media-facts.test.ts src/auto-reply/reply/current-turn-images.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/agents/embedded-agent-runner/run/run-attempt-dispatch.media.test.ts: 4 files, 69 passed.oxfmt --checkandoxlint -c .oxlintrc.jsonon both changed files: clean.node scripts/run-tsgo.mjs -p tsconfig.core.jsonclean (exit 0).Real behavior proof
Behavior addressed: A one-turn failure to read an inbound photo was written into the durable transcript as
hydrationSuppressed: true, so the photo was never sent to the model on any later turn of the session.Real environment tested: Real
getReplyFromConfigchannel turns (WhatsApp-shaped inbound context with an image attachment), real on-disk config, session store and transcript under an isolated OPENCLAW_HOME, real embedded agent run againstscripts/e2e/mock-openai-server.mjson loopback as the only stand-in (provider HTTP boundary); run on pristine origin/main d40cbfe and on this patch with identical inputs. Turn 1 runs while the photo is chmod 000; the file is restored before turn 2.Exact steps or command run after this patch:
OPENCLAW_DISABLE_BUNDLED_PLUGINS=1 node --import tsx proof-hydration.mtsfrom the patched tree (driver source below), then the same driver from a pristineorigin/maincheckout.Evidence after fix:
Observed result after fix: The durable user-turn record no longer carries
hydrationSuppressed, its layout keeps anoffloadedslot for the photo, and the second turn's provider request contains the photo as an image part (image parts=1) where pristine main sends none (image parts=0) and has stampedhydrationSuppressed: trueplussuppressedFactIndexes: [0]into the record.What was not tested: No live third-party channel or vision provider; the plugin harness and CLI runner paths were exercised only by their existing suites, not live. The "could not be loaded" notice did not appear in either run of this loopback setup, so this patch is not claimed to change that notice.
proof-hydration.mts (driver source)