Skip to content

feat(agents): support prompt images in Hermes, OpenClaw and Codex - #5960

Merged
yaoyu-33 merged 8 commits into
mainfrom
codex/hermes-session-images
Nov 16, 2026
Merged

yaoyu-33 merged 8 commits into
mainfrom
codex/hermes-session-images

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Add base64 data-URI prompt images to Hermes, OpenClaw and Codex, retaining image content in exported conversations. These adapters previously rejected images or flattened them into text. No separate issue is needed for this focused harness extension.

  • Hermes supports images in the current prompt and earlier user turns, in both host and sandbox execution. It forwards ordered Chat content lists with original image bytes and detail; no image staging is needed.
  • OpenClaw and Codex support images in agent sessions, including image-only prompts. OpenClaw stages files in its allowed session media directory and enables model image input automatically; Codex stages content-named files and passes repeated --image arguments.
  • Shared media validation rejects URLs, file IDs, invalid base64, unsupported signatures/types, and non-user images before activation. OpenClaw/Codex local execution returns 422 for images instead of silently dropping them.
  • Uploads run inside the existing close fence and activation deadline from fix(agents): stage activation files inside the close fence #5862. Identical retries share one invocation. Regression tests cover cancellation, failed upload, deadline consumption, recovery, and exported images.
  • Preserve the Hermes review fix from 5f031eb22: exports accept object/bare-URL Chat image parts and Responses image parts.

Compatibility and evaluation effects:

  • OpenClaw/Codex retain their single-user-prompt contract and native preprocessing. They do not preserve the supplied image detail or text/image interleaving. Codex puts images before text; OpenClaw deduplicates identical images and retains session-specific path markers.
  • Large images may be resized/reencoded. The smoke's 2400×2400 PNG became 1600×1600 PNG in Codex and 1200×1200 JPEG in OpenClaw. Hermes forwarded it unchanged.
  • OpenClaw image_input: true can also declare image capability without prompt attachments. Tool/MCP image handling and training/token capture are outside this qualification.
  • OpenClaw media is removed with the session; Codex's shared content-named files remain in borrowed sandboxes.

Validation on the workstation, Python 3.13.14:

python -m pytest responses_api_agents/hermes_agent/tests responses_api_agents/codex_agent/tests responses_api_agents/openclaw_agent/tests tests/unit_tests/core/test_media.py tests/unit_tests/test_fern_docs_links.py -q --tb=short
pre-commit run --all-files

1,544 passed, 24 subtests passed, 7 optional runtime tests skipped; full pre-commit passed. The suite uses the locked Hermes component environment with core/sandbox dependencies; actual pinned Codex/OpenClaw CLIs were exercised on the compute cluster. Seven new OpenClaw/Codex positive regressions fail against the prior adapter code and pass on final code; five Hermes regressions were similarly checked earlier. Final formatting is AST-equivalent; the positive checks also pass after formatting. Independent source review and git diff --check passed.

Real-model smoke on the compute cluster used Qwen3-VL-8B-Instruct, vLLM 0.20.0 eager, pinned Hermes 26bb847a / OpenClaw 2026.6.11 / Codex 0.144.4, agent-owned Enroot sandboxes, and stock Gym evaluation/session/verifier flow at concurrency 1:

Harness Valid cases completed and healthy Reward 1 Evidence
Hermes 5/5 5/5 Single, multiple, earlier history, text recovery, large image; bytes/detail/order preserved
OpenClaw 5/5 5/5 Single, multiple, image-only, text recovery, large image; first-request images and native export verified
Codex 5/5 3/5 Same cases as OpenClaw; both images delivered in the multiple case; image-only passed

Codex answered 4 instead of 3 in the multiple and large cases. Captures confirm image delivery, native resizing and healthy calls; these are retained accuracy misses, not reported as successful answers. All harnesses reject remote URLs with 422 and zero model calls, then recover on text. Exported native images match captured model images. Codex's staged hashes were independently captured; the OpenClaw process watcher missed its runtime process, so no independent on-disk/config snapshot is claimed there.

Smoke provenance was checked after the concurrent main/review merge: relevant shared media/lifecycle/Enroot/model code is byte-identical; final OpenClaw runtime is AST-equivalent; Codex differs only by the unseeded local-path 422 guard. The Hermes follow-up changes export normalization, not its smoked model-request path. An initial OpenClaw attempt was stopped for a unit-test-discovered image-count guard defect; the corrected attempt above ran to completion. All task servers, sandboxes and cluster allocations were cleaned up.

Scope limits: PNG prompt inputs, evaluation only; no blanket qualification of all supported formats, borrowed sandboxes, other providers, concurrency, benchmark accuracy, or training.

Review fixes on November 12 (4eb75192f, after merging main at 33a498938):

  • Normalize non-ASCII invalid base64 to the shared input error, returning 422 before activation in Hermes host/sandbox, Codex, and OpenClaw. Existing MIME normalization, signatures, and non-user rejection remain covered.
  • Check retained prompt images on OpenClaw output-limit replies as well as completed replies. Missing images fail the invocation; retained images preserve the incomplete response and partial text. Wall-time limits, including before the first model call, retain their existing behavior.
  • Resolve the Hermes and OpenClaw test conflicts while retaining the independent main-branch tests and timeout fix.

Follow-up validation on the workstation with Python 3.13.14 and root-locked core/sandbox dependencies plus the pinned Hermes runtime:

python -m pytest responses_api_agents/hermes_agent/tests responses_api_agents/codex_agent/tests responses_api_agents/openclaw_agent/tests tests/unit_tests/core/test_media.py tests/unit_tests/test_fern_docs_links.py -q --tb=short
python -m pre_commit run --all-files

1,566 passed, 24 subtests passed, 7 optional runtime tests skipped; full pre-commit passed. The added regressions expose six failures against the pre-fix source (five malformed-base64 paths and OpenClaw's missing-image output-limit path). All 46 focused regression cases pass on the final formatted source. Pre-commit made one AST-equivalent import-format change; the final committed files match the workstation source.

The shared-core fix selects full CI coverage, including the eight-shard server suite. No new real-model smoke was run in this follow-up; the smoke evidence above describes the earlier qualified revisions and runtime versions, including Codex 0.144.4, rather than a new qualification of the merged head.

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior labels Nov 10, 2026
yaoyu-33 and others added 2 commits November 10, 2026 13:01
…e limits

normalize_hermes_messages indexed image_url as an object, so a user message
holding a bare-URL image_url part, a form Hermes itself reads, raised TypeError
and failed the conversation export after a completed run. It now reads both
image_url forms and Responses input_image parts, and defaults a missing detail.

The README now says where images go, what returns 422, that a vision model is
needed, that the response output keeps text while the session conversation
keeps images, that Hermes counts base64 toward its preflight compression
estimate, and what is not qualified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 5f031eb

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

@yaoyu-33 yaoyu-33 changed the title feat(hermes): support images in user prompts and history feat(agents): support prompt images in Hermes, OpenClaw and Codex Nov 10, 2026
yaoyu-33 added a commit that referenced this pull request Nov 11, 2026
…pture rule

Hermes passes prompt images as ordered Chat Completions image_url parts without
staging files; give it its own row and describe that path beside the staged one.
With #5833 merged, token capture keeps OpenCode's step-limit note chained, so
opencode_agent no longer refuses agent.build.steps under token capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33
yaoyu-33 marked this pull request as ready for review November 12, 2026 17:08

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE

Two RISK findings remain: non-ASCII malformed base64 becomes a server error across the new image-input paths, and OpenClaw skips image-delivery validation for output-limit replies that remain gradable.

I reviewed all 19 changed files and traced the affected media, lifecycle, conversation-export, and verification paths. This was a static review; I couldn't execute tests or independently reproduce the author-reported runtime smokes.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread responses_api_agents/codex_agent/app.py Resolved
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 4eb7519

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 13, 2026

@yfw yfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE. The PR is not ready to merge as is. Please fix the OpenClaw resize first, and take the Hermes detail and Codex image-count fixes in the same push. The other comments are smaller.

This PR brings prompt images to three more harnesses, with one shared set of image rules in MediaFile. Image staging runs inside the close fence and the activation deadline, and exported conversations keep the images. The real-model smoke covers each harness with five cases. Both automated-review findings are fixed with tests: the non-ASCII base64 case in all three harnesses, and the output-limit image case in OpenClaw.

The test jobs did not run on head 648d58b. Only Lint, DCO, copyright, secrets and lock-freshness ran. Please post the /ok to test command with the full head SHA again, as for 4eb7519. At 4eb7519, every test job that ran passed. DCO passes, and the PR has no merge conflict with main.

The adapter table in #5868 still lists Codex and OpenClaw as rejecting images, and whichever PR merges second can update it.

Generated by Claude Code

Comment thread responses_api_agents/codex_agent/app.py Resolved
@yfw

yfw commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

/ok to test 3210be7

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 15, 2026 03:53
@yaoyu-33
yaoyu-33 removed the request for review from cynthiagao-nv November 16, 2026 04:32
@yaoyu-33
yaoyu-33 added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43807436356

Merged via the queue into main with commit b8fe13f Nov 16, 2026
111 of 117 checks passed
@yaoyu-33
yaoyu-33 deleted the codex/hermes-session-images branch November 16, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants