Skip to content

fix(openai): preserve Responses call state - #412

Open
amxson wants to merge 1 commit into
singnet:mainfrom
amxson:fix/408-responses-roundtrip
Open

amxson wants to merge 1 commit into
singnet:mainfrom
amxson:fix/408-responses-roundtrip

Conversation

@amxson

@amxson amxson commented Oct 25, 2026

Copy link
Copy Markdown

Description

Fixes #408.

The OpenAI Responses converter used the response item's id as the native tool-call correlation ID, losing the distinct call_id required to pair a function call with its result. Non-function output items such as reasoning state were also discarded before the immediate follow-up request.

This change:

  • preserves the original Responses call_id through native tool execution and the corresponding tool result;
  • carries provider-native response output as optional opaque state for the immediate follow-up;
  • replays the original Responses output in order without duplicating function calls;
  • leaves other providers unchanged when no native replay state is present.

This does not change multi-turn history retention or provider error/lifecycle behavior from #409.

How Has This Been Tested?

  • Added focused OpenAI Responses regression coverage for call correlation, reasoning replay, parallel calls, and generic-provider fallback.
  • New regression tests: 4 passed.
  • Focused provider/budget/timeout tests: 71 passed.
  • Provider model tests: 27 passed.
  • Full Python suite: 246 passed, 3 skipped.
  • MeTTa suites: 6 passed.
  • Mandatory suite: 243 passed.
  • Native-loop probe verified one function call, preserved reasoning state, and correct call_id round-trip.
  • Original v0.1.21 OpenAI Responses converter loses call_id and opaque reasoning replay #408 fixture now returns:
    {"call_ids": ["call_actual_73", "call_actual_73"], "reasoning_replayed": true}
  • git diff --check: passed.

Checklist

  • PR contains autogenerated code
  • Self-review completed
  • Test scenarios above are passed with the version of the code from PR

This branch has not been deployed

No deployments
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.

v0.1.21 OpenAI Responses converter loses call_id and opaque reasoning replay

1 participant