Skip to content

fix(codex): render dynamic tool images in chat - #120577

Closed
f-trycua wants to merge 1 commit into
openclaw:mainfrom
f-trycua:agent/render-codex-tool-images
Closed

f-trycua wants to merge 1 commit into
openclaw:mainfrom
f-trycua:agent/render-codex-tool-images

Conversation

@f-trycua

@f-trycua f-trycua commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Codex dynamic tools can return image content successfully, but the durable transcript projection flattened those images to text. Control UI then hid or rolled up the surviving tool result, and chat-history budgeting replaced a typical screenshot-sized message with a message-too-large placeholder. The result was a successful computer screenshot that never rendered in chat.

What Changed

  • Preserve validated dynamic-tool image outputs as top-level transcript image blocks.
  • Replace invalid inline image payloads with safe explanatory text.
  • Keep image-bearing tool results outside completed-work and activity rollups.
  • Render tool-result images even when tool details are collapsed or tool calls are hidden.
  • Give image-bearing history messages a bounded 1 MiB per-message allowance while preserving the 128 KiB ordinary-message cap and existing total-history cap.

Evidence

  • Seven focused Codex projector, chat grouping/rendering, and history-budget suites: 387 tests passed.
  • Changed-file Oxlint: passed.
  • Changed-file Oxfmt check: passed.
  • Full pnpm build, including Control UI compressed assets and performance checks: passed.
  • Live pinned CUA Driver 0.19.0 gateway replay: the stored screenshot survives chat.history as toolResult + image with a 418,067-character data URL and no omitted-message placeholder.
  • Live Control UI verification: the Linux XFCE screenshot visibly renders inline with the Computer screenshot tool result.

Impact

Computer screenshots and other dynamic-tool images survive transcript persistence, history transport, grouping, and rendering, so they appear inline in Control UI chat without requiring users to expand tool details.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui extensions: codex size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 8, 2026
@f-trycua
f-trycua force-pushed the agent/render-codex-tool-images branch from 34226a7 to 73f00c2 Compare August 8, 2026 12:29
@f-trycua
f-trycua force-pushed the agent/render-codex-tool-images branch from 73f00c2 to a5dc67f Compare August 8, 2026 12:40
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 8, 2026
@f-trycua
f-trycua force-pushed the agent/render-codex-tool-images branch from a5dc67f to 5987ded Compare August 8, 2026 13:01
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw.

Close this stale PR: the latest review rated it F, it still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

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

Source establishes the failure: current-main dynamic-tool projection discards non-text content, while screenshot-sized image messages on this branch still exceed embedded callers' unchanged 128 KiB cap; no runtime reproduction was executed.

Is this the best way to solve the issue?

The transcript and renderer changes address the right owners, but the fix remains too narrow because image budgeting is enabled by one caller instead of consistently across the shared history boundary.

Security review:

Security review cleared: No concrete security regression was identified in image validation, history transport, or the existing image renderer.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-08-08T11:48:02Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Peter Steinberger: Raw commit e20c029 adds extensions/codex/src/app-server/event-projector-tool-transcript.ts:99 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e20c029efd68; files: extensions/codex/src/app-server/event-projector-tool-transcript.ts)
  • Jason (Json): Raw commit aee4670 adds extensions/codex/src/app-server/event-projector-tool-transcript.ts:110 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: aee46707ba10; files: extensions/codex/src/app-server/event-projector-tool-transcript.ts)
  • Shakker: Raw commit 4755dee adds src/gateway/server-methods/chat-history-budget.ts:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4755dee240e3; files: src/gateway/server-methods/chat-history-budget.ts)

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

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 23, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 26, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Oct 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. labels Oct 17, 2026
@clawsweeper clawsweeper Bot removed merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui extensions: codex gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant