Skip to content

[stack 8/8] feat(trace): cover live call-create HTTP - #311

Draft
OnlineChef (ChefGroep) wants to merge 2 commits into
stack/20261005-07-trace-websocketfrom
stack/20261005-08-trace-live-call
Draft

OnlineChef (ChefGroep) wants to merge 2 commits into
stack/20261005-07-trace-websocketfrom
stack/20261005-08-trace-live-call

Conversation

@ChefGroep

@ChefGroep OnlineChef (ChefGroep) commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Stacked re-landing of #303 (feat/trace-live-call-create). Position 8/8; base: stack/20261005-07-trace-websocket. Merge bottom-up; each layer is a real merge of the original PR head, so the diff shows only that PR plus any conflict resolution (noted in the merge commit message).

Stack

# Layer Original
1/8 #304 feat: make prompt cache behavior measurable #296
2/8 #305 feat: expand providers and make native model discovery account-aware #297
3/8 #306 feat(gui): start auth-inspired OpenCodex redesign #299
4/8 #307 feat(trace): opt-in trace store linked to usage.jsonl #298
5/8 #308 feat(trace): add safe local trace reader #300
6/8 #309 feat(trace): cover compact and response-cache hits #301
7/8 #310 feat(trace): cover Responses WebSocket turns #302
8/8 #311 feat(trace): cover live call-create HTTP #303

Original description:

Summary

Adds opt-in trace-store coverage for live/realtime call-create HTTP:

  • POST /v1/live
  • POST /v1/realtime/calls

This PR is intentionally stacked on feat/trace-store / #298 and remains separate from long-lived live/realtime sideband WebSocket tracing.

Design

Live call-create is a bounded request/response lifecycle, so it can reuse the ordinary trace contract safely:

  1. capture the bounded inbound client request
  2. run handleLive inside the per-request trace context
  3. record the final provider wire body immediately before the bounded upstream POST
    • ChatGPT multipart requests therefore capture the rewritten JSON provider body
    • API-key requests capture their multipart provider body
  4. record the bounded SDP/upstream response
  5. finalize through the existing usage/request-log path

The live implementation already enforces LIVE_REQUEST_MAX_BYTES and LIVE_RESPONSE_MAX_BYTES, so tracing does not introduce an unbounded body path.

Verification

Exact head 737afa047b2c5a6ced9142618f9fb2292df700a4:

  • complete live HTTP + sideband regression file: 16 pass, 0 fail
  • the real ChatGPT multipart→backend JSON test verifies:
    • request hash
    • rewritten outbound provider-body hash
    • response hash
    • request/outbound/response byte counts
  • bun x tsc --noEmit ✅
  • bun run privacy:scan ✅
  • git diff --check ✅

A clean-tree full repository suite is the final local gate.

Boundary

Long-lived live/realtime sideband WebSockets remain out of scope here. They require a session-oriented trace model with bounded per-direction frame aggregates, binary-frame handling, and close/error finalization rather than ordinary request-body accumulation.

Dependency

Stacked on #298. Merge/rebase only after the trace-store parent lands.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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