Flow ExecutionContext with JsonRpcMessage (#616)
The primary goal of this change is to support IHttpContextAccessor in tool calls when the Streamable HTTP is in its default non-Stateless mode.
This commit is contained in:
parent
5f1c74f1ff
commit
a88ef0deb7
1 changed files with 61 additions and 14 deletions
|
|
@ -91,6 +91,11 @@ internal sealed class StreamableHttpPostTransport(StreamableHttpServerTransport
|
|||
|
||||
message.RelatedTransport = this;
|
||||
|
||||
if (parentTransport.FlowExecutionContextFromRequests)
|
||||
{
|
||||
message.ExecutionContext = ExecutionContext.Capture();
|
||||
}
|
||||
|
||||
await parentTransport.MessageWriter.WriteAsync(message, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue