adding support meta data flow#45256
Open
achauhan-scc wants to merge 3 commits intoAzure:lusu/agentserver-1110from
Open
adding support meta data flow#45256achauhan-scc wants to merge 3 commits intoAzure:lusu/agentserver-1110from
achauhan-scc wants to merge 3 commits intoAzure:lusu/agentserver-1110from
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ific logic The hosting framework now merges all request metadata into request_context as-is, letting the agent/tool layer handle interpretation (e.g. token reassembly for the 512-char metadata limit). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding support for metadata flow - request headers and user token propagation to agent tools.
This pull request enhances how HTTP request headers and metadata are passed through the agent server, making selected headers and request metadata available to the agent and its tools without involving the LLM. The changes introduce a mechanism for capturing specific headers from incoming requests, storing them in the agent context, and making them accessible throughout the agent's lifecycle.
Core improvements to request context handling:
_PASSTHROUGH_HEADERSset inbase.pyto specify which headers (such asauthorization,x-request-id, andx-user-authorization) should be captured from incoming HTTP requests.dispatchmethod inbase.pyto extract and log all incoming headers, filter for passthrough headers, and include them in theAgentRunContextfor each request.Agent run context enhancements:
AgentRunContextclass to accept an optionalheadersdictionary, store it, and provide aheadersproperty for access. This allows downstream consumers to retrieve the captured headers as needed. [1] [2]Agent framework integration:
_request_headers), making it accessible to tools during agent execution without LLM involvement.