Skip to content

fix: route GPT-5.6 tools+reasoning through the Responses API - #7

Merged
jkyberneees merged 2 commits into
mainfrom
feat/e2e-openai-reasoning
Sep 7, 2026
Merged

fix: route GPT-5.6 tools+reasoning through the Responses API#7
jkyberneees merged 2 commits into
mainfrom
feat/e2e-openai-reasoning

Conversation

@molty3000

Copy link
Copy Markdown
Contributor

Summary

  • GPT-5.6 Chat Completions 400s function tools with a non-none reasoning_effort; the learn-once fallback pinned effort to none and silently disabled reasoning.
  • Route those turns to POST /v1/responses with reasoning.effort and a summary so thinking stays on; thinking=disabled still uses Chat Completions with none.
  • Live-probed on gpt-5.6-luna with tools: POST /v1/responses, reasoning tokens present.

Test plan

  • go test -count=1 -timeout 120s .
  • go test -tags e2e -run TestE2EOpenAIReasoning -timeout 5m with OPENAI_E2E_MODEL=gpt-5.6-luna

jkyberneees and others added 2 commits September 7, 2026 14:50
New live suite (build tag e2e, OPENAI_API_KEY from env or .env, model
overridable via OPENAI_E2E_MODEL, default gpt-5-mini):

- TestE2EOpenAIReasoningBuffered: Thinking=medium must surface reasoning
  (reasoning_content text or Usage.ReasoningTokens) with canonical finish.
- TestE2EOpenAIReasoningStreaming: reasoning deltas/tokens are probed
  softly — gpt-5-mini sometimes skips reasoning on short prompts, and
  provider-side elision is not an SDK contract.
- TestE2EOpenAIReasoningDisabled: Thinking=disabled round-trips cleanly
  (effort omitted, call succeeds).

Verified live: buffered observed 128 reasoning tokens; all three pass.
Chat Completions rejects function tools with a non-none reasoning_effort
on gpt-5.6-*, and the learn-once fallback pinned effort to none. Those
calls now go to POST /v1/responses so thinking stays on.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jkyberneees
jkyberneees merged commit 222f646 into main Sep 7, 2026
7 checks passed
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.

2 participants