Skip to content

fix: subagent trace propagation HUD-738 - #323

Merged
lorenss-m merged 1 commit into
mainfrom
fix/subagent-trace-propagation
Feb 12, 2026
Merged

lorenss-m merged 1 commit into
mainfrom
fix/subagent-trace-propagation

Conversation

@ryantzr1

@ryantzr1 ryantzr1 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Small, additive fallback in tool-call tracing with a focused test; only affects how trace context is derived during MCP tool execution.

Overview
Fixes trace propagation in Environment._env_call_tool by falling back to mcp.server.lowlevel.server.request_ctx to extract _hud_trace_id/trace_id from MCP request metadata when it isn’t present in tool arguments or forwarded kwargs.

Adds an async test that seeds request_ctx with meta and asserts AgentTool evaluation (run_eval) receives the expected trace_id.

Written by Cursor Bugbot for commit ae9d592. This will update automatically on new commits. Configure here.

@ryantzr1
ryantzr1 force-pushed the fix/subagent-trace-propagation branch from 73191e9 to ae9d592 Compare February 11, 2026 03:01
@ryantzr1
ryantzr1 marked this pull request as ready for review February 11, 2026 03:03
@ryantzr1 ryantzr1 changed the title fix: extract trace_id from MCP request_ctx since FastMCP drops meta k… fix: subagent trace propagation HUD-738 Feb 11, 2026
@ryantzr1
ryantzr1 marked this pull request as draft February 11, 2026 03:06
@ryantzr1
ryantzr1 marked this pull request as ready for review February 11, 2026 05:05
@lorenss-m
lorenss-m merged commit 9c51184 into main Feb 12, 2026
11 of 13 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