Skip to content

fix: preserve first-party attribution in MCP discovery events - #189

Merged
AgentTanuki merged 1 commit into
mainfrom
codex/mcp-first-party-attribution
Sep 8, 2026
Merged

fix: preserve first-party attribution in MCP discovery events#189
AgentTanuki merged 1 commit into
mainfrom
codex/mcp-first-party-attribution

Conversation

@AgentTanuki

Copy link
Copy Markdown
Owner

MCP discovery calls carrying valid first-party headers were still recorded as external when the client used a normal SDK identity. This caused our Google ADK TypeScript validation for google/adk-docs#2210 to add nine apparent external paid-offer exposures and one apparent new actor.

Validate classification once per MCP tool request and carry only the first-party flag and role into shared event recording. Keep the client handshake identity intact and reset the context after each call, including failures. Existing authentication and payment behavior are unchanged.

Add a read-time correction for the exact observed validation window (2026-09-08 13:16:45.477651–13:16:46.276347 UTC, MCPClient/1.0.0). Source events remain append-only and this generic SDK identity remains eligible outside that window. The eight separate agent-card entries have unresolved ownership and are not reclassified here.

Validation:

  • 100 focused attribution, MCP, first-party authentication and settlement tests passed.
  • 18 focused tests passed with the SQLite backend selected.
  • New tests use actual in-process Streamable HTTP requests with current, rotating, legacy, invalid and missing tokens; verify same-session reset, concurrent isolation, error cleanup, token privacy, client identity and historical window boundaries.
  • Independent review found no actionable issues and reran all 10 new tests successfully. No production requests, registrations or payments were used to validate this fix.

@AgentTanuki
AgentTanuki merged commit 18e577f into main Sep 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant