[Feature]: Single-request metadata trace for Codex client tools on the Cursor adapter

Aperta
#8,866 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
34/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start with the v2.100.3 paths named in the issue: parseRequest, createCursorRequest, prepareCursorRunRequest, planMcpArgsHandling, mapCursorProtobufServerMessage, and parseConnectEndStreamError. Run the offline synthetic fixtures to trace where declaration, wire, return, and relay classifications are available. Done means an opt-in trace for one request and correlated continuations reports those stages using metadata only, then turns off automatically.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement tools
Area

Tools / MCP and Cursor adapter observability

What are you trying to accomplish?

Diagnose one Codex Desktop Responses turn that ends without a client-tool event. For the same request, distinguish (a) the tool or its deferred entry point was not forwarded, (b) Cursor returned assistant text rather than a structured tool call, (c) a structured Cursor call was observed but could not be relayed as a client tool event, and (d) an upstream error. This is an observation request, not a request to execute untrusted text, retry, or weaken validation.

What prevents this today?

On released v2.100.3, the request history shows route and terminal status, and provider debug has a request tool count and frame types. Those do not establish whether one particular declaration survived all the way to the Cursor wire and which output it produced on the same request. Cache diagnostics do not expose tool names. A successful HTTP response or an assistant string containing [Tool Result] is not proof of execution.

Offline synthetic reproduction (v2.100.3)

Using the v2.100.3 tag, pass a synthetic Responses request with model cursor/gemini-4-argon, input Synthetic handoff fixture, and a namespace declaration mcp__codex_app containing a function send_message_to_thread with a synthetic string prompt argument. No servers or model calls are needed. Call parseRequest → createCursorRequest → prepareCursorRunRequest and decode the bytes using AgentClientMessageSchema to inspect runRequest.mcpTools. For the return path, feed synthetic Cursor frames to planMcpArgsHandling / mapCursorProtobufServerMessage (or a synthetic Connect terminal to parseConnectEndStreamError). None of these fixtures executes the tool.

Synthetic variation Observed declaration / wire / upstream / downstream
Declared namespaced tool; structured mcpArgs, providerIdentifier=opencodex-responses, matching wire name, synthetic prompt declared / present / structured tool / tool event
Same declaration with tool_choice: "none"; synthetic frame attempts the omitted tool anyway declared / absent / structured tool / adapter rejects an unadvertised tool
Same declaration; textDelta containing CallDynamicTool({"toolName":"send_message_to_thread"}) followed by [Tool Result] declared / present / text / text, no tool event
Same declaration; synthetic Connect end-stream {"error":{"code":"unavailable","message":"synthetic"}} declared / present / upstream error / error, no tool event
Declare only the freeform functions.exec entry point exec entry point visible; nested send-tool availability still unknown until host discovery

These are offline adapter fixtures, not evidence that any live turn had a particular upstream failure. The missing feature is a way to see the equivalent stage classifications for one actual request without capturing the request body.

Expected behaviour

An opt-in, local trace for one explicitly armed request or one turn (including only that turn's correlated continuations), then automatically off. For example, a row could report: declared=direct | exec_only | absent, cursor_wire=direct | exec_only | absent | unobserved, cursor_return=tool | text | upstream_error | unobserved, and relay=tool | text | adapter_error | none, with fixed reason codes where known. If multiple frame types occur, preserve the distinctions rather than inferring from the final HTTP status. If only exec is visible, mark the nested tool as unknown without host evidence.

Please keep it metadata-only: no prompts, arguments, tool outputs, raw schema or frames, headers, credentials, or account/session identifiers in exported diagnostics. No global capture, permanent logs, tool-policy changes, or automatic replays needed.

Related, but different
  • #8132 / #8492 address guidance for reaching deferred tools; they do not expose this request-scoped evidence.
  • #2317 and #8538 involve behavior after a tool already executed; #1217 is about transport-stage timing and failure attribution, not tool declaration and relay evidence.
Checks
  • I searched existing issues and documentation.
  • This describes a concrete OpenCodex workflow and synthetic reproduction.
  • No secrets, personal data, private chat, or customer material are included.
Lingua principale
TypeScript
Stelle
16.9k
Fork
1.3k
Merge medio
1g 4h
PR unite (30g)
814

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lidge-jun/opencodex

Tutte le issue di lidge-jun/opencodex

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.