Skip to content

fix(media): retry channel images a turn could not read - #183390

Merged
steipete merged 4 commits into
openclaw:mainfrom
masatohoshino:fix/image-hydration-retry
Oct 26, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
masatohoshino:fix/image-hydration-retry

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127968

What Problem This Solves

Fixes: a channel image skipped by the current turn's pre-read stays suppressed for the rest of the conversation, even when the prompt-image loader could read it.

User Impact

Newly recorded attachments remain available on later turns. Readable images can reach the model without a file-tool detour, and an unreadable active-turn image gets the existing resend notice. Historical suppression remains unchanged because old records do not distinguish failed reads from intentional skips.

Why This Change Was Made

Keep the temporary failure on the run's media carrier instead of persisting it as permanent suppression. One helper reconciles that run-only skip with recorded facts for prompt loading, cloud workers, and image-input detection. Pairing by source and occurrence preserves duplicate attachments and collected-turn order. Described images and managed staged copies retain their existing suppression rules.

A URL-less fact restaged for a remote media host can miss reconciliation and retry its read on that turn; a failed read remains visible. No new configuration or transcript schema.

Production +53/-11 (net +42); tests +162/-8 (net +154). The shared reconciliation owner serves three readers; removing it would duplicate matching policy. Shortened comments and reused current test helpers. Thanks to @masatohoshino for the repair and live reproduction.

Evidence

  • Independent base regression: both admission modes fail because the recorded duplicate-path attachment lacks its retryable offloaded slot. Red: 2 failed, 119 skipped; 51.50 seconds Vitest / 123.17 seconds including runner preparation.
  • Candidate: all 170 tests across reply preparation, queue collection, image replay, image references, plugin-harness preparation, and image-input detection pass. Four Vitest shards: 0.464 / 183.63 / 73.19 / 61.51 seconds; total runner wall 425.06 seconds. The large pre-existing reply file includes production admission and queued-authority contracts; new image tests take milliseconds and reuse its fixtures.
  • Targeted type-aware oxlint, oxfmt, and diff checks pass. The check-changed dry run expands to broad repository checks; PR CI owns those checks. Independent P0–P2 autoreview: no actionable findings.
  • Contributor live evidence at caa2698: isolated qa-channel Gateway, separate state/port, a real vision model, and a 10.19 MiB synthetic PNG with red/blue halves. With tools denied, base replies guessed the colors; fixed replies identified both colors on both turns with zero tool calls. Default-tool base needed view_image; fixed needed no tool. Before capture · After capture.
  • This lane did not repeat a live Gateway/model run because separate provider/runtime setup exceeded the cheap proof path. CLI, cloud-worker, and WebChat sandbox round trips were not live-tested; their shared contracts have targeted test coverage. Integrated with main f729278. Integrated type-aware oxlint, oxfmt, and diff checks pass. The focused integrated test command stopped before collection because the linked worktree worker build could not resolve quickjs-wasi from the shared installation; the earlier 170-test run covers the unchanged media patch. Exact-head PR CI supplies the integrated broad proof.

@clawsweeper

clawsweeper Bot commented Oct 25, 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 gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Keep failed channel-image reads retryable on later turns instead of permanently suppressing the attachments.

Example: Send a 10.19 MiB PNG with a red top half and blue bottom half, then ask about it again.

  • Before: The recorded attachment stays suppressed; the model guesses colors or needs view_image.
  • After: The isolated Gateway identifies both colors on both turns with zero tool calls.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused producer repair with inspected live channel proof and regressions for persistence, duplicate attachments, collection, and staging; exact-head CI remains in progress.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspected before/after terminal captures exercise channel reply preparation and replay through an isolated qa-channel Gateway with a real vision model: the fixed branch reads the synthetic red/blue image on both turns without tools, and transcript output excludes permanent suppression and the run-only flag; the production repair is unchanged at the reviewed merge head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An image skipped once can remain unavailable throughout the conversation after its source becomes readable.
