pub async fn scope_origin_id<F, T>(origin_id: String, fut: F) -> Twhere
F: Future<Output = T>,Expand description
Runs fut with the active context’s invocation_id replaced by
origin_id, preserving source and mcp_tool.
The daemon and the browser bridge scope this around a request they serve on
behalf of a CLI/MCP client, so the HTTP records that request spawns
correlate to the originating invocation rather than the server’s own
(#1198). source is deliberately preserved: a request served inside the
daemon keeps source = Daemon, so via_daemon detection is unaffected while
invocation_id now points at the caller’s invocation record.