Skip to content

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

Open
PsiACE wants to merge 14 commits intomainfrom
responses
Open

fix(responses): restore parity with chat completions and refactor parsing#21
PsiACE wants to merge 14 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 added 3 commits March 1, 2026 17:48
- 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
@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
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