Reason: Restores attachment recovery without new configuration, schema changes, or speculative repair of ambiguous historical records.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current-main image-loss bug while preserving intentional suppression and current-run skips; no actionable defects were found.

Priority: P1
Reviewed head: 49f5cc441f2b8cfea87f0be26440f6c458b88577

Before merge

None.

Findings

None.

Agent review details

How this fits together

Channel reply preparation records attachment facts and prepares run-specific media; embedded, plugin, CLI, and worker paths consume those facts to assemble model input.

flowchart TD
  A[Channel attachment] --> B[Reply preparation]
  B --> C[Canonical transcript facts]
  B --> D[Run-only read skips]
  C --> E[Shared image hydration]
  D --> E
  E --> F[Model input]
  C --> G[Later-turn replay]
  G --> E
Loading

Technical review

Best possible solution:

Preserve canonical attachment facts for replay and apply temporary read skips only through the existing run media carrier.

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

Current-main source establishes the durable suppression path, and the report plus inspected live captures demonstrate the two-turn failure; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch fixes the persistence producer and shares run-to-record reconciliation across affected readers while retaining described-image and staged-copy suppression.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Persisted unresolved-image suppression changes intended behavior with a stated reason (9594fe4: Retain readable members of partial batches while preventing unreadable companions from aborting downstream runners.)
  • Canonical media facts and intentional suppression keeps the original intent (f6818ae: Replace marker parsing with authoritative structured facts and preserve described-image suppression across projections.)
  • Recorder-aware image preparation keeps the original intent (5105688: Hydrate stored images from canonical recorder facts without losing active-turn input.)
  • Worker media preparation keeps the original intent (28e3232: Keep the Gateway authoritative for media while preparing ordered worker image input through shared hydration.)
  • Sandbox staged image ownership keeps the original intent (5c69645: Make staged offloaded images available to workspace tools without duplicate native image injection.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f6818ae adds src/media/media-facts.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6818ae5eabc; files: src/media/media-facts.ts)
  • SunnyShu: Raw commit 9594fe4 adds src/auto-reply/reply/get-reply-run-helpers.ts:101 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9594fe4623db; files: src/auto-reply/reply/get-reply-run-helpers.ts)

PR surface

Source +42, Tests +154. Total +196 across 12 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 6 53 11 +42
Tests 6 162 8 +154
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 215 19 +196

Review metrics

Metric Value Why it matters
Production versus test changes Production +53/-11; tests +162/-8 The shared reconciliation policy avoids three independent implementations; regression coverage checks persistence, collection, staging, and downstream image handling.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127968
Summary: This PR addresses the canonical persistent-image-suppression report and covers the collection gap documented by its earlier unmerged repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: A single attachment read failure currently removes the image from subsequent channel-agent turns.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-25T07:40:26.468Z sha 74e0e79 :: blocked before merge. :: [P1] Preserve staging-only suppression when reconciling recorded images
  • reviewed 2026-10-25T09:21:09.367Z sha caa2698 :: needs maintainer review before merge. :: none

Reviewed October 25, 2026, 8:24 PM ET / October 26, 2026, 00:24 UTC (Revision 3).

@masatohoshino

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 25, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 25, 2026
Keep transient image read failures on run media, preserve canonical replay facts, and reuse current media test fixtures.

Co-authored-by: Masato Hoshino <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@steipete
steipete merged commit 15a5706 into openclaw:main Oct 26, 2026
167 of 168 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Keep temporary channel-image read failures on the current run rather than persisting permanent hydration suppression. Reconcile run-only skips with recorded attachments through one shared source-and-occurrence matcher for prompt hydration, workers, and image-input detection.

Both admission-mode regressions fail on the base; 170 focused tests pass with the fix. Preserve intentional suppression and leave ambiguous historical records unchanged. Exact-head CI passes.

