Skip to content

fix: post-merge review fixes for v0.2.10 - #402

Merged
rejojer merged 7 commits into
mainfrom
fix/post-merge-review
Aug 13, 2026
Merged

fix: post-merge review fixes for v0.2.10#402
rejojer merged 7 commits into
mainfrom
fix/post-merge-review

Conversation

@rejojer

@rejojer rejojer commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Conformant responses() envelope: official output (model items only) + items (full transcript for round-trip), verified against real OpenAI API
  • Usage details aggregated across turns (cached_tokens, reasoning_tokens) on both OpenAI surfaces
  • Python floor corrected to >=3.10 (litellm stable channel requires it; verified in clean venv)
  • Three stale anthropic>=0.84.0 hint strings updated to 0.108.0
  • Image-stub behavior disclosed on as_openai_tools / as_anthropic_tools docstrings
  • Non-essential comments trimmed (−61 lines)

Test plan

  • 267 tests passed locally
  • Live A/B vs real OpenAI API: field-identical to official hand-rolled flow
  • Response.model_validate passes on non-stream envelope
  • Stream events validate against official ResponseStreamEvent union
  • Clean 3.10 venv install + full suite verified
  • Round-trip prefix tests confirm cache contract unchanged

… items, full usage details

- output now carries only model-produced items, so the envelope parses
  with the official openai SDK types (function_call_output is input
  vocabulary — the real API never returns it in output)
- the full process transcript moves to the new items field; round-trip
  appends items instead of output (same bytes, so the provider
  prompt-cache prefix contract is unchanged)
- usage aggregates token details across turns (cached_tokens,
  cache_write_tokens, reasoning_tokens) on both OpenAI surfaces — cache
  hits are now observable instead of discarded
- streaming stops synthesizing the nonstandard tool-output event; every
  stream event now validates against the official event union, tool
  results arrive in the terminal envelope's items
- tests: two conformance tests pin the contract (non-stream
  model_validate + per-event stream validation); round-trip prefix
  tests append items

Verified: 267 tests green; live A/B against the real OpenAI API —
field-identical to the official hand-rolled flow, round-trip accepted
with zero repeat tool calls.
pyproject raised the floor in f58cca1 (0.84-0.107 execute a refusal
turn's tool_use blocks); the three user-facing strings still pointed
hand-installers at the broken range.
…ertising tool surfaces

as_openai_tools / as_anthropic_tools cloud docstrings advertised the
image tool without mentioning that the in-process bridge replaces
base64 payloads with text placeholder stubs (mcp_bridge call_tool).
litellm's stable channel (every release satisfying our >=1.84.0 floor)
and both agent extras require 3.10; on 3.9 pip resolution fails on the
hard deps (verified in a clean venv — zero packages install). A clean
3.10 venv with all three extras runs the full suite green. CI already
tests 3.10/3.13 only. The >=3.7 claim was inherited from the two-dep
0.2.8 client and was already unsatisfiable then (openai>=1.70 needs
3.8). Closes recurring review finding #10.
53 comment lines removed: rationale that belongs in commit messages,
descriptions restating what adjacent code or function names already
show, and cloud-implementation provenance notes. Section headers and
constraint comments (protocol invariants, safety guards) kept.
@rejojer
rejojer force-pushed the fix/post-merge-review branch from 5860c7c to 9485de6 Compare August 13, 2026 06:56
@rejojer
rejojer merged commit ec342c4 into main Aug 13, 2026
8 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.

1 participant