Repository navigation
fix(agents): honor imageMaxDimensionPx at the provider and CLI image handoffs - #205663
Conversation
…handoffs - The provider streaming handoff and the shared CLI image loader now pass the configured agents.defaults.imageMaxDimensionPx, resolved like the other prompt-image callers. - Unset config still resolves to the 1200 px default, so default requests are unchanged. Fixes #205642
…ndoffs - Provider handoff: a 1600 px image under imageMaxDimensionPx 2400 reaches the provider unchanged (dropped on base). - CLI loader: the same image reaches the CLI file unchanged (re-encoded at 1200 px on base).
- Use a typed provider runtime handle and literal model input/role types instead of a cast.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs maintainer review before merge. What this changesThe PR passes the existing configured image dimension limit through provider materialization and initial, prehook, and steered CLI image hydration. Example: Send an 854×1280 JPEG with agents.defaults.imageMaxDimensionPx set to 2400.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused repair to a current-main image configuration bug; no introduced correctness or security defects were found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherAgent image preparation turns attachment facts and inline images into provider request blocks or CLI image files, using shared sanitization and replay decisions. flowchart TD
A[Attachments and image facts] --> B[Canonical image preparation]
C[Run configuration] --> B
C --> D[Provider materialization]
C --> E[Shared CLI image loader]
B --> D
B --> E
D --> F[Provider request]
E --> G[Initial or steered CLI input]
Technical reviewBest possible solution: Land the narrow dimension-propagation repair while leaving compression-policy changes for separate consideration. Do we have a high-confidence way to reproduce the issue? Current-main source shows both missing limits and the resulting default sanitization; the contributor also supplies before/after Gateway and CLI captures, but this read-only review executed no target code. Is this the best way to solve the issue? Using the existing resolver and shared CLI loader is the smallest complete repair for dimension propagation; because the linked issue also requests a separate compression change, use Related rather than an automatic closing reference. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c7824fb4d2b0. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +9, Tests +109. Total +118 across 8 files. Added test files: 1. View PR surface stats
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 25, 2026, 8:28 PM ET / November 26, 2026, 01:28 UTC. |
|
Merged in ef21b58. Thanks @solarwinds95 for the precise report and log analysis in #205642. The provider handoff and the CLI runtime now use the configured |
…irement-rule * origin/main: (172 commits) test(gateway): expect a revoked person's Goal retry to be hidden as not found (#205698) fix: keep browser disabled when only hardening relay authentication (#203137) fix: recover Linux stream automations after command-anchor crashes (#203149) fix(whatsapp): identify voice-note captions as text in delivery receipts (#205381) fix(test): unblock restart-auth plugin and worker publication qualification (#205679) chore(ui): refresh control ui locales (#205691) fix: reduce memory during SQLite usage refresh (#201064) fix(plugins): readmit native captures with a dangling host link chore(i18n): refresh native locales (#205680) fix(update): hash SQLite lock bytes as zeros so Windows exclusion cannot fail verification (#205668) fix(skill-workshop): skip the skill diet for skills with Markdown outside support directories (#204881) fix(plugins): clarify dated SDK migration notices (#200932) fix: keep the resident launcher when reinstalling Gateway (#205655) fix: show the whole reply when you reopen a TUI session (#200455) test(ui): wait for restored speech player authorization (#199502) feat: let agents post approved GitHub comments (#204301) fix(agents): honor imageMaxDimensionPx at the provider and CLI image handoffs (#205663) chore(ui): refresh control ui locales (#205664) fix(google): preserve playback when Google Live splits audio into parts (#205364) fix: show named characters in exported session messages (#205362) ...
…handoffs (openclaw#205663) Root cause: src/agents/embedded-agent-runner/run/attempt-stream-settle.ts:504 calls `materializeProviderContext` without the configured `agents.defaults.imageMaxDimensionPx`, and src/agents/cli-runner/helpers.ts:338 (`loadCliPromptImages`) hydrates CLI images without it, so both re-sanitize at the 1200 px default while the canonical hydration already uses the configured value. Fixes openclaw#205642 Thanks @solarwinds95 for the detailed report, the config timeline and the bundle trace that pointed straight at both handoffs. ## What changed - Provider handoff: passes `resolveImageSanitizationLimits(attempt.config).maxDimensionPx`, the same resolution `attempt-setup.ts`, `prompt-image-preparation.ts` and the worker/harness callers use. `materializeProviderContext` now accepts `maxDimensionPx` (it still omits `maxBytes`). - CLI: `loadCliPromptImages` takes the run config and resolves the dimension itself, so the prehook loader, the initial payload and steered input all get it from one place. - Nothing else: no change to compression policy, quality steps, the 5 MB provider / 6 MB CLI byte caps, or defaults. With `imageMaxDimensionPx` unset the resolver returns nothing and both paths keep 1200 px. ## What users see With `imageMaxDimensionPx: 2400` on main, the provider path re-sanitized every image at 1200 px. Those bytes no longer matched the image hashes pinned by the canonical hydration (which used 2400), so the provider request dropped the images and sent "3 image attachments could not be loaded" instead. After the fix the provider gets the canonical images: images up to 2400 px are sent unchanged, larger ones are resized to 2400, and the follow-up turn replays the same bytes. The CLI path now honors the setting too. Re-encode note: the reporter's two JPEGs (854x1280, 1000x1280) grew because they were re-encoded at 1200 px. With a configured limit at or above 1280 they are now sent byte-identical, so that case goes away for this configuration. The same re-encode at the default 1200 px (the "larger than source" sanitizer behavior) is unchanged and out of scope here. ## Evidence Built Gateway in a secretless node:24.22.1 container, a local OpenAI-compatible stand-in that records the decoded size and hash of every image it receives, and a CLI-backend stand-in plugin that records the image files it is handed. One chat turn with JPEGs 854x1280, 1000x1280 and 3000x2000, then a text follow-up. Proof comment: openclaw#205663 (comment) | run | config | provider/CLI receives (turn 1 and replay) | resize log on handoff | |---|---|---|---| | main x2 | 2400 | 0 images + "3 image attachments could not be loaded" | maxDimensionPx=1200 maxBytes=5242880 | | fix x2 | 2400 | 854x1280 and 1000x1280 source bytes, 3000 px -> 2400x1600; replay identical | only 3000x2000 -> 2400 (canonical) | | main / fix | unset | identical bytes on both (801x1200, 938x1200, 1200x800, same sha256) | 1200 | | CLI main | 2400 | 801x1200, 938x1200, 1200x800 | maxDimensionPx=1200 maxBytes=6291456 | | CLI fix | 2400 | 854x1280, 1000x1280 source bytes, 2400x1600 | 2400 | There is no `imageMaxBytes` setting (`config validate` rejects `agents.defaults.imageMaxBytes`), so the byte caps stay the existing constants. Tests: `attempt-stream-settle.image-limits.test.ts` (provider handoff, image dropped on main) and a case in `cli-runner.helpers.test.ts` (CLI file re-encoded at 1200 px on main). Both fail on main and pass here. Deltas against main: production +10 / -1, tests +104 / -0. Co-authored-by: Ayaan Zaidi <[email protected]>
…handoffs (#205663) Root cause: src/agents/embedded-agent-runner/run/attempt-stream-settle.ts:504 calls `materializeProviderContext` without the configured `agents.defaults.imageMaxDimensionPx`, and src/agents/cli-runner/helpers.ts:338 (`loadCliPromptImages`) hydrates CLI images without it, so both re-sanitize at the 1200 px default while the canonical hydration already uses the configured value. Fixes #205642 Thanks @solarwinds95 for the detailed report, the config timeline and the bundle trace that pointed straight at both handoffs. ## What changed - Provider handoff: passes `resolveImageSanitizationLimits(attempt.config).maxDimensionPx`, the same resolution `attempt-setup.ts`, `prompt-image-preparation.ts` and the worker/harness callers use. `materializeProviderContext` now accepts `maxDimensionPx` (it still omits `maxBytes`). - CLI: `loadCliPromptImages` takes the run config and resolves the dimension itself, so the prehook loader, the initial payload and steered input all get it from one place. - Nothing else: no change to compression policy, quality steps, the 5 MB provider / 6 MB CLI byte caps, or defaults. With `imageMaxDimensionPx` unset the resolver returns nothing and both paths keep 1200 px. ## What users see With `imageMaxDimensionPx: 2400` on main, the provider path re-sanitized every image at 1200 px. Those bytes no longer matched the image hashes pinned by the canonical hydration (which used 2400), so the provider request dropped the images and sent "3 image attachments could not be loaded" instead. After the fix the provider gets the canonical images: images up to 2400 px are sent unchanged, larger ones are resized to 2400, and the follow-up turn replays the same bytes. The CLI path now honors the setting too. Re-encode note: the reporter's two JPEGs (854x1280, 1000x1280) grew because they were re-encoded at 1200 px. With a configured limit at or above 1280 they are now sent byte-identical, so that case goes away for this configuration. The same re-encode at the default 1200 px (the "larger than source" sanitizer behavior) is unchanged and out of scope here. ## Evidence Built Gateway in a secretless node:24.22.1 container, a local OpenAI-compatible stand-in that records the decoded size and hash of every image it receives, and a CLI-backend stand-in plugin that records the image files it is handed. One chat turn with JPEGs 854x1280, 1000x1280 and 3000x2000, then a text follow-up. Proof comment: #205663 (comment) | run | config | provider/CLI receives (turn 1 and replay) | resize log on handoff | |---|---|---|---| | main x2 | 2400 | 0 images + "3 image attachments could not be loaded" | maxDimensionPx=1200 maxBytes=5242880 | | fix x2 | 2400 | 854x1280 and 1000x1280 source bytes, 3000 px -> 2400x1600; replay identical | only 3000x2000 -> 2400 (canonical) | | main / fix | unset | identical bytes on both (801x1200, 938x1200, 1200x800, same sha256) | 1200 | | CLI main | 2400 | 801x1200, 938x1200, 1200x800 | maxDimensionPx=1200 maxBytes=6291456 | | CLI fix | 2400 | 854x1280, 1000x1280 source bytes, 2400x1600 | 2400 | There is no `imageMaxBytes` setting (`config validate` rejects `agents.defaults.imageMaxBytes`), so the byte caps stay the existing constants. Tests: `attempt-stream-settle.image-limits.test.ts` (provider handoff, image dropped on main) and a case in `cli-runner.helpers.test.ts` (CLI file re-encoded at 1200 px on main). Both fail on main and pass here. Deltas against main: production +10 / -1, tests +104 / -0. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit ef21b58) Backport adaptation: Kept the release steered-transcript code unchanged because steered-image hydration from ae8a103 is not shipped here. Applied configured limits to the existing ordinary CLI and embedded provider handoffs. Co-authored-by: RomneyDa <[email protected]>
…handoffs (#205663) Root cause: src/agents/embedded-agent-runner/run/attempt-stream-settle.ts:504 calls `materializeProviderContext` without the configured `agents.defaults.imageMaxDimensionPx`, and src/agents/cli-runner/helpers.ts:338 (`loadCliPromptImages`) hydrates CLI images without it, so both re-sanitize at the 1200 px default while the canonical hydration already uses the configured value. Fixes #205642 Thanks @solarwinds95 for the detailed report, the config timeline and the bundle trace that pointed straight at both handoffs. - Provider handoff: passes `resolveImageSanitizationLimits(attempt.config).maxDimensionPx`, the same resolution `attempt-setup.ts`, `prompt-image-preparation.ts` and the worker/harness callers use. `materializeProviderContext` now accepts `maxDimensionPx` (it still omits `maxBytes`). - CLI: `loadCliPromptImages` takes the run config and resolves the dimension itself, so the prehook loader, the initial payload and steered input all get it from one place. - Nothing else: no change to compression policy, quality steps, the 5 MB provider / 6 MB CLI byte caps, or defaults. With `imageMaxDimensionPx` unset the resolver returns nothing and both paths keep 1200 px. With `imageMaxDimensionPx: 2400` on main, the provider path re-sanitized every image at 1200 px. Those bytes no longer matched the image hashes pinned by the canonical hydration (which used 2400), so the provider request dropped the images and sent "3 image attachments could not be loaded" instead. After the fix the provider gets the canonical images: images up to 2400 px are sent unchanged, larger ones are resized to 2400, and the follow-up turn replays the same bytes. The CLI path now honors the setting too. Re-encode note: the reporter's two JPEGs (854x1280, 1000x1280) grew because they were re-encoded at 1200 px. With a configured limit at or above 1280 they are now sent byte-identical, so that case goes away for this configuration. The same re-encode at the default 1200 px (the "larger than source" sanitizer behavior) is unchanged and out of scope here. Built Gateway in a secretless node:24.22.1 container, a local OpenAI-compatible stand-in that records the decoded size and hash of every image it receives, and a CLI-backend stand-in plugin that records the image files it is handed. One chat turn with JPEGs 854x1280, 1000x1280 and 3000x2000, then a text follow-up. Proof comment: #205663 (comment) | run | config | provider/CLI receives (turn 1 and replay) | resize log on handoff | |---|---|---|---| | main x2 | 2400 | 0 images + "3 image attachments could not be loaded" | maxDimensionPx=1200 maxBytes=5242880 | | fix x2 | 2400 | 854x1280 and 1000x1280 source bytes, 3000 px -> 2400x1600; replay identical | only 3000x2000 -> 2400 (canonical) | | main / fix | unset | identical bytes on both (801x1200, 938x1200, 1200x800, same sha256) | 1200 | | CLI main | 2400 | 801x1200, 938x1200, 1200x800 | maxDimensionPx=1200 maxBytes=6291456 | | CLI fix | 2400 | 854x1280, 1000x1280 source bytes, 2400x1600 | 2400 | There is no `imageMaxBytes` setting (`config validate` rejects `agents.defaults.imageMaxBytes`), so the byte caps stay the existing constants. Tests: `attempt-stream-settle.image-limits.test.ts` (provider handoff, image dropped on main) and a case in `cli-runner.helpers.test.ts` (CLI file re-encoded at 1200 px on main). Both fail on main and pass here. Deltas against main: production +10 / -1, tests +104 / -0. Co-authored-by: Ayaan Zaidi <[email protected]> Release adaptation: Thread the existing image dimension setting through the stable initial CLI loader, CLI payload fallback, and provider materializer without changing byte caps. Leave CLI steering unchanged because stable has no image hydration call there. Follow-ups: #207052 changes cached prompts for end-of-turn recovery; #206699 changes Claude cron login guidance. Neither fixes or is required by these image handoffs. (cherry picked from commit ef21b58) Co-authored-by: RomneyDa <[email protected]>
* fix: show Claude CLI document uploads only once in chat * fix: show Claude CLI document uploads only once in chat OpenClaw-Publication: 4555cb04-bff2-43b3-aff8-ec271d6567b2 * fix: keep Claude document uploads on the message that sent them * fix: preserve the released message queue result contract Release adaptation: Use an optional accepted-input observer instead of widening queueMessage's released Promise<void> contract. Reuse the stable steering and transcript-rewrite handlers; leave source admission, native image steering, config, and all SQLite schemas unchanged. The existing history index columns also carry exact document correlation. Keep the released model-hook test layout. Companion audit through be407a4: no later #203866 reference. PRs #208535 (Claude compacted fork summaries), #206158 (native subagent status), and #205663 (image dimensions) are separate. PRs #208252 (Codex source), #207022 (embedded prompt dispatch), #206969 (fallback), #205963 (Copilot question policy), and 50a7368 (snooze) do not own this path. SHA mentions in #204700 and #204685 are update/qualification records, not follow-ups. (cherry picked from commit 269f884) Co-authored-by: RomneyDa <[email protected]>
Root cause: src/agents/embedded-agent-runner/run/attempt-stream-settle.ts:504 calls
materializeProviderContextwithout the configuredagents.defaults.imageMaxDimensionPx, and src/agents/cli-runner/helpers.ts:338 (loadCliPromptImages) hydrates CLI images without it, so both re-sanitize at the 1200 px default while the canonical hydration already uses the configured value.Fixes #205642
Thanks @solarwinds95 for the detailed report, the config timeline and the bundle trace that pointed straight at both handoffs.
What changed
resolveImageSanitizationLimits(attempt.config).maxDimensionPx, the same resolutionattempt-setup.ts,prompt-image-preparation.tsand the worker/harness callers use.materializeProviderContextnow acceptsmaxDimensionPx(it still omitsmaxBytes).loadCliPromptImagestakes the run config and resolves the dimension itself, so the prehook loader, the initial payload and steered input all get it from one place.imageMaxDimensionPxunset the resolver returns nothing and both paths keep 1200 px.What users see
With
imageMaxDimensionPx: 2400on main, the provider path re-sanitized every image at 1200 px. Those bytes no longer matched the image hashes pinned by the canonical hydration (which used 2400), so the provider request dropped the images and sent "3 image attachments could not be loaded" instead. After the fix the provider gets the canonical images: images up to 2400 px are sent unchanged, larger ones are resized to 2400, and the follow-up turn replays the same bytes. The CLI path now honors the setting too.Re-encode note: the reporter's two JPEGs (854x1280, 1000x1280) grew because they were re-encoded at 1200 px. With a configured limit at or above 1280 they are now sent byte-identical, so that case goes away for this configuration. The same re-encode at the default 1200 px (the "larger than source" sanitizer behavior) is unchanged and out of scope here.
Evidence
Built Gateway in a secretless node:24.22.1 container, a local OpenAI-compatible stand-in that records the decoded size and hash of every image it receives, and a CLI-backend stand-in plugin that records the image files it is handed. One chat turn with JPEGs 854x1280, 1000x1280 and 3000x2000, then a text follow-up. Proof comment: #205663 (comment)
There is no
imageMaxBytessetting (config validaterejectsagents.defaults.imageMaxBytes), so the byte caps stay the existing constants.Tests:
attempt-stream-settle.image-limits.test.ts(provider handoff, image dropped on main) and a case incli-runner.helpers.test.ts(CLI file re-encoded at 1200 px on main). Both fail on main and pass here.Deltas against main: production +10 / -1, tests +104 / -0.