Skip to main content

decide_with_task_origin

Function decide_with_task_origin 

Source
pub fn decide_with_task_origin(
    call: &Call,
    response: &ResponsePeek,
    prices: &PriceBook,
    task_origin: Option<&Call>,
) -> Charge
Expand description

Decide an exchange while supplying the call that created a polled task.

A tasks/get request carries no Mcp-Name, so its terminal response cannot be priced correctly without the attribution captured from the original tools/call. Callers must persist that association when they observe a resultType: "task" response and pass it here on subsequent polls.