Feature request for product/service
Cursor IDE
Describe the request
When Cursor sends POST /v1/chat/completions to a user-configured OpenAI-compatible base URL, include stable identity headers on every request:
- x-cursor-conversation-id
- The chat/conversation id (same id hooks already report as conversation_id)
- x-cursor-agent-id
- The agent that issued this request (subagent id for Task runs)
- x-cursor-parent-agent-id
- The spawning agent, when nested
This is the shape Claude Code’s LLM gateway protocol has and is close to what Codex (thread-id, x-codex-parent-thread-id) and OpenCode (x-session-affinity, x-parent-session-id) do.
Opt-in via a setting is fine. Only sending it to custom base URLs (not Cursor’s own backend) is fine. Sending it all the time is fine.
Why
We run a gateway in front of model traffic and want per-conversation analytics. Other gateway products like LiteLLM and PortKey definitely suffer from this same problem.
With a conversation id (and other things) on the wire we can trivially answer things that are currently out of reach:
- How latency, TTFT, and cost scale as a conversation’s context grows turn over turn.
- The real cost/latency impact of compaction events and manual context engineering
- Cache-hit behavior across a conversation
- Subagent fan-out: how much of a session’s spend and wall-clock is parent vs. Task children.
Every one of these is a join across requests.
Without an id, we have an array of anonymous completions that can probably be coalesced with some fancy and (maybe) expensive postprocessing, but it would be wicked nice to have this just be way easier.
What I tried
I built correlation without using hooks (beforeSubmitPrompt, afterAgentResponse, afterAgentThought, preToolUse) that call our gateway out-of-band, plus content fingerprinting - normalize and SHA-256 the prompt (or assistant output) on both sides and join the hook event to the inflight request after the fact. It works for single conversations but is very inconsistent with plan->build handoffs and subagents.
If headers aren’t feasible, a body field (metadata.cursorConversationId or equivalent) would solve most of this too.
Ref: Gateway protocol reference - Claude Code Docs
Related bug that got in my way: `subagentStop` never fires for background subagents; documented `summary` / `modified_files` / `agent_transcript_path` missing or null
Would love an intentional feature for this or advice from someone on how to do this with current tools.
Operating System (if it applies)
MacOS