Co-authored-by: Masato Hoshino <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 26, 2026
Keep temporary channel-image read failures on the current run rather than persisting permanent hydration suppression. Reconcile run-only skips with recorded attachments through one shared source-and-occurrence matcher for prompt hydration, workers, and image-input detection.

Both admission-mode regressions fail on the base; 170 focused tests pass with the fix. Preserve intentional suppression and leave ambiguous historical records unchanged. Exact-head CI passes.

Co-authored-by: Masato Hoshino <[email protected]>

(cherry picked from commit 15a5706)

Release adaptation: baseline images.ts lacks applySandboxStagedImagePaths (#179301), so the recorded-fact suppression is applied directly to normalizeMediaFacts and the main-only staged-copy media-refs case is not ported. Baseline attempt-session-prepare still attaches persisted facts as runtime prompt facts, so those now go through applyRunHydrationSuppression with the attempt media to keep this run skipping the unreadable image. The collect-queue case is ported into the baseline enqueue/scheduleFollowupDrain test style.
RomneyDa added a commit that referenced this pull request Oct 26, 2026
…ed semantics

Bedrock Responses routing cases used the shared discovery cache key, so the
default-region case read a cached result. #179471 no longer fails updates on
an unavailable channel, #183703 no longer treats missing meta as clobber
evidence, #180174 downgrades a missing legacy OAuth dir to a warning, and
#180280 leaves untimed 429s without a cooldown; their stale expectations
are updated to match main. The #183390 media case is wrapped in the stable
harness shape, and the Codex ownership harness now reports the original
owner's thread as loaded until it exits, as the app server does.
tideclaw-bot added a commit that referenced this pull request Nov 4, 2026
Adapt 28 audited units to the release-native ownership model.
Preserve AgentsAPI/cron policy and actor-owned projection recovery.

Source provenance and original contributor credit:
#176852 342fea1 — yinx65588-boop <[email protected]>
#180853 50f795a — Peter Steinberger <[email protected]>
#184041 e356196 — Peter Steinberger <[email protected]>
#184069 7739767 — Peter Steinberger <[email protected]>
#182666 9ff9d88 — Stefan Stüben <[email protected]>
#183884 112667f — Peter Steinberger <[email protected]>
#184021 05010ed — Peter Steinberger <[email protected]>
#183390 15a5706 — Masato Hoshino <[email protected]>
#183282 24d7dd3 — pstarkgit <[email protected]>
#164843 127f3c2 — PollyBot13 <[email protected]>
#172959 30f88d3 — main object unavailable; stable source inspected
#172959 eb2255b — johan-eilertsen <[email protected]>
#120943 1a76be1 — Peter Steinberger <[email protected]>
#178271 b3c8f8a — Wang Rui <[email protected]>
#178271 7bd6895 — RJ <[email protected]>
#177518 679980c — Masato Hoshino <[email protected]>
#182454 a538efe — Peter Steinberger <[email protected]>
#180042 bef193c — sunlit-deng <[email protected]>
#179347 2405bf4 — Peter Steinberger <[email protected]>
#179060 ccedbdc — Peter Steinberger <[email protected]>
#118011 9596527 — Peter Steinberger <[email protected]>
#182219 fade14f — Sukhdeep <[email protected]>
#181871 b1b5f00 — Peter Steinberger <[email protected]>
#178888 5125e3c — RoboClaw <[email protected]>
#180075 c9c2d16 — Wang Rui <[email protected]>
#181081 f223f77 — Jason O'Neal <[email protected]>
#180236 d11c239 — Dallin Romney <[email protected]>
#173921 af50fbd — Peter Steinberger <[email protected]>
#174868 7034ca4 — Peter Steinberger <[email protected]>
#172724 492c932 — Dallin Romney <[email protected]>

Proof: targeted owner/sibling tests, supported fresh two-pass review clean.
Known qualification gaps recorded in the release backport evidence.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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.

Inbound channel image is dropped for the rest of the session after a single failed attachment read

2 participants