Skip to content

fix: strip reasoning item IDs from Responses API input when store=False#10217

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-10486c83
Apr 15, 2026
Merged

fix: strip reasoning item IDs from Responses API input when store=False#10217
teknium1 merged 1 commit into
mainfrom
hermes/hermes-10486c83

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Fixes a 404 error when using GPT-5.x models on the Responses API. With store=False (our default), reasoning items from previous turns were replayed with their id fields, causing the API to attempt a server-side lookup that fails since nothing was persisted.

Error:

Item with id 'rs_01a228e5...' not found. Items are not persisted when store is set to false.

Root cause: _chat_messages_to_responses_input and _preflight_codex_input_items both included the id field on reasoning items sent back to the API. The encrypted_content blob is self-contained for reasoning chain continuity — the id triggers an unnecessary (and failing) server-side lookup.

Fix: Strip id from reasoning items in both conversion layers. The id is still used for local deduplication (preventing duplicate reasoning items across turns) but never sent to the API.

Changes

  • run_agent.py: Strip id from reasoning items in _chat_messages_to_responses_input and _preflight_codex_input_items
  • tests/run_agent/test_run_agent_codex_responses.py: Update dedup tests to verify IDs are stripped

Test plan

  • 43 codex_responses tests pass
  • E2E verification confirms IDs stripped while dedup preserved

Reported by @zuogl448 (GPT-5.4 via proxy).

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
@teknium1 teknium1 merged commit a4e1842 into main Apr 15, 2026
6 of 7 checks passed
@teknium1 teknium1 deleted the hermes/hermes-10486c83 branch April 15, 2026 10:19
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…se (NousResearch#10217)

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…se (NousResearch#10217)

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…se (NousResearch#10217)

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…se (NousResearch#10217)

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…se (NousResearch#10217)

With store=False (our default for the Responses API), the API does not
persist response items.  When reasoning items with 'id' fields were
replayed on subsequent turns, the API attempted a server-side lookup
for those IDs and returned 404:

  Item with id 'rs_...' not found. Items are not persisted when store
  is set to false.

The encrypted_content blob is self-contained for reasoning chain
continuity — the id field is unnecessary and triggers the failed lookup.

Fix: strip 'id' from reasoning items in both _chat_messages_to_responses_input
(message conversion) and _preflight_codex_input_items (normalization layer).
The id is still used for local deduplication but never sent to the API.

Reported by @zuogl448 on GPT-5.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant