Skip to content

feat: capture the Responses API, and any framework through a capturing HTTP transport - #14

Merged
kbhatnagar1506 merged 3 commits into
mainfrom
capture-everywhere
Oct 6, 2026
Merged

kbhatnagar1506 merged 3 commits into
mainfrom
capture-everywhere

Conversation

@kbhatnagar1506

Copy link
Copy Markdown
Owner
  • wrap() now also captures client.responses.create (streamed or not, sync or async). Those calls always go to the model: compiled answers come in Chat Completions' and Anthropic's shapes. The trail says unsupported: responses api.
  • agentcompile.http_client() / async_http_client() / transport(): capture from frameworks whose client you don't hold (LangChain, LiteLLM, CrewAI, Pydantic AI, the OpenAI Agents SDK), over httpx or httpx2 (newer anthropic takes only httpx2). Capture only.
  • A stream counts as whole when it reached its own end marker: the SDKs stop reading at [DONE] / message_stop before the transport stream runs out. A gzip body cut short decodes as far as it goes.
  • Captured Responses calls keep model, input, instructions, tools, previous_response_id and OpenAI's server-side conversation.

Tested: 103 tests (25 new), ruff clean. End to end with a real model in kbhatnagar1506/agent-compiler's capture-everywhere PR (scripts/proofs/capture_everywhere.py): Gemini conversations through wrap and through http_client() stored whole on the server.

🤖 Generated with Claude Code

kbhatnagar1506 and others added 3 commits October 4, 2026 22:23
…g HTTP transport

wrap() now also captures client.responses.create (streamed or not, sync or async); those
calls always go to the model. agentcompile.http_client()/async_http_client()/transport()
capture the model calls of frameworks whose client you don't hold (LangChain, LiteLLM,
CrewAI, Pydantic AI, the OpenAI Agents SDK), over httpx or httpx2. A stream counts as whole
when it reached its own end marker, since SDKs stop reading there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on 3.9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kbhatnagar1506
kbhatnagar1506 merged commit ad1c326 into main Oct 6, 2026
5 checks passed
@kbhatnagar1506
kbhatnagar1506 deleted the capture-everywhere branch October 6, 2026 23: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.

1 participant