Skip to content

fix(responses): restore parity with chat completions and refactor parsing#21

Merged
frostming merged 15 commits intomainfrom
responses
Mar 9, 2026
Merged

fix(responses): restore parity with chat completions and refactor parsing#21
frostming merged 15 commits intomainfrom
responses

Conversation

@PsiACE
Copy link
Collaborator

@PsiACE PsiACE commented Mar 1, 2026

Description

This PR restores behavioral parity between chat completions and responses when use_responses=true, and
improves maintainability.

What changed

  • Fixed main-path parity across stream and non-stream flows.
  • Completed responses streaming parsing for:
    • text deltas
    • tool-call deltas
    • usage events
  • Fixed non-stream responses tool schema conversion (prevents tool-call request failures).
  • Refactored parsing out of ChatClient into dedicated adapters:
    • clients/parsing/completion.py
    • clients/parsing/responses.py
    • clients/parsing/common.py
  • Aligned reasoning_effort handling:
    • forwarded correctly for completions
    • mapped to reasoning.effort for responses (explicit reasoning still wins)
  • Added default stream_options.include_usage=true for completion streaming when not explicitly set.

Commits included

  1. d8c3349 fix: restore responses parity across main paths
  2. de41fa9 refactor: split chat parsing into completion and responses adapters
  3. de27115 fix: align reasoning and stream usage defaults across chat and responses

@PsiACE PsiACE requested review from frostming and yihong0618 March 1, 2026 18:22
@PsiACE PsiACE requested a review from frostming March 2, 2026 17:20
PsiACE and others added 15 commits March 9, 2026 11:37
- re-enable responses path for streaming when use_responses is enabled\n- normalize responses streaming tool-call events (arguments + output_item)\n- preserve call_id mapping and support usage from in_progress/failed/incomplete events\n- convert tool schemas for non-stream responses API calls\n- add sync/async parity matrix tests for use_responses=false/true and refactor test fixtures for maintainability
…rser

Signed-off-by: Frost Ming <me@frostming.com>
@frostming frostming merged commit 9ba1011 into main Mar 9, 2026
6 checks passed
@frostming frostming deleted the responses branch March 9, 2026 03:51
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.

3 participants