Skip to content

fix(codex): hydrate queued inbound images#83533

Merged
steipete merged 1 commit into
mainfrom
codex/fix-app-server-inbound-images-83466
May 18, 2026
Merged

fix(codex): hydrate queued inbound images#83533
steipete merged 1 commit into
mainfrom
codex/fix-app-server-inbound-images-83466

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Extract shared current-turn image hydration for native PI and Codex app-server runs.
  • Hydrate MediaPath / MediaPaths into queued followup images while the inbound context is still available.
  • Keep direct run paths on the same helper and add regression coverage for queued image handoff.

Fixes #83466

Verification

  • node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/auto-reply/reply/followup-runner.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/run-attempt.vision-tools.test.ts
  • git diff --check origin/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode local (helper hit a Codex CLI argument incompatibility and fell back to claude -p; clean: no accepted/actionable findings)

Real behavior proof

Behavior addressed: current inbound image attachments from channel MediaPath / MediaPaths reach Responses-backed Codex app-server/native PI runs as structured image input, including queued followups.
Real environment tested: local focused OpenClaw test harness with real temp PNG attachment bytes and Codex app-server serialization tests.
Exact steps or command run after this patch: node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/auto-reply/reply/followup-runner.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/run-attempt.vision-tools.test.ts
Evidence after fix: get-reply-run.media-only.test.ts asserts followupRun.images contains a native image and imageOrder: ["inline"]; Codex app-server tests assert params.images serializes into turn/start.input.
Observed result after fix: 5 focused test files passed, 149 tests passed.
What was not tested: live Discord-to-OpenAI Responses turn; this PR proves the source-level handoff and app-server serialization path.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
This PR extracts shared current-turn image hydration, stores MediaPath-derived images on queued followups, and routes those images into Codex app-server/native PI run params with regression coverage and a changelog entry.

Reproducibility: yes. at source level: current main copies only opts?.images into queued followups while the linked report shows MediaPath prompt notes with imagesCount: 0. I did not run a live Discord-to-Responses reproduction in this read-only review.

PR rating
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Summary: The patch is bounded and covered by focused regression tests, with the main residual confidence gap being live transport proof.

Rank-up moves:

  • Run or inspect a live Discord-to-openai/openai-responses image turn showing trajectory imagesCount > 0 if maintainers want end-to-end proof before landing.
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.

Real behavior proof
Not applicable: The PR is maintainer-labeled, so the external contributor proof gate does not apply; the body still reports focused temp-PNG and serialization tests but no live Discord-to-Responses run.

Mantis proof suggestion
A live transport proof would materially increase confidence that Discord image attachments reach the Responses-backed Codex app-server path. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: send a Discord image to an openai/openai-responses Codex app-server agent and capture trajectory imagesCount > 0.

Risk before merge
Why this matters: - Live Discord-to-OpenAI Responses image handoff was not exercised during this read-only review; the PR body reports focused temp-PNG and serialization test coverage instead.

Maintainer options:

  1. Decide the mitigation before merge
    Land the bounded helper/test change after maintainer review and CI, keeping the existing attachment resolver as the single local-media security boundary.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
This is maintainer-labeled with no narrow repair finding; the remaining action is maintainer review and landing, not a ClawSweeper fix PR.

Security
Cleared: The diff adds no dependency, workflow, or secret-handling changes and reuses the existing media attachment root/max-byte/timeout resolver.

Review details

Best possible solution:

Land the bounded helper/test change after maintainer review and CI, keeping the existing attachment resolver as the single local-media security boundary.

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

Yes, at source level: current main copies only opts?.images into queued followups while the linked report shows MediaPath prompt notes with imagesCount: 0. I did not run a live Discord-to-Responses reproduction in this read-only review.

Is this the best way to solve the issue?

Yes, the PR uses the existing attachment resolver and moves hydration earlier, before queued-run context is lost. I did not find an existing supported configuration path that already solves queued MediaPath hydration.

Label justifications:

  • P1: The PR targets a user-visible image-delivery regression where Responses-backed Codex agents receive imagesCount: 0 for inbound channel images.

What I checked:

Likely related people:

  • joshavant: Introduced the current direct native PI image hydration helper and media-path regression tests that this PR extracts and extends. (role: recent feature owner; confidence: high; commits: 491ce8b7535b; files: src/auto-reply/reply/agent-runner-execution.ts, src/auto-reply/reply/agent-turn-attachments.ts, src/auto-reply/reply/agent-runner.media-paths.test.ts)
  • Patrick Erichsen: Current available history shows this contributor introduced the get-reply-run and agent-turn-attachments surfaces that hold the queued followup and media resolver contracts. (role: adjacent owner; confidence: medium; commits: 9d4500f3aca9; files: src/auto-reply/reply/get-reply-run.ts, src/auto-reply/reply/agent-turn-attachments.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 1e5450f23e1c.

@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. labels May 18, 2026
@steipete steipete added the proof: override Maintainer override for the external PR real behavior proof gate. label May 18, 2026
@steipete steipete merged commit 8725364 into main May 18, 2026
144 of 152 checks passed
@steipete steipete deleted the codex/fix-app-server-inbound-images-83466 branch May 18, 2026 09:16
@steipete

Copy link
Copy Markdown
Contributor Author

Landed via rebase onto main.

  • Gate: gh pr checks 83533 --watch=false all relevant checks pass; Real behavior proof passed after maintainer proof: override for this source-boundary fix.
  • Local proof: node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/auto-reply/reply/followup-runner.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/run-attempt.vision-tools.test.ts => 5 files / 149 tests passed.
  • Autoreview: .agents/skills/autoreview/scripts/autoreview --mode local clean; helper fell back to claude -p after Codex CLI arg mismatch.
  • Land commit: 8725364cf0be867b040469dfe68e83a3a0d3436a

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

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: override Maintainer override for the external PR real behavior proof gate. 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.

[Bug]: openai-responses Codex app-server drops inbound image attachments — params.images never populated from MediaPath

1 participant