hermes - 💡(How to fix) Fix Internal bookkeeping fields leak to strict providers, causing HTTP 400 retry loops

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

HTTP 400: Error from provider: 2 request validation errors:
Extra inputs are not permitted, field: 'messages[70]._empty_recovery_synthetic', value: True
Extra inputs are not permitted, field: 'messages[71]._empty_recovery_synthetic', value: True

Root Cause

Three internal markers are written into message dicts but never stripped at the transport layer:

FieldSet inPurpose
_empty_recovery_syntheticconversation_loop.py:3625Marks empty-response recovery messages
_thinking_prefillconversation_loop.py:3667Marks thinking-only prefill turns
_empty_terminal_sentinelconversation_loop.py:3744Marks empty terminal result messages

_thinking_prefill is stripped in some code paths, but _empty_recovery_synthetic and _empty_terminal_sentinel have no stripping logic anywhere. ChatCompletionsTransport.convert_messages() — the transport safety net — also doesn't touch them.

Fix Action

Fix / Workaround

Impact

  • Session becomes permanently broken once any of these fields enter messages
  • Error classifier retries the deterministic 400, producing "model provider failed after retries"
  • Only workaround is starting a new session (history=0)

Code Example

HTTP 400: Error from provider: 2 request validation errors:
Extra inputs are not permitted, field: 'messages[70]._empty_recovery_synthetic', value: True
Extra inputs are not permitted, field: 'messages[71]._empty_recovery_synthetic', value: True
RAW_BUFFERClick to expand / collapse

While using opencode-go with Hermes, internal bookkeeping fields (_empty_recovery_synthetic, _thinking_prefill, _empty_terminal_sentinel) are not stripped from messages before API calls. Once they enter conversation history, every subsequent turn fails with a deterministic HTTP 400, triggering a retry loop.

Error

HTTP 400: Error from provider: 2 request validation errors:
Extra inputs are not permitted, field: 'messages[70]._empty_recovery_synthetic', value: True
Extra inputs are not permitted, field: 'messages[71]._empty_recovery_synthetic', value: True

Root cause

Three internal markers are written into message dicts but never stripped at the transport layer:

FieldSet inPurpose
_empty_recovery_syntheticconversation_loop.py:3625Marks empty-response recovery messages
_thinking_prefillconversation_loop.py:3667Marks thinking-only prefill turns
_empty_terminal_sentinelconversation_loop.py:3744Marks empty terminal result messages

_thinking_prefill is stripped in some code paths, but _empty_recovery_synthetic and _empty_terminal_sentinel have no stripping logic anywhere. ChatCompletionsTransport.convert_messages() — the transport safety net — also doesn't touch them.

Impact

  • Session becomes permanently broken once any of these fields enter messages
  • Error classifier retries the deterministic 400, producing "model provider failed after retries"
  • Only workaround is starting a new session (history=0)

Related PRs I found

  • PR #26054 — targeted the same _empty_recovery_synthetic leak; closed, not merged
  • PR #28958 / #29594 — stripped tool_name for strict providers; closed, not merged
  • PR #21242 — merged but only addressed persistence, not wire-format stripping

Proposed fix

Strip all three fields in:

  1. ChatCompletionsTransport.convert_messages() (transport safety net)
  2. conversation_loop.py main loop message builder
  3. chat_completion_helpers.py summary/final-response path

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

hermes - 💡(How to fix) Fix Internal bookkeeping fields leak to strict providers, causing HTTP 400 retry loops