Repository navigation
Description
Bug Description
Title: OpenAI API provider fails with HTTP 400 on Hermes 0.16.0 (Windows)
Environment
- Hermes version: 0.16.0 (2026.6.5)
- OS: Windows 10 AMD64
- Python: 3.11.15
- OpenAI SDK: 2.24.0
Configuration
-
Provider: openai-api
-
Models tested:
- gpt-4.1
- gpt-4o-mini
-
OpenAI API key configured and detected by Hermes
Observed behavior
Running:
hermes chat
and sending a simple prompt:
hello
always returns:
HTTP 400: Error code: 400
Relevant log entries:
provider=openai-api
base_url=https://api.openai.com/v1
model=gpt-4.1
API call failed (attempt 1/3)
error_type=BadRequestError
summary=HTTP 400: Error code: 400
The same behavior occurs with gpt-4o-mini.
Verification performed
- OpenAI API key is valid.
- Direct API call succeeds:
Invoke-RestMethod https://api.openai.com/v1/models
returns model list successfully.
- Hermes status shows:
Provider: OpenAI API
Model: gpt-4.1
- Hermes works correctly when switched to Nous Portal.
Additional observation
Logs show:
OpenAI client created (codex_stream_request)
even though the selected provider is openai-api.
Question:
Could Hermes be sending an invalid request payload through the OpenAI provider path or incorrectly routing requests through codex_stream_request?
Steps to Reproduce
Title: OpenAI API provider fails with HTTP 400 on Hermes 0.16.0 (Windows)
Environment
- Hermes version: 0.16.0 (2026.6.5)
- OS: Windows 10 AMD64
- Python: 3.11.15
- OpenAI SDK: 2.24.0
Configuration
-
Provider: openai-api
-
Models tested:
- gpt-4.1
- gpt-4o-mini
-
OpenAI API key configured and detected by Hermes
Observed behavior
Running:
hermes chat
and sending a simple prompt:
hello
always returns:
HTTP 400: Error code: 400
Relevant log entries:
provider=openai-api
base_url=https://api.openai.com/v1
model=gpt-4.1
API call failed (attempt 1/3)
error_type=BadRequestError
summary=HTTP 400: Error code: 400
The same behavior occurs with gpt-4o-mini.
Verification performed
- OpenAI API key is valid.
- Direct API call succeeds:
Invoke-RestMethod https://api.openai.com/v1/models
returns model list successfully.
- Hermes status shows:
Provider: OpenAI API
Model: gpt-4.1
- Hermes works correctly when switched to Nous Portal.
Additional observation
Logs show:
OpenAI client created (codex_stream_request)
even though the selected provider is openai-api.
Question:
Could Hermes be sending an invalid request payload through the OpenAI provider path or incorrectly routing requests through codex_stream_request?
Expected Behavior
When configured with a valid OpenAI API key and the OpenAI API provider, Hermes should successfully send a chat request to the OpenAI API and return the model response.
Steps performed:
- Configured Hermes 0.16.0 with a valid OpenAI API key.
- Selected OpenAI API as the active provider.
- Tested with both gpt-4.1 and gpt-4o-mini.
- Started a new chat session and entered a simple prompt ("hello").
Expected result:
Hermes should return a normal response from the selected OpenAI model, such as a greeting or other generated text.
Actual result:
Hermes consistently returns HTTP 400 (BadRequestError) and no model response is produced.
Additional verification:
- The same API key successfully accesses https://api.openai.com/v1/models via direct REST calls.
- Hermes works normally when switched to the Nous Portal provider.
- Therefore the OpenAI API credentials, network connectivity, and OpenAI account appear to be functioning correctly.
Actual Behavior
Hermes was configured to use the OpenAI API provider with a valid OpenAI API key.
Environment:
-
Hermes Agent 0.16.0 (2026.6.5)
-
Windows 10 AMD64
-
Python 3.11.15
-
OpenAI SDK 2.24.0
-
Provider: openai-api
-
Models tested:
- gpt-4.1
- gpt-4o-mini
Steps to reproduce:
-
Configure a valid OpenAI API key.
-
Select OpenAI API as the active provider.
-
Start Hermes Chat.
-
Enter a simple prompt such as:
hello
Observed behavior:
Hermes initializes normally but fails when sending the first request to OpenAI.
CLI output:
● hello
Initializing agent...
⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400]
🔌 Provider: openai-api
Model: gpt-4.1
🌐 Endpoint: https://api.openai.com/v1
❌ Non-retryable error (HTTP 400): HTTP 400: Error code: 400
❌ Non-retryable client error (HTTP 400). Aborting.
Error: Error code: 400
The same error occurs with gpt-4o-mini.
Relevant log entries:
provider=openai-api
base_url=https://api.openai.com/v1
model=gpt-4.1
OpenAI client created (codex_stream_request, shared=False)
API call failed (attempt 1/3)
error_type=BadRequestError
summary=HTTP 400: Error code: 400
Non-retryable client error: Error code: 400
Additional observations:
-
Direct OpenAI API requests succeed using the same API key:
-
Hermes status reports:
Provider: OpenAI API
Model: gpt-4.1
OpenAI API key: set
- Switching Hermes to Nous Portal works immediately and returns responses normally.
This suggests the issue is specific to Hermes' OpenAI provider integration rather than the OpenAI API key, account, billing, or network connectivity.
Affected Component
Setup / Installation
Messaging Platform (if gateway-related)
No response
Debug Report
Debug report uploaded:
Report https://paste.rs/vuoH8
agent.log https://paste.rs/ESY73
desktop.log https://paste.rs/luqhcOperating System
Windows 11
Python Version
No response
Hermes Version
No response
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
- I'd like to fix this myself and submit a PR
Activity
teknium1 commentedon Sep 19, 2026
Thanks for the careful verification.
OpenAI client created (codex_stream_request)is expected: on current main every api.openai.com request is sent over the Responses API (b1d05df,agent/agent_init.py::_resolve_api_mode), which gpt-4.1 and gpt-4o-mini support — so the routing is not the bug, and 0.16.0 hid the actual 400 body. Since 093f567 Hermes prints the provider's error message for 400s. Could you update (hermes update) and paste the fullBadRequestErrortext (it now names the rejected parameter) plus theagent.loglines around it? Closing until then; happy to reopen with the body.