Repository navigation
Conversation
LiveRunnerCallStream.session_id carries the answered payment challenge's
manifest_id, as LiveRunnerCallResult.session_id already does for unary calls;
it is "" when no challenge was answered.
Errors raised from a call_runner attempt carry payment_sent, True when that
attempt's request already carried Livepeer-Payment headers, and manifest_id,
the paid challenge's manifest_id ("" when unpaid). A gateway may fail over to
another runner only while payment_sent is False, and can attribute the
network cost of a paid call that failed. When the challenge retries run out,
payment_sent covers every attempt and manifest_id is the last paid one.
manifest_id is the key the signer's create_signed_ticket Kafka event carries
as manifest_id; it is not the event's session_id (the signer state id) or
pm_session_id (the orchestrator ticket params' recipientRandHash).
Replayed onto livepeer/livepeer-python-gateway main without the multipart
commit this change was previously stacked on.
Selection keeps each failed attempt as capacity, unreachable, or other, and copies payment_sent and the paid manifest id onto the rejection so a gateway can stop after a paid attempt.
This was referenced Oct 6, 2026
Refactor the error handling in LivepeerGatewayError and related classes to replace the manifest_id with auth_ids, which now captures the signer auth IDs for each payment session. This change allows for better tracking of payment sessions across errors and runner rejections, ensuring that the system can accurately attribute costs and manage retries based on the associated auth IDs. Update tests to reflect these changes and ensure proper functionality.
This branch has not been deployed
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.
Summary
call_runneralready returns the paid challenge'smanifest_idasLiveRunnerCallResult.session_id. A stream now does the same onLiveRunnerCallStream.session_id, and it is""when no challenge was answered.call_runnerattempt carrypayment_sentandmanifest_id.payment_sentis true only after that attempt's request includedLivepeer-Paymentheaders, so a gateway can fail over to another runner only before payment.manifest_idis the paid challenge's id, so a failed paid call can still be joined to the signer'screate_signed_ticketevent. It is not the signer state id orpm_session_id.payment_sentcovers every attempt andmanifest_idis the last paid one.Test plan
uv run --frozen --group lint ruff checkon the three changed filesuv run --frozen --group test pytest --cov=livepeer_gateway --cov-branch(254 passed)errors.pyandlive_runner.py(no issues)payment_sentis false