Skip to content

Add agent payment instrumentation hook#168

Draft
parvahuja wants to merge 1 commit into
parv/agent-payment-runtimefrom
parv/agent-instrumentation
Draft

Add agent payment instrumentation hook#168
parvahuja wants to merge 1 commit into
parv/agent-payment-runtimefrom
parv/agent-instrumentation

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • add opt-in mpp.agent.instrument(...) process-wide instrumentation
  • patch httpx.AsyncClient.send for future and existing clients without requiring framework-specific wrappers
  • patch MCP ClientSession.call_tool when the MCP SDK is available, preserving raw tool-call result shapes
  • delegate all payment work to the shared PaymentRuntime from Add agent payment runtime #170
  • add one minor changelog fragment

Stacked on #170 for PaymentRuntime.

Validation

  • uv run --all-extras --group dev ruff check .
  • uv run --all-extras --group dev ruff format --check .
  • uv run --all-extras --group dev pyright
  • uv run --all-extras --group dev pytest tests/test_agent.py tests/test_client.py tests/test_mcp_client.py tests/test_mcp.py -q

@parvahuja parvahuja force-pushed the parv/agent-instrumentation branch from 6bc3649 to 2c6eb3d Compare July 7, 2026 13:48
@parvahuja parvahuja changed the base branch from main to parv/fix-mcp-challenge-core-metadata July 7, 2026 13:48
@parvahuja parvahuja force-pushed the parv/fix-mcp-challenge-core-metadata branch from d4e42cc to bd35f53 Compare July 7, 2026 13:49
@parvahuja parvahuja force-pushed the parv/agent-instrumentation branch from 2c6eb3d to 116d4e7 Compare July 7, 2026 15:36
@parvahuja parvahuja changed the title Add opt-in agent payment instrumentation Add agent payment instrumentation hook Jul 7, 2026
@parvahuja parvahuja changed the base branch from parv/fix-mcp-challenge-core-metadata to parv/agent-payment-runtime July 7, 2026 15:36
@parvahuja parvahuja force-pushed the parv/agent-payment-runtime branch 2 times, most recently from 0e4bad5 to 945682b Compare July 7, 2026 18:22
@parvahuja parvahuja force-pushed the parv/agent-instrumentation branch from 116d4e7 to b6d7050 Compare July 7, 2026 18:24
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