Skip to content

feat!: AI wrappers always send through capture_ai - #1027

Open
eli-r-ph wants to merge 1 commit into
v1-capture-harnessfrom
v1-capture-ai-wrappers
Open

eli-r-ph wants to merge 1 commit into
v1-capture-harnessfrom
v1-capture-ai-wrappers

Conversation

@eli-r-ph

@eli-r-ph eli-r-ph commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #1026. AI wrapper events went to the analytics endpoint unless enable_full_ai_capture was set, and that endpoint caps an event near 1 MB. The AI endpoint accepts up to 8 MiB, but reaching it also meant turning off truncation and media redaction. This PR always sends wrapper events through capture_ai, and enable_full_ai_capture now controls content only.

Changes

  • The OpenAI, Anthropic, Gemini, LangChain, Claude Agent SDK and OpenAI Agents integrations always use capture_ai, through one helper.
  • A client object without capture_ai still receives capture calls.
  • The deprecated _use_ai_lane and _enable_multimodal_capture aliases keep working.
  • MCP events stay on capture, because they are not $ai_* events.

Warning

  • Tests that assert on mock.capture for a wrapper now see mock.capture_ai.
  • A deployment that does not serve /i/v1/ai/events now drops wrapper events.

This differs from the sdk-specs capture-ai spec, which ties routing to the flag; a spec change is still to be proposed.

💚 How did you test it?

  • Every wrapper suite now asserts on capture_ai with the flag off.
  • A real-client test checks that wrapper events reach only the AI endpoint, with the flag off and on.
  • Restoring the old flag gate fails 311 tests.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Written with Cursor (Claude Opus) under the direction of the assignee.

🤖 Generated with Claude Code

@eli-r-ph

eli-r-ph commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@eli-r-ph
eli-r-ph marked this pull request as ready for review October 7, 2026 20:44
@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 7, 2026 20:44
@eli-r-ph
eli-r-ph force-pushed the v1-capture-harness branch from 743d8ca to ca9c26c Compare October 8, 2026 16:25
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch from 17eeb3b to 054e194 Compare October 8, 2026 16:25
@eli-r-ph
eli-r-ph force-pushed the v1-capture-harness branch from ca9c26c to e743d1e Compare October 8, 2026 18:13
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch from 054e194 to d909586 Compare October 8, 2026 18:13
@eli-r-ph
eli-r-ph force-pushed the v1-capture-harness branch from e743d1e to 78973e7 Compare October 8, 2026 21:12
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch 2 times, most recently from 19134a6 to d569aca Compare October 8, 2026 22:54
@eli-r-ph
eli-r-ph force-pushed the v1-capture-harness branch from 78973e7 to 9dcf4df Compare October 8, 2026 22:54
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch from d569aca to a473b99 Compare October 8, 2026 23:40
@eli-r-ph
eli-r-ph force-pushed the v1-capture-harness branch from 9dcf4df to d31608d Compare October 8, 2026 23:40
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch from a473b99 to fd66496 Compare October 10, 2026 23:35
enable_full_ai_capture now controls only truncation and media redaction. A client object without capture_ai still gets capture calls.
@eli-r-ph
eli-r-ph force-pushed the v1-capture-ai-wrappers branch from fd66496 to dde4812 Compare October 11, 2026 20:17

This branch has not been deployed

No deployments
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.

2 participants