Skip to content

Fix Codex raw image generation media projection#88191

Merged
joshavant merged 1 commit into
mainfrom
fix/codex-raw-image-generation-projection
May 30, 2026
Merged

Fix Codex raw image generation media projection#88191
joshavant merged 1 commit into
mainfrom
fix/codex-raw-image-generation-projection

Conversation

@joshavant

Copy link
Copy Markdown
Contributor

Summary

  • Project raw Codex app-server image_generation_call.result payloads into managed OpenClaw media artifacts.
  • Mark raw generated image items as side-effecting for replay safety and dedupe raw/typed generated media by item id.
  • Drain queued app-server notification projection before building the final result so completion-time media is included.

Fixes #87948.

Verification

  • .agents/skills/autoreview/scripts/autoreview --mode local
  • node scripts/run-vitest.mjs extensions/codex/src/app-server/event-projector.test.ts
  • node scripts/run-vitest.mjs extensions/codex/src/app-server/run-attempt.turn-watches.test.ts
  • node scripts/run-vitest.mjs extensions/codex/src/app-server/event-projector.test.ts extensions/codex/src/app-server/run-attempt.turn-watches.test.ts
  • git diff --check
  • Local live Telegram/Codex no-Docker source-gateway proof with Convex telegram credential and Codex auth: produced a Telegram photo reply from a Codex imageGeneration turn.

Real behavior proof

Behavior addressed: Codex native image generation results are delivered to Telegram as managed OpenClaw media instead of being dropped from the final app-server projection.

Real environment tested: Local source checkout on macOS, local OpenClaw gateway, real Telegram bot/group credential leased from Convex kind telegram, and live Codex app-server auth.

Exact steps or command run after this patch: A temporary no-Docker live harness started the local gateway, sent a Telegram canary, sent a Codex image-generation prompt, and waited for a Telegram media reply.

Evidence after fix: The completed Codex item types included imageGeneration, and the Telegram reply contained mediaKinds:["photo"].

Observed result after fix: The OpenClaw Telegram bot replied to the image-generation request with a real photo attachment.

What was not tested: Remote Crabbox Hetzner proof is blocked by coordinator-side Hetzner API authentication; Blacksmith delegated proof cannot access the local Convex/Codex auth env files needed for this live lane.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 9:47 PM ET / 01:47 UTC.

Summary
The PR projects raw Codex app-server image_generation_call.result payloads into managed media, marks generated image output as replay-unsafe, dedupes raw and typed media by item id, and waits for queued notification projection before building the final result.

PR surface: Source +114, Tests +188. Total +302 across 4 files.

Reproducibility: yes. for the source path: current main ignores raw image_generation_call.result as final reply media, and the linked issue provides release logs for the timeout variant. I did not run live Telegram or Vitest proof in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Use the in-progress or maintainer-requested Telegram proof artifact if maintainers want independently inspectable live evidence before merge.

Mantis proof suggestion
A native Telegram proof would materially confirm the visible media delivery path restored by this Codex projection fix. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram desktop proof: verify a Codex image-generation turn sends a Telegram photo reply instead of dropping the media.

Risk before merge

  • [P1] The protected maintainer label means close or merge handling should stay with maintainers even though no concrete patch defect was found.
  • [P1] The PR body has sufficient live proof, but maintainers may still prefer the in-progress Mantis Telegram artifact before landing because the proof is not separately inspectable in the PR body.

Maintainer options:

  1. Decide the mitigation before merge
    Land this focused Codex app-server fix after maintainer review and required CI/live-proof acceptance, then close the linked liveness issue as fixed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair is needed; the protected maintainer-labeled PR should receive normal maintainer review, CI, and live-proof merge-gate handling.

Security
Cleared: The diff uses existing OpenClaw image/media helpers with size limits and changes no workflows, dependencies, lockfiles, credentials, permissions, or external code execution paths.

Review details

Best possible solution:

Land this focused Codex app-server fix after maintainer review and required CI/live-proof acceptance, then close the linked liveness issue as fixed.

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

Yes for the source path: current main ignores raw image_generation_call.result as final reply media, and the linked issue provides release logs for the timeout variant. I did not run live Telegram or Vitest proof in this read-only review.

Is this the best way to solve the issue?

Yes. Persisting raw image-generation results through existing image-generation and media-store helpers, then draining queued projection before final result assembly, is a narrow Codex app-server fix that avoids changing timeout policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 75de853c3791.

Label changes

Label justifications:

  • P1: The PR addresses a user-facing Codex/Telegram workflow where generated image media can be dropped and the session later appears interrupted.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains after-fix live local Telegram/Codex source-gateway proof that a Codex image-generation turn produced a Telegram photo reply.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains after-fix live local Telegram/Codex source-gateway proof that a Codex image-generation turn produced a Telegram photo reply.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The user-visible outcome is a Telegram photo reply for Codex image-generation output, which is easy to demonstrate in a short Telegram proof recording.
Evidence reviewed

PR surface:

Source +114, Tests +188. Total +302 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 118 4 +114
Tests 2 189 1 +188
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 307 5 +302

What I checked:

Likely related people:

  • steipete: Current blame for raw app-server item handling and generated-media projection points to the shared-state refactor that currently owns these lines on main. (role: recent area contributor; confidence: high; commits: bc848b367f0b; files: extensions/codex/src/app-server/event-projector.ts, extensions/codex/src/app-server/run-attempt.ts)
  • keshavbotagent: Recent completion-stall recovery work touched the same Codex app-server notification and turn-watch path implicated by the linked issue. (role: recent adjacent liveness contributor; confidence: medium; commits: 5f89fbe6699e; files: extensions/codex/src/app-server/run-attempt.ts, extensions/codex/src/app-server/attempt-notification-state.ts, extensions/codex/src/app-server/run-attempt.turn-watches.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P1 High-priority user-facing bug, regression, or broken workflow. labels May 30, 2026
@joshavant joshavant merged commit f870bea into main May 30, 2026
153 of 164 checks passed
@joshavant joshavant deleted the fix/codex-raw-image-generation-projection branch May 30, 2026 01:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 30, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

Codex app-server idle watchdog fires after image_generation_call raw completed item

1 participant