Skip to content

Commit a74fa91

Browse files
committed
fix(server): pop adcp.auth_info from tool_ctx.metadata after extraction
_build_ctx now pops metadata["adcp.auth_info"] after calling _extract_auth_info, preventing the AuthInfo object from surviving into RequestContext.metadata where it would be opaque to downstream serializers. Mirrors the existing adcp.buyer_agent pop pattern. https://claude.ai/code/session_01R254Wmibw6fxiDDTvhuw9b
1 parent 078d0aa commit a74fa91

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/adcp/decisioning/handler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ def _build_ctx(
961961
the next dispatch.
962962
"""
963963
auth_info = self._extract_auth_info(tool_ctx)
964+
# Pop adcp.auth_info after extraction so the AuthInfo object doesn't
965+
# survive into RequestContext.metadata, where it would be opaque to
966+
# downstream serializers. Mirrors adcp.buyer_agent on the next line.
967+
if tool_ctx.metadata:
968+
tool_ctx.metadata.pop("adcp.auth_info", None)
964969
buyer_agent = tool_ctx.metadata.pop("adcp.buyer_agent", None) if tool_ctx.metadata else None
965970
return _build_request_context(
966971
tool_ctx,

0 commit comments

Comments
 (0)