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

Runtime stack 2 of 5 · depends on #184 · next: #190

Summary

  • let PaymentTransport use a shared PaymentRuntime
  • add explicit origin policy and correctly scoped challenge cookies
  • prevent duplicate/repeated payments and retain uncertain outcomes until reconciliation
  • keep active paid retries leased through runtime close
  • preserve request replay, streaming, redirects, and payment events

Review boundary

Async HTTP only. Reusable HTTP parsing, origin, cookie, and outcome-ledger primitives live in client/_http.py; the transport remains a linear send → challenge → credential → retry flow. Failure payload construction is centralized, but the flow is not hidden behind a generic state machine. No owned loop, sync transport, global HTTPX patching, or MCP changes.

Validation

  • full suite: 843 passed, 41 skipped
  • adversarial origin, cookie, redirect, duplicate-send, close-race, replay, and uncertain-outcome coverage
  • Ruff, formatting, and Pyright pass

@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 2 times, most recently from 8a0fe70 to dfa2ccb Compare July 29, 2026 03:33
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from dfa2ccb to 614712c Compare July 29, 2026 03:50
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 614712c to 9eb8ee3 Compare July 29, 2026 19:25
Comment thread src/mpp/client/_http.py
Comment thread src/mpp/client/_http.py Outdated
Comment thread src/mpp/client/_http.py
Comment thread src/mpp/client/_http.py
Comment thread src/mpp/runtime.py Outdated
Comment thread src/mpp/runtime.py Outdated
Comment thread README.md
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 9eb8ee3 to 72c4ba6 Compare July 29, 2026 21:04
@parvahuja
parvahuja force-pushed the parv/runtime-async-http-v0.12 branch from 72c4ba6 to 0f7be38 Compare July 29, 2026 21:49
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