Skip to content

fix(runtime): preserve OpenAI and Gemini reasoning replay#258

Merged
mgoldsborough merged 1 commit into
NimbleBrainInc:mainfrom
dom-mp:openai-reasoning
May 25, 2026
Merged

fix(runtime): preserve OpenAI and Gemini reasoning replay#258
mgoldsborough merged 1 commit into
NimbleBrainInc:mainfrom
dom-mp:openai-reasoning

Conversation

@dom-mp
Copy link
Copy Markdown
Contributor

@dom-mp dom-mp commented May 20, 2026

Summary

Fixes #257.
OpenAI reasoning models can reject multi-tool replay when a prior function_call is replayed without its paired reasoning item. NimbleBrain was applying the older-reasoning stripping optimization globally, even though that behavior was only intended for Anthropic thinking/signature bloat.
This PR makes reasoning replay policy provider-aware:

  • Anthropic keeps the existing older-reasoning stripping behavior.
  • OpenAI preserves reasoning history so Responses API tool-call replay remains valid.
  • Gemini preserves reasoning/thought metadata so replay-sensitive thoughtSignature data stays intact.

Testing

  • bun test test/unit/window.test.ts
  • bun run check
  • bun run format:check
  • bun run lint

Only strip older reasoning blocks for Anthropic so OpenAI and Gemini can replay provider-required reasoning/tool-call metadata intact.
Fixes NimbleBrainInc#257
@mgoldsborough mgoldsborough added the qa-reviewed QA review completed with no critical issues label May 25, 2026
@mgoldsborough mgoldsborough merged commit 7307489 into NimbleBrainInc:main May 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa-reviewed QA review completed with no critical issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants