Skip to content

feat: share runtime with async HTTP payments - #189

Draft
parvahuja wants to merge 1 commit into
parv/payment-runtime-v0.11from
parv/runtime-async-http-v0.12
Draft

feat: share runtime with async HTTP payments#189
parvahuja wants to merge 1 commit into
parv/payment-runtime-v0.11from
parv/runtime-async-http-v0.12

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 28, 2026

Copy link
Copy Markdown
Member

Stack 4 of 8 · depends on #184 · next: #190

Summary

  • let asynchronous HTTP payments use a shared PaymentRuntime
  • add explicit origin policy and correctly scoped challenge cookies
  • protect against repeated challenges, concurrent duplicate sends, and uncertain payment outcomes
  • preserve streaming and event behavior while delaying close through a committed paid retry
  • keep the owned AnyIO loop reusable when a callback raises a non-Exception base exception

Safety boundary

A paid request is retried only when its challenge and outcome are safe to reuse. Ambiguous post-payment failures fail closed instead of risking a second payment.

Scope

Async HTTP only. This PR does not add sync HTTP, HTTPX adapters, global instrumentation, or MCP integration.

Validation

  • 861 passed, 41 skipped
  • adversarial coverage for origin matching, cookies, duplicate sends, close races, replay protection, unknown outcomes, and callback aborts
  • Ruff, formatting, Pyright, diff checks, and Python 3.11–3.14 CI pass

Managed as a stacked change with GitHub Stacks.

@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 6e78f47 to 400c0ce Compare July 28, 2026 18:26
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch 2 times, most recently from 3a41578 to 3bba0fd Compare July 28, 2026 23:22
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 3bba0fd to 02a2323 Compare July 29, 2026 00:43
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 02a2323 to 8a0fe70 Compare July 29, 2026 01:01
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