Skip to content

Add session stop API, store session tokens - #83

Merged
j0sh merged 1 commit into
mainfrom
ja/session-stop
Oct 23, 2026
Merged

j0sh merged 1 commit into
mainfrom
ja/session-stop

Conversation

@j0sh

@j0sh j0sh commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Store token from reserved events and make them available to session events.

Add LiveRunnerRegistration.stop_session() so apps can stop sessions before receiving application traffic.

Store token from `reserved` events and make them available to session events.

Add LiveRunnerRegistration.stop_session() so apps can stop sessions
before receiving application traffic.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Session callbacks can receive empty tokens despite cached credentials, breaking operations that rely on the event token.

1 open issue
What changed in this PR

Adds token-backed session management so live-runner apps can stop reserved sessions before receiving application traffic.

Changes:

  • Cache reservation tokens and expose a token field on session events.
  • Add stop_session() with credential validation and replacement-reservation protection.
  • Add tests for stopping sessions, failure handling, and token refresh behavior.
File Description
tests/​test_live_runner.py Tests session stopping and reservation-token tracking.
src/​livepeer_gateway/​live_runner.py Adds token storage, event token exposure, and the stop API.
CHANGELOG.md Documents the new session-management API and event field.

Review effort: Balanced

Comment thread src/livepeer_gateway/live_runner.py
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.

2 participants