hermes - ✅(Solved) Fix [Bug]: custom GPT-5.4 gateway sessions hit Responses API 400 "Invalid 'input[n].name': empty string" even after reset/update [1 pull requests, 1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#11411Fetched 2026-04-18 06:01:14
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1labeled ×1referenced ×1

Error Message

Representative redacted excerpts:

ERROR root: Non-retryable client error: Error code: 400 - {'error': {'message': "Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead.", 'type': 'invalid_request_error', 'param': 'input[4].name', 'code': 'empty_string'}}

INFO gateway.run: Skipping transcript persistence for failed request in session ... to prevent session growth loop.

INFO gateway.run: Pre-reset memory flush completed for session ...

The same class of error appears repeatedly on Apr 16-17 with multiple input indexes, including input[3], [4], [5], [6], [7], [9], [18], and [19].

Logs also confirm that hermes update triggered a gateway restart and that the error still reproduced after the restart.

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #11435: fix(responses): drop orphan function_call_output when function name is empty (fixes HTTP 400)

Description (problem / solution / changelog)

Problem

When serializing chat history to Responses API input items, a function_call with an empty/missing name is silently skipped. However the paired function_call_output was still emitted, creating an orphan item.

The provider tries to reconstruct the function name from the orphan output, produces an empty string, and rejects the request:

HTTP 400: Invalid 'input[n].name': empty string.
Expected a string with minimum length 1, but got an empty string instead.

The failing index varies across turns (input[3], [4], [5], [6], [7], [9], [18], [19]) because it depends on how many items precede the orphan in the conversation history.

Fix

Track skipped call_ids in _skipped_call_ids when a function_call is dropped due to empty/missing name. When processing function_call_output items, skip any whose call_id is in _skipped_call_ids.

Adds a debug-level log so the drop is visible in verbose sessions.

Result

Orphan function_call_output items are never sent to the provider. Sessions with empty-name tool calls no longer produce HTTP 400 errors.

Fixes #11411

Changed files

  • run_agent.py (modified, +19/-0)

Code Example

Redacted local debug summary (sensitive identifiers removed):

- Hermes version: `0.10.0 (2026.4.16) [764536b6]`
- OS: `Darwin 25.1.0 x86_64`
- Python: `3.11.5`
- OpenAI SDK: `2.31.0`
- Profile: `default`
- Model: `gpt-5.4`
- Provider: `custom`
- Gateway: loaded via `launchd`
- Enabled platforms: `feishu, weixin`
- Custom endpoint hostname: redacted for privacy

I can provide a more complete redacted log excerpt if needed, but I do not want to post private identifiers publicly.

---

Representative redacted excerpts:


ERROR root: Non-retryable client error: Error code: 400 - {'error': {'message': "Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead.", 'type': 'invalid_request_error', 'param': 'input[4].name', 'code': 'empty_string'}}

INFO gateway.run: Skipping transcript persistence for failed request in session ... to prevent session growth loop.

INFO gateway.run: Pre-reset memory flush completed for session ...


The same class of error appears repeatedly on Apr 16-17 with multiple input indexes, including `input[3]`, `[4]`, `[5]`, `[6]`, `[7]`, `[9]`, `[18]`, and `[19]`.

Logs also confirm that `hermes update` triggered a gateway restart and that the error still reproduced after the restart.
RAW_BUFFERClick to expand / collapse

Bug Description

When Hermes Agent is deployed through the gateway with a custom OpenAI-compatible provider and model gpt-5.4, normal user messages can fail with a Responses API 400:

HTTP 400: Invalid 'input[n].name': empty string

This still reproduces after:

  • running hermes update
  • confirmed gateway restart
  • running /reset repeatedly

This does not look like a stale-session-only problem. The failing index varies across attempts (input[3], [4], [5], [6], [7], [9], [18], [19]), which suggests Hermes is generating or replaying a malformed Responses input item with an empty function_call.name.

The issue was observed in Weixin gateway usage. I am redacting account identifiers, chat identifiers, filesystem paths, and the custom relay hostname for privacy.

This report supersedes #11378, which used the wrong local machine environment details.

Steps to Reproduce

  1. Configure Hermes with a custom OpenAI-compatible provider / relay (hostname redacted)
  2. Select model gpt-5.4
  3. Run the messaging gateway
  4. Confirm hermes update completed and the gateway restarted
  5. Run /reset
  6. Send a simple plain-text message in Weixin
  7. Hermes may return a 400 instead of answering

A concrete conversation pattern seen in logs:

  • a first question can succeed
  • a short follow-up message that depends on prior context can fail immediately with Invalid 'input[n].name'
  • asking the full question again in one turn can succeed

Expected Behavior

A fresh session after /reset should accept normal user messages and either answer normally or fail with a provider/tool error that does not corrupt subsequent turns.

Actual Behavior

Hermes returns errors like:

Non-retryable error (HTTP 400): HTTP 400: Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead.

The index is not stable. Logs show input[3], [4], [5], [6], [7], [9], [18], and [19] across different sessions.

After the failure, Hermes logs lines such as:

  • Skipping transcript persistence for failed request in session ... to prevent session growth loop
  • Pre-reset memory flush completed for session ...

But the problem still reproduces in later turns and even after gateway restart.

Affected Component

Configuration (config.yaml, .env, hermes setup), Agent Core (conversation loop, context compression, memory), Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

Redacted local debug summary (sensitive identifiers removed):

- Hermes version: `0.10.0 (2026.4.16) [764536b6]`
- OS: `Darwin 25.1.0 x86_64`
- Python: `3.11.5`
- OpenAI SDK: `2.31.0`
- Profile: `default`
- Model: `gpt-5.4`
- Provider: `custom`
- Gateway: loaded via `launchd`
- Enabled platforms: `feishu, weixin`
- Custom endpoint hostname: redacted for privacy

I can provide a more complete redacted log excerpt if needed, but I do not want to post private identifiers publicly.

Operating System

Darwin 25.1.0 x86_64

Python Version

3.11.5

Hermes Version

0.10.0 (2026.4.16) [764536b6]

Additional Logs / Traceback (optional)

Representative redacted excerpts:


ERROR root: Non-retryable client error: Error code: 400 - {'error': {'message': "Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead.", 'type': 'invalid_request_error', 'param': 'input[4].name', 'code': 'empty_string'}}

INFO gateway.run: Skipping transcript persistence for failed request in session ... to prevent session growth loop.

INFO gateway.run: Pre-reset memory flush completed for session ...


The same class of error appears repeatedly on Apr 16-17 with multiple input indexes, including `input[3]`, `[4]`, `[5]`, `[6]`, `[7]`, `[9]`, `[18]`, and `[19]`.

Logs also confirm that `hermes update` triggered a gateway restart and that the error still reproduced after the restart.

Root Cause Analysis (optional)

High-probability diagnosis: Hermes is serializing or replaying an invalid Responses API item for custom GPT-5 gateway sessions, most likely a function_call item whose name becomes an empty string.

The evidence points away from a Weixin transport bug and toward the custom + gpt-5.4 + Responses path, especially because:

  • the request reaches the provider and fails server-side with schema validation
  • the failing array index moves around
  • multi-turn follow-up messages are more likely to trigger the problem than fully self-contained one-turn prompts
  • /reset and full gateway restart do not reliably eliminate it

Proposed Fix (optional)

Likely fixes:

  1. Do not force custom GPT-5 providers onto the Responses path unless the endpoint fully supports OpenAI Responses semantics
  2. Add strict validation before sending Responses input items and drop malformed function_call items whose name is empty
  3. Add debug logging around Responses payload construction / replay so the malformed item can be identified without exposing user content

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be fixed by adding strict validation to drop malformed function_call items with empty name before sending Responses input items.

Guidance

  • Validate the function_call items in the Responses input array to ensure they have a non-empty name before sending the request to the provider.
  • Consider adding debug logging around Responses payload construction to identify the source of the malformed items without exposing user content.
  • Review the custom GPT-5 provider's support for OpenAI Responses semantics to determine if it should be used with the Responses path.
  • Test the fix with different input indexes and scenarios to ensure the issue is fully resolved.

Example

# Example validation code
def validate_function_call(item):
    if not item['name']:
        return False
    return True

# Filter out malformed items before sending the request
input_items = [item for item in input_items if validate_function_call(item)]

Notes

The provided debug report and logs suggest that the issue is related to the serialization or replaying of invalid Responses API items. The proposed fix focuses on adding validation to prevent these items from being sent. However, further investigation may be needed to determine the root cause of the empty name values.

Recommendation

Apply the workaround by adding strict validation to drop malformed function_call items, as this is a targeted fix that addresses the specific issue reported.

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