#[agents/tool-images] Image resized to fit limits
1 messages · Page 1 of 1 (latest)
That log line is coming from OpenClawâs image sanitization step (agents/tool-images). It fires whenever an image thatâs about to be included in a model request is over the limits (by default max side = 1200px and max bytes â 5MB), so OpenClaw recompresses/downscales it and logs:
Image resized to fit limits: ...
1) Reduce how often âImage resizedâŠâ happens
A) Make the source images smaller (best fix)
- If the images come from
nodes:camera_snap, setmaxWidth/qualityon the tool call so it produces smaller images up-front. - If theyâre screenshots/photos you upload, pre-scale them (or convert PNG â JPEG) before sending.
B) Raise the sanitization limit (if youâre okay with bigger images)
You can bump the threshold so fewer images trigger resizing:
openclaw config set agents.defaults.imageMaxDimensionPx 1600
# then restart gateway
openclaw gateway restart
Notes:
- Default is 1200.
- Going much above ~2000px can cause some providers to reject multi-image requests, so increase in small steps (1600 â 1800 â 2048) and see what your model/provider tolerates.
C) If you only care about log noise
Set your log level higher (this hides a lot of other info logs too):
openclaw config set logging.level warn
openclaw config set logging.consoleLevel warn
openclaw gateway restart
Docs: https://docs.openclaw.ai/logging
2) âIs the image resent turn after turn?â
Often, yes â if the image remains in the prompt/history, the gateway has to re-include it when constructing each new model request. OpenClaw already prunes some historical user-image blocks after theyâve been processed once, but tool-result images (e.g. camera snapshots returned as tool results) can stick around in history and get re-sent.
Practical workarounds today:
- After the agent has âseenâ the image and produced a text description, start a fresh session and continue from the description.
- If itâs a tool producing the image, adjust the workflow so the tool sends the image outward (as an attachment) and the model keeps only a text summary in the transcript.
If you paste one of the resize log lines including the { label: ... } field (e.g. prompt:images vs nodes:camera_snap), I can tell you exactly which path is causing the repeated re-send in your case.
I'm taking screenshots then pasting them into a webchat (control ui) based session. I did not find any prompt:images or nodes:camera_snap is the logs, but here's a full log line: 2026-03-07T20:38:59-07:00 clawd node[1798479]: 2026-03-08T03:38:59.681Z [agents/tool-images] Image resized to fit limits: 1791x825px 182.6KB -> 52.7KB (-71.1%). It's reducing the amount of turns an image is resent that I'm after.
That log line is exactly what happens when a pasted screenshot gets turned into an image block for the model and then sanitized:
- default limit is 1200px max side (
agents.defaults.imageMaxDimensionPx) - your screenshot is 1791Ă825, so it gets recompressed/downscaled and you see:
Image resized to fit limits: 1791x825px ...
Why it feels like itâs âresent every turnâ
In the Control UI path, OpenClaw can end up re-loading images from the transcript/prompt on subsequent turns (because the attachment is still represented in the conversation context). If that happens, youâll see the same resize message again on later turns, and yes â the model is effectively getting that image again.
Right now there isnât a config knob like âonly resend images for N turnsâ.
What you can do today
Option A (most reliable): treat images as one-shot
After the assistant has answered using the screenshot:
/newto start fresh (fast + guaranteed the image wonât be included again)
- or
/compactonce youâve got the useful text out of the image (keeps the session but summarizes older turns, which usually drops the heavy attachment markers)
Docs: https://docs.openclaw.ai/help/faq#how-do-i-start-a-fresh-conversation
Option B: reduce the pain (even if it still resends)
If you mostly just hate the resizing / quality loss, set the max dimension above your typical screenshot width so it wonât trigger for ~1800px images:
openclaw config set agents.defaults.imageMaxDimensionPx 1800
openclaw gateway restart
This does not stop resends, but it will stop the resize event for images up to that size.
Option C: confirm whether itâs coming from âprompt:imagesâ
If you tail JSON logs you can see the structured fields (the console/syslog line doesnât show them):
openclaw logs --follow --json
If you paste one JSON log entry for a resize event (itâll include fields like label, fileName, triggerOverDimensions, etc.), I can tell you definitively whether itâs being reloaded from prompt history vs coming from some tool result. If itâs the âreloaded from historyâ case, thatâs a good candidate for a GitHub issue/feature request (âonly load media refs from the most recent user turnâ or âprune media refs after first model passâ).
How about this one:
{"_TRANSPORT":"stdout","__MONOTONIC_TIMESTAMP":"1595854450675","_COMM":"openclaw-gatewa","_BOOT_ID":"xyz","MESSAGE":"2026-03-01T04:43:26.585Z [agents/tool-images] Image resized to fit limits: 1901x1131px 179.3KB -> 62.2KB (-65.3%)","_CAP_EFFECTIVE":"0","_SELINUX_CONTEXT":"unconfined\n","_UID":"1000","__REALTIME_TIMESTAMP":"1772340206585742","_SYSTEMD_UNIT":"user@1000.service","_SYSTEMD_USER_UNIT":"openclaw-gateway.service","_PID":"882653","_SYSTEMD_USER_SLICE":"app.slice","SYSLOG_FACILITY":"3","_HOSTNAME":"clawd","_SYSTEMD_CGROUP":"/user.slice/user-1000.slice/user@1000.service/app.slice/openclaw-gateway.service","_RUNTIME_SCOPE":"system","__SEQNUM":"1180654","PRIORITY":"6","SYSLOG_IDENTIFIER":"node","_SYSTEMD_OWNER_UID":"1000","_MACHINE_ID":"...94acb","_SYSTEMD_INVOCATION_ID":"...66c99d","__CURSOR":"s=d3c4c...08235f5b8120;i=1203ee;b=f5...4f46e85d;m=17390566ff3;t=64bef1c6f478e;x=2016b323106b4494","_EXE":"/usr/bin/node","_CMDLINE":"openclaw-gateway","_SYSTEMD_SLICE":"user-1000.slice","__SEQNUM_ID":"...235f5b8120","_STREAM_ID":"19b3a8e3a29...3bcd","_GID":"1000"}
Yep â that journald JSON blob is still just the console-formatted log line in MESSAGE, so it doesnât include the structured fields (label, fileName, triggerOverDimensions, etc.) that would tell us why itâs being loaded again.
First: this resize line alone doesnât prove âresent every turnâ
It only proves: at that timestamp, an image was present in the LLM request and exceeded the default 1200px limit.
To confirm re-sending, the key test is:
- Paste screenshot once, ask your question (youâll see the resize log).
- Next turn send text-only (âok thanks, now do Xâ).
- If you still see another
Image resized to fit limitslog on that text-only turn â the screenshot is being re-attached from history/prompt scanning.
How to get the details we need (with label)
Use OpenClawâs JSONL log stream (not journald):
openclaw logs --follow --json
Then paste the log event where subsystem is agents/tool-images. That entry will include a label like prompt:images, nodes:camera_snap, or read:/... and weâll know exactly what pipeline is reintroducing it.
If your goal is âdonât resend the screenshot after itâs been usedâ
Right now thereâs no config knob for âkeep images for N turnsâ.
Workarounds that actually stop repeats:
- After the screenshot is processed, do
/new(guaranteed). - Or do
/compactonce the assistant has described the screenshot in text (often drops old attachment refs from the prompt/history).
If you just want to stop the resize (your example is 1901px wide)
You can raise the dimension limit above your typical screenshot width:
openclaw config set agents.defaults.imageMaxDimensionPx 2048
openclaw gateway restart
That wonât change re-sending behavior, but it will stop the resize event for ~1900px screenshots.
If you run the âtext-only follow-upâ test above and paste the corresponding openclaw logs --follow --json entry, I can tell you whether itâs being pulled from prompt:images (prompt scanning of old â[media attached âŠ]â lines) vs. something else.
How about:
{"type":"log","time":"2026-03-07T20:15:12.772-07:00","level":"info","subsystem":"agents/tool-images","message":"{"subsystem":"agents/tool-images"} {"label":"session:history","sourceMimeType":"image/png","sourceWidth":1804,"sourceHeight":1145,"sourceBytes":262996,"maxBytes":5242880,"maxDimensionPx":1200,"triggerOverBytes":false,"triggerOverDimensions":true,"outputMimeType":"image/jpeg","outputBytes":61474,"outputQuality":85,"outputMaxSide":1200,"byteReductionPct":76.6} Image resized to fit limits: 1804x1145px 256.8KB -> 60.0KB (-76.6%)","raw":"{"0":"{\"subsystem\":\"agents/tool-images\"}","1":{"label":"session:history","sourceMimeType":"image/png","sourceWidth":1804,"sourceHeight":1145,"sourceBytes":262996,"maxBytes":5242880,"maxDimensionPx":1200,"triggerOverBytes":false,"triggerOverDimensions":true,"outputMimeType":"image/jpeg","outputBytes":61474,"outputQuality":85,"outputMaxSide":1200,"byteReductionPct":76.6},"2":"Image resized to fit limits: 1804x1145px 256.8KB -> 60.0KB (-76.6%)","_meta":{"runtime":"node","runtimeVersion":"24.14.0","hostname":"unknown","name":"{\"subsystem\":\"agents/tool-images\"}","parentNames":["openclaw"],"date":"2026-03-08T03:15:12.771Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/hunter/openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js:426:51","fileName":"subsystem-BfkFJ4uQ.js","fileNameWithLine":"subsystem-BfkFJ4uQ.js:426","fileColumn":"51","fileLine":"426","filePath":"openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js","filePathWithLine":"openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js:426","method":"logToFile"}},"time":"2026-03-07T20:15:12.772-07:00"}"}
Perfect â this one answers the mystery.
"label":"session:history" means: the screenshot isnât just âattached to the current promptâ, itâs sitting inside the persisted session transcript/history, and every new turn the gateway re-sanitizes that history before sending it to the model.
So two important implications:
-
Why you see the resize log repeatedly
OpenClaw is resizing at send time (sanitizing the transcript) and doesnât write the resized JPEG back into the stored session JSONL, so the next turn it encounters the original 1804Ă1145 PNG again and resizes again. -
Why it gets resent turn-after-turn
If it remains insession:history, itâs going back to the model each request (unless something prunes it out).
What you can do (today) to stop re-sends
A) Use /new after the screenshot turn (guaranteed)
Once youâve gotten the answer that depends on the screenshot, send /new and continue. Thatâs the only 100% way right now.
B) Use /compact after the screenshot has been âturned into textâ
Ask the assistant to summarize what matters from the screenshot, then run /compact. Compaction tends to drop bulky historical blocks (including image blocks) because it replaces older turns with a summary.
What should happen automatically (and might be missing/buggy in your build)
Thereâs a history-prune path intended to replace already-processed user image blocks with:
[image data removed - already processed by model]
If you do the âtext-only follow-upâ test and it still logs session:history resizes, that suggests one of:
- youâre on a version/build where that prune isnât present or isnât persisting, or
- the image isnât in a
usermessage (e.g. itâs in atoolResult/ other role), which currently wonât get pruned.
If you paste:
openclaw --version- and (if possible) whether you see that marker string anywhere in the session after an image turn
âŠI can tell which case youâre in and whether itâs worth filing an issue (âprune toolResult image blocksâ / âpersist sanitized images into transcriptâ / âprune user images in Control UI sessionsâ).
version 2026.3.2
{"type":"log","time":"2026-03-07T22:44:50.378-07:00","level":"info","subsystem":"agents/tool-images","message":"{"subsystem":"agents/tool-images"} {"label":"session:history","sourceMimeType":"image/png","sourceWidth":1223,"sourceHeight":110,"sourceBytes":29982,"maxBytes":5242880,"maxDimensionPx":1200,"triggerOverBytes":false,"triggerOverDimensions":true,"outputMimeType":"image/jpeg","outputBytes":13420,"outputQuality":85,"outputMaxSide":1200,"byteReductionPct":55.2} Image resized to fit limits: 1223x110px 29.3KB -> 13.1KB (-55.2%)","raw":"{"0":"{\"subsystem\":\"agents/tool-images\"}","1":{"label":"session:history","sourceMimeType":"image/png","sourceWidth":1223,"sourceHeight":110,"sourceBytes":29982,"maxBytes":5242880,"maxDimensionPx":1200,"triggerOverBytes":false,"triggerOverDimensions":true,"outputMimeType":"image/jpeg","outputBytes":13420,"outputQuality":85,"outputMaxSide":1200,"byteReductionPct":55.2},"2":"Image resized to fit limits: 1223x110px 29.3KB -> 13.1KB (-55.2%)","_meta":{"runtime":"node","runtimeVersion":"24.14.0","hostname":"unknown","name":"{\"subsystem\":\"agents/tool-images\"}","parentNames":["openclaw"],"date":"2026-03-08T05:44:50.378Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/hunter/openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js:426:51","fileName":"subsystem-BfkFJ4uQ.js","fileNameWithLine":"subsystem-BfkFJ4uQ.js:426","fileColumn":"51","fileLine":"426","filePath":"openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js","filePathWithLine":"openclaw-app/node_modules/openclaw/dist/subsystem-BfkFJ4uQ.js:426","method":"logToFile"}},"time":"2026-03-07T22:44:50.378-07:00"}"}
Nice â this confirms it 100%.
- Youâre on 2026.3.2
- The resize is happening while sanitizing
label: "session:history" - That means the image is still present in the stored transcript history, so itâs getting included again on later turns (and re-resized each time the history is prepared for a model call).
Why it keeps happening
OpenClawâs sanitizer resizes for the outbound request, but it doesnât persist the resized JPEG back into the session transcript. So the next turn, it sees the original image/png block in history again â resizes again â logs again.
How to actually stop âresend every turnâ
There isnât currently a âkeep images for N turnsâ knob. If the image is in session:history, the only practical ways to stop it from being re-sent are:
/newafter youâre done with the screenshot (guaranteed)/compactafter the assistant has converted what matters into text
(Tip: compaction often keeps the last few turns verbatim; so do/compactonce the screenshot turn is no longer in the last couple turns, or after a couple more exchanges.)
How to reduce resize frequency (even if it still resends)
Your example is barely over the default 1200px (1223Ă110). If you bump the limit, that whole class of âalmost-1200pxâ images will stop triggering:
openclaw config set agents.defaults.imageMaxDimensionPx 2048
openclaw gateway restart
This looks like a legit bug/feature gap
There is code intended to prune already-processed user image blocks from history, but your logs show the image is still surviving into session:history.
If you want this fixed upstream, Iâd file a GitHub issue with:
- the structured log entry you pasted (showing
label:"session:history") - âpasted image via Control UI / chat.send attachmentsâ
- and whether it still happens after the assistant has already replied to the image turn
Issue tracker: https://github.com/openclaw/openclaw/issues
If I set: openclaw config set agents.defaults.imageMaxDimensionPx 2048
the image is still going to get resent each turn right? This setting just suppresses the resize action and log message for images up to 2048px in one dimension?
Yes â itâll still get resent as long as that image block is still present in session:history.
agents.defaults.imageMaxDimensionPx only affects the sanitization step (âdo we downscale/recompress this image before sending it to the model?â). It does not change whether the image is included in the prompt/history.
So with:
openclaw config set agents.defaults.imageMaxDimensionPx 2048
youâre essentially doing two things:
- Suppress resize + the resize log for images where both sides are
<= 2048px(and theyâre not otherwise over size limits). - Youâre still going to include that image in every request if it remains in the session transcript.
Two extra nuances:
- Thereâs also a bytes limit (you can see
maxBytes: 5242880in your log). If an image is over ~5MB, it can still get recompressed even if dimensions are under the pixel limit. - Stopping re-sends requires removing it from history:
/new(guaranteed) or/compact(often effective once the image turn is no longer ârecentâ).
OK I got it about /new stopping re-send but that's not always what I want right after or shortly after pasting an image. I guess I can't have my cake and eat it too đ
You actually can get pretty close to âcake and eat it tooâ â just not instantly.
Practical workflow: keep the session, stop resending the image shortly after
- Paste screenshot, ask what you need.
- Next message ask for a text-only capture of anything youâll want to reference later, e.g.:
âSummarize the screenshot in text (key fields + any numbers). After this, assume the image is gone.â
- After 1â2 more turns (so the image turn isnât âsuper recentâ anymore), run:
/compact Keep the screenshot summary and the current plan. Drop any image data/attachments.
Because compaction persists a text summary and discards older raw content, itâs the cleanest way to keep continuity while getting rid of the image payload sitting in session:history.