Skip to content

fix: deliver images sent during a Claude CLI turn instead of queueing them - #204160

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/mensagem-com-imagem-presa-na-fila-do-claude-cli-500223
Nov 24, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/mensagem-com-imagem-presa-na-fila-do-claude-cli-500223

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When someone sends an image while local Claude CLI is working, the composer shows “Queued” until the turn ends. On a long turn that can take more than ten minutes, even though a text message sent at the same time can reach Claude at its next step.

User Impact

Claude can see an image before it finishes the current turn. If an installed before_agent_run hook needs to inspect new input, the image still waits for the next turn. The hook sees it before Claude does. Other runtimes that do not support image steering keep their existing queue behavior.

Why This Change Was Made

The plugin CLI input path previously supported text only. Claude CLI accepts native image blocks on its existing stream, so it can read the pixels rather than a note containing a file path. Plugins explicitly opt in with acceptsImages. The shared CLI adapter loads images with the same scoped roots and limits as the first prompt, sends them in order, and records the message only after the native runtime acknowledges it. An image-only message does not add an empty text block.

The existing admission check decides whether to steer or queue. A sink without image support, a permissions mismatch, or an installed run-policy hook keeps the input on the normal followup path. Node-placed Claude CLI sessions are unchanged. This PR does not change the “Queued” label or add a protocol field to explain why an input is waiting.

Evidence

Two isolated Gateways ran the actual Control UI and Claude CLI 2.1.311 on the tree published as 3416af6467dc. Each received one synthetic two-color PNG while Claude was using a timer tool:

Scenario What happened
No run-policy hook Claude identified blue and yellow before its next tool call. The answer appeared about 13 seconds after upload and before the original turn ended. The composer never showed “Queued.”
Run-policy hook installed The composer showed “Queued.” After the original turn ended, the hook inspected one PNG and Claude identified red and green on the next turn.

Both runs recorded one image-bearing model input and one durable user message with the attachment. Reloading the chat showed it once, with no input left pending. In the original baseline run, the image waited about 36 seconds for the turn to finish.

  • The installed-hook regression failed on the incoming PR head and passed on the corrected tree. The unsupported-sink and native [text, image] / [image] cases also passed.
  • 131 affected tests and 16 prompt-prefix tests passed, along with targeted type checking, type-aware lint, formatting, and SDK export sync. Runtime builds passed on the candidate and its main ancestor; the paired Control UI budget check found no new violation. No budget was raised.
  • Local autoreview (Codex) covered 712ae0338512..d04213c7e22b at P0–P2 and reported no actionable findings. The published commit has the identical tree (a101ae30db96). The two live trials cover local Claude CLI, not third-party runtimes.

@clawsweeper

clawsweeper Bot commented Nov 23, 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 agents Agent runtime and tooling extensions: anthropic size: S labels Nov 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 23, 2026
@clawsweeper

clawsweeper Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets image messages reach an active local Claude CLI turn through an opt-in plugin capability.

Example: Send a magenta PNG while Claude CLI is running three sequential sleep commands.

  • Before: The image waits in the queue until the active turn ends.
  • After: Claude receives native image blocks during the active run and can answer COLOR: magenta before finishing the original work.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and source-consistent, but the detailed live-run account lacks inspectable execution evidence.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: An image sent during a long Claude CLI turn waits in the queue while comparable text can reach the active agent.
Reason: This adds a previously unsupported capability with clear user value, and the maintainer-authored PR supplies direction for the narrow optional SDK extension.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR adds useful image steering through existing owners, and inspection found no definite introduced code defect.

Priority: P2
Reviewed head: 7154324630bb415a77eee096cdef6290508ac7ff

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a redacted Control UI recording or Gateway/native transcript output showing the image consumed before the original turn ends, with one persisted image message and no pending input.
Agent review details

How this fits together

The session controller admits steering input, the shared CLI adapter hydrates its images and retains transcript custody, and the Anthropic plugin writes native stream-JSON messages to Claude Code.

flowchart LR
  A[Incoming image message] --> B[Session controller admission]
  B --> C[Shared CLI steering adapter]
  C --> D[Existing image loader]
  D --> E[Anthropic native transport]
  E --> F[Claude Code active turn]
  F --> G[Acceptance and transcript recording]
Loading

Technical review

Best possible solution:

Extend the existing CLI input sink with optional image support, reuse shared hydration, and preserve native acceptance and transcript ownership.

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

Yes: current-main admission rejects image steering without the CLI capability, matching the documented text-only contract and the author's reported Gateway reproduction; this review executed no target code.

Is this the best way to solve the issue?

The patch is a focused extension of the existing owners, and the added tests cover distinct admission and native serialization failures without introducing another queue or persistence path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • CLI steering admission and native input changes intended behavior with a stated reason (5c3dcc5: Deliver compatible text to the running CLI process while retaining image fallback until native image steering is supported.)
  • Per-input origin, private context, and transcript settlement keeps the original intent (80cc38d: Keep each injected input's provenance and private context separate from the incumbent turn and preserve acceptance through settlement failures.)
  • Shared image hydration keeps the original intent (9474e55: Consume prepared images through existing structured media ownership instead of materializing duplicate attachments.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 5188f98 adds src/agents/cli-runner/execute-plugin.steered-transcript.ts:79 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5188f987cb59; files: src/agents/cli-runner/execute-plugin.steered-transcript.ts)
  • Kiran V K: Raw commit 5c3dcc5 adds extensions/anthropic/cli.runtime.ts:243 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5c3dcc52002d; files: extensions/anthropic/cli.runtime.ts)

PR surface

Source +68, Tests +72, Docs +3. Total +143 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 75 7 +68
Tests 3 73 1 +72
Docs 2 6 3 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 154 11 +143

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Optional SDK fields 2 Adds acceptsImages and queueMessage options.images; existing sinks retain their behavior without opting in.

Labels

Label changes:

  • add P2: Image messages can wait for a long active CLI turn, but eventual followup delivery remains available.
  • add merge-risk: 🚨 compatibility: The public CLI plugin contract gains optional image-steering fields; the maintainer-authored change preserves existing sinks and documents the opt-in behavior.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Image messages can wait for a long active CLI turn, but eventual followup delivery remains available.
  • merge-risk: 🚨 compatibility: The public CLI plugin contract gains optional image-steering fields; the maintainer-authored change preserves existing sinks and documents the opt-in behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed November 23, 2026, 12:20 PM ET / 17:20 UTC.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 24, 2026 05:59
@vyctorbrzezowski
vyctorbrzezowski merged commit ae8a103 into main Nov 24, 2026
287 of 299 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the openclaw/mensagem-com-imagem-presa-na-fila-do-claude-cli-500223 branch November 24, 2026 15:44
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
… them (openclaw#204160)

* fix(claude-cli): deliver images sent mid-turn into the running turn

* fix: check incoming Claude images when a run policy is installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: anthropic merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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