Skip to content

Improve observation naming, capture web search and local shell calls#25

Merged
jannikmaierhoefer merged 1 commit into
mainfrom
claude/codex-tracing-improvements-b5jyad
Jul 14, 2026
Merged

Improve observation naming, capture web search and local shell calls#25
jannikmaierhoefer merged 1 commit into
mainfrom
claude/codex-tracing-improvements-b5jyad

Conversation

@jannikmaierhoefer

Copy link
Copy Markdown
Member

What

  • Generation names: generations are now named LLM (or LLM Subagent inside subagent threads) instead of the raw model name. The model is still recorded on the observation's model attribute, so model breakdowns and cost inference are unaffected.
  • Subagent turns: nested subagent turn roots are named Codex Subagent Turn (previously a second identical Codex Turn), making subagent activity distinguishable in the trace tree.
  • Tool observation names now say what ran, not just which tool:
    • Shell: exec_command: git status (the bash -lc wrapper is stripped, command collapsed to one truncated line)
    • Web search: web_search: <query>
    • MCP: server.tool — the clean server/tool split taken from mcp_tool_call_begin/end events instead of the mangled server__tool function name
    • The raw tool name is preserved in codex.tool_name metadata.
  • Web search calls are now captured — previously web_search_call response items and web_search_begin/end events were silently dropped (the README claimed otherwise). The response item and end event are merged regardless of which is written to the rollout first.
  • local_shell_call response items are now captured (the built-in shell tool used by some models) — these had the same gap.

Validation

  • 6 new tests plus a new fixture covering web search, local shell, and MCP tool calls; 35/35 tests pass.
  • Verified end-to-end by running the built hook against the fixtures and inspecting the resulting traces in Langfuse: turn root → LLM generation → web_search: <query> / local_shell: git status / server.tool spans, nested Codex Subagent TurnLLM Subagent, with usage, WARNING/ERROR levels, and interruption flags intact.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Cj5proPC8sHJmTP5DKmx8


Generated by Claude Code

- Name generations "LLM" ("LLM Subagent" in subagent threads) instead of
  the raw model name; the model stays on the observation's model attribute.
- Name subagent turn roots "Codex Subagent Turn" so they are
  distinguishable from main-thread turns in the trace tree.
- Enrich tool observation names with what was called: the shell command
  ("exec_command: git status"), the web search query, or the MCP
  server/tool split from mcp_tool_call_* events; keep the raw tool name in
  codex.tool_name metadata.
- Capture web_search_call response items and web_search_begin/end events
  (previously dropped entirely), merging them regardless of rollout order.
- Capture local_shell_call response items for models using the built-in
  local shell tool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Cj5proPC8sHJmTP5DKmx8
@jannikmaierhoefer jannikmaierhoefer merged commit 0503624 into main Jul 14, 2026
2 checks passed
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