Skip to content

feat(trace): cover live call-create HTTP - #303

Draft
OnlineChef (ChefGroep) wants to merge 2 commits into
feat/trace-responses-websocketfrom
feat/trace-live-call-create
Draft

OnlineChef (ChefGroep) wants to merge 2 commits into
feat/trace-responses-websocketfrom
feat/trace-live-call-create

Conversation

@ChefGroep

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

Copy link
Copy Markdown
Contributor

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.


PR-stack (mergen van onder naar boven; elke PR bouwt op de vorige):

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

Base van deze PR = de branch van de PR erboven in de lijst (#296 = main).

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant