Skip to content

v0.6.12

Choose a tag to compare

@imsid imsid released this 21 Jun 00:43
fa1d011

Two fixes on top of the one-session redesign.

MCP event session

MCPManager was created once with a fixed construction-time session_id and never refreshed, so mcp.tool.* / mcp.client.* events carried a stale session — obvious when an MCP tool runs inside a workflow (a phantom session appears). Fixed with a per-request bound_session_id contextvar (mirroring trace_id/host_id), bound in the request workflow and the in-process agent loop; MCP events read get_session_id() with the construction value as fallback.

Session/trace token accounting

  • list_recent_traces now reports per-trace total_tokens from the event log, so the admin session total equals the sum of its traces (Traces table gains a Tokens column).
  • get_session_info adds total_tokens (event-log spend across all agents in the session); the CLI /session shows it instead of the memory session_total_tokens, which compaction resets — so /session matches the admin.

418 tests pass.