Skip to content

fix: harden async payment retries - #202

Draft
parvahuja wants to merge 2 commits into
parv/minimal-payment-runtimefrom
parv/async-payment-safety
Draft

fix: harden async payment retries#202
parvahuja wants to merge 2 commits into
parv/minimal-payment-runtimefrom
parv/async-payment-safety

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Parse merged WWW-Authenticate fields correctly, including multiple schemes and quoted commas.
  • Pass one-shot async bodies through for ordinary responses and reject them only after a payable 402 requires replay.
  • Close failed challenge reads and surface cancelled or failed credentialed retries as the shared PaymentOutcomeUnknownError.
  • Reuse that same outcome error from the existing MCP client instead of maintaining a second type.

This remains async and transport-local. It adds no sync bridge, global instrumentation, thread lifecycle, or origin policy.

Stack: 2 of 2, on #201. The repository's full CI intentionally runs only for PRs targeting main; it will run here after #201 merges and this PR is retargeted.

Validation

  • 797 passed, 41 skipped
  • Ruff check and format check
  • Pyright
  • Clean diff check
  • Hermes Agent 0.19.0 plugin-loader smoke on HTTPX 0.27.2 and 0.28.1: sync, async, pre-existing clients, worker threads, origin policy, recursion bypass, repeated/concurrent challenge protection, uncertain outcomes, and in-flight shutdown all passed

@parvahuja
parvahuja force-pushed the parv/minimal-payment-runtime branch from aadc1b9 to d380a50 Compare July 30, 2026 19:43
@parvahuja
parvahuja force-pushed the parv/async-payment-safety branch from 134d387 to 4d47c66 Compare July 30, 2026 19:43
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