Repository navigation
Add payment session callback for runner calls - #81
Merged
Merged
Conversation
Support sync and async on_payment_session callbacks in call_runner and expose LivePaymentSession.manifest_id for payment attribution. Invoke the callback for each new session. Validate segCreds when parsing signer responses and remove redundant caller checks. Cover callback ordering, failures, and cancellation.
j0sh
requested review from
rickstaa
and
a balanced review from Copilot
and removed request for
Copilot
October 20, 2026 03:23
Copilot stopped reviewing on behalf of
j0sh due to an error
October 20, 2026 03:24
1 of 2 tasks
eliteprox
reviewed
Oct 20, 2026
eliteprox
left a comment
Collaborator
There was a problem hiding this comment.
Still reviewing the error handling and payment status reporting, but here is one nit
eliteprox
previously approved these changes
Oct 21, 2026
eliteprox
left a comment
Collaborator
There was a problem hiding this comment.
Overall changes lgtm and test fine. Added one more suggestion to call_runner.
For context, we're using the on_payment_session callback with manifest_id in builder-core to confirm if payment was sent for the job.
There was a problem hiding this comment.
🟢 Approval recommended
Static review identified no blocking issues in callback handling or signer validation, and the added tests cover the key failure paths; tests were not executed.
No open issues 🎉
What changed in this PR
Adds payment-session notifications to runner calls, allowing callers to attribute payments using the session’s manifest ID.
Changes:
- Supports synchronous and asynchronous callbacks for each new payment session, before dispatching the paid request.
- Exposes
LivePaymentSession.manifest_idand centralizessegCredsvalidation in signer-response parsing. - Adds tests for callback ordering, failures, cancellation, and manifest attribution.
| File | Description |
|---|---|
tests/test_live_runner.py |
Tests callback sequencing, error propagation, and cancellation. |
tests/test_live_payment_session.py |
Verifies the exposed manifest ID. |
src/livepeer_gateway/remote_signer.py |
Adds the manifest property and validates segment credentials centrally. |
src/livepeer_gateway/live_runner.py |
Implements payment-session callbacks and removes redundant validation. |
src/livepeer_gateway/__init__.py |
Exports the callback type. |
CHANGELOG.md |
Documents the new callback and manifest property. |
Review effort: Balanced
eliteprox
reviewed
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support sync and async on_payment_session callbacks in call_runner and expose LivePaymentSession.manifest_id for payment attribution. Invoke the callback for each new session.
Validate segCreds when parsing signer responses and remove redundant caller checks. Cover callback ordering, failures, and cancellation.