Skip to content

fix(responses): preserve valid replay item graphs (#97427) - #98942

Closed
lgy1027 wants to merge 1 commit into
NousResearch:mainfrom
lgy1027:fix/responses-replay-item-ids
Closed

lgy1027 wants to merge 1 commit into
NousResearch:mainfrom
lgy1027:fix/responses-replay-item-ids

Conversation

@lgy1027

@lgy1027 lgy1027 commented Aug 31, 2026

Copy link
Copy Markdown

Fixes #97427.

When replaying encrypted reasoning with store: false, the server-side reasoning ID is intentionally omitted. This change also omits the paired assistant-message ID, preventing the API from rejecting an incomplete replay graph.

It preserves short message IDs for turns without replayed encrypted reasoning and for messages after a reasoning-to-tool round, retaining cache reuse where the graph is independent.

Tests cover:

  • paired reasoning/message replay
  • plain assistant-message replay
  • direct preflight normalization
  • a reasoning → tool-call → tool-output → independent-message boundary

Validation:

  • uv run --extra dev pytest tests/agent/test_codex_responses_adapter.py -q
  • uv run --extra dev ruff check agent/codex_responses_adapter.py tests/agent/test_codex_responses_adapter.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state duplicate This issue or pull request already exists labels Aug 31, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #97445. Both repair the same Responses replay invariant: an assistant message ID must be removed when its encrypted-reasoning ID is stripped. #97445 is the earlier, broader open fix.

@lgy1027 lgy1027 closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GPT-5.6 Responses rejects replayed assistant message when Hermes strips its required reasoning item ID

2 participants