Skip to content

fix(mcp): include tool-host correlation context in errors#992

Open
Osraka wants to merge 1 commit into
paradigmxyz:mainfrom
Osraka:osraka/tool-host-observability-context
Open

fix(mcp): include tool-host correlation context in errors#992
Osraka wants to merge 1 commit into
paradigmxyz:mainfrom
Osraka:osraka/tool-host-observability-context

Conversation

@Osraka

@Osraka Osraka commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Preserve tool-host correlation context on MCP tool call results and include it in error messages.

run_tool_host_call already creates a request id and receives the session execution id for the sandbox-backed tool-host call, but ToolHostCallOutput only carried the sandbox id back to the MCP layer. When a tool timed out, returned a non-zero status, or produced non-JSON output, the user-facing MCP error could not point directly at the execution/request that operators need for trace/log lookup.

This keeps the existing behavior and error shape, but adds the request/execution ids to the context string used in MCP tool-host errors, for example:

failed in sandbox sbx-..., execution exe-..., request mcp-call-...

Tests

  • cargo test -p centaur-api-server mcp::mcp_tests -- --nocapture
  • cargo test -p centaur-session-runtime -- --nocapture
  • cargo fmt --check
  • git diff --check

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.

1 participant