Skip to content

fix: support GPT-5.6 Responses reasoning - #853

Open
jmdots wants to merge 4 commits into
mpfaffenberger:mainfrom
jmdots:fix/reasoning-api-746
Open

fix: support GPT-5.6 Responses reasoning#853
jmdots wants to merge 4 commits into
mpfaffenberger:mainfrom
jmdots:fix/reasoning-api-746

Conversation

@jmdots

@jmdots jmdots commented Aug 23, 2026

Copy link
Copy Markdown

Summary

  • support GPT-5.6 OpenAI aliases through the Responses API
  • configure native reasoning mode/context and encrypted reasoning replay
  • preserve signed empty reasoning parts needed before tool calls
  • preserve complete streamed output items, including encrypted reasoning
  • add regression coverage for model settings, compaction, and response reconstruction

Closes #746

Compatibility note

Existing conversations created before this change may contain incomplete or incompatible Responses API reasoning history. Resuming those conversations may not work reliably; start a fresh conversation if resume fails.

Testing

  • uv run pytest tests/test_compaction_reasoning.py tests/test_model_factory_reasoning.py tests/test_chatgpt_codex_client.py -q (61 passed)

@jmdots

jmdots commented Aug 23, 2026

Copy link
Copy Markdown
Author

This isn't right, yet. I think it has something to do with "all_turns" reasoning context.

"/REDACTED/REDACTED/src/code_puppy/.venv/lib/python3.13/site-packages/pydantic_ai/models/ope
nai.py", line 221, in _map_api_errors
    raise ModelHTTPError(
        status_code=status_code, model_name=model_name, body=e.body,
headers=dict(e.response.headers)
    ) from e
pydantic_ai.exceptions.ModelHTTPError: status_code: 400, model_name: gpt-5.6-luna,
body: {'message': "Item 'REDACTED' of
type 'message' was provided without its required 'reasoning' item:
'REDACTED'.", 'type':
'invalid_request_error', 'param': 'input', 'code': None}

@jmdots
jmdots marked this pull request as draft August 23, 2026 00:51
@jmdots
jmdots force-pushed the fix/reasoning-api-746 branch from c0f480f to 7e3e2e0 Compare August 23, 2026 03:48
@jmdots
jmdots marked this pull request as ready for review August 23, 2026 03:49
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.

GPT-5.x models added with /add_model fail with tools due to reasoning_effort

1 participant