hermes - 💡(How to fix) Fix hermes-codex-bug-report

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. Error: Tool choice 'image_generation' not found in 'tools' parameter.

Root Cause

The Codex API at https://chatgpt.com/backend-api/codex/responses strips the tools array from all incoming requests. The API response in response.created always shows "tools": [] regardless of what's sent.

The plugin's tool_choice={"type": "allowed_tools", "mode": "required", "tools": [{"type": "image_generation"}]} fails because the API doesn't propagate custom tools.

RAW_BUFFERClick to expand / collapse

Bug Description

The image_gen/openai-codex plugin fails to generate images because the Codex Responses API (chatgpt.com/backend-api/codex/responses) strips custom tools and doesn't support the tool_choice parameter properly.

Steps to Reproduce

  1. Enable plugin: hermes plugins enable image_gen/openai-codex
  2. Auth: hermes auth add --type oauth openai-codex
  3. Call image generation
  4. Error: Tool choice 'image_generation' not found in 'tools' parameter.

Root Cause

The Codex API at https://chatgpt.com/backend-api/codex/responses strips the tools array from all incoming requests. The API response in response.created always shows "tools": [] regardless of what's sent.

The plugin's tool_choice={"type": "allowed_tools", "mode": "required", "tools": [{"type": "image_generation"}]} fails because the API doesn't propagate custom tools.

Attempted Fixes That Also Failed

  • tool_choice="required" → "Tool choice 'required' must be specified with 'tools' parameter"
  • tool_choice={"type": "function", "function": {"name": "image_generation"}} → "Unknown parameter: 'tool_choice.function'"
  • No tool_choice → Model returns text only, never invokes image_generation tool

Environment

  • macOS 15.7.5
  • Hermes Agent v0.14.0 (2026.5.16)
  • openai SDK 2.24.0
  • Python 3.12.13

Notes

  • Device code auth to auth.openai.com returns "unsupported_country_region_territory" (region blocked in China)
  • Token exchange via auth.openai.com/oauth/token works fine
  • The non-codex image_gen/openai plugin works correctly with standard OPENAI_API_KEY
  • image_gen/xai plugin also works fine with XAI_API_KEY

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING