Skip to content

Release reservations rejected during session validation - #94

Closed
j0sh wants to merge 6 commits into
mainfrom
ja-codex/session-reservation-cleanup
Closed

j0sh wants to merge 6 commits into
mainfrom
ja-codex/session-reservation-cleanup

Conversation

@j0sh

@j0sh j0sh commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Validate buffered Node session replies in call_runner() before using a session ID from an offchain reply. Onchain replies must match the ID from the payment challenge. If validation fails, use that challenge ID for one best-effort stop through the existing Node stop endpoint and preserve the original error.

Session selection skips single-shot runners and tries the next candidate after a rejected reply, even if the stop fails.

@j0sh
j0sh marked this pull request as ready for review November 20, 2026 20:06
Copilot AI balanced review requested due to automatic review settings November 20, 2026 20:06
@j0sh j0sh closed this Nov 20, 2026
@j0sh
j0sh deleted the ja-codex/session-reservation-cleanup branch November 20, 2026 20:07

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

Exact-match paid reservations are incorrectly rejected when challenge IDs contain surrounding whitespace, and cleanup skips some accepted IDs, leaving rejected reservations allocated.

3 open issues

Review effort: Balanced

if is_session:
if missing := next((key for key in ("session_id", "app_url", "control_url") if not _string_value(data.get(key))), None):
raise LivepeerGatewayError(f"runner session response missing {missing}")
if session_id and not (session_id == data["session_id"] == data["session_id"].strip()):
Comment on lines +985 to +987
if is_session and re.fullmatch(r"[\w-]{1,128}", session_id, re.ASCII):
with contextlib.suppress(Exception):
await _post_empty(_join_endpoint(runner_url, f"{session_id}/stop"), allow_redirects=False)
Comment on lines +985 to +987
if is_session and re.fullmatch(r"[\w-]{1,128}", session_id, re.ASCII):
with contextlib.suppress(Exception):
await _post_empty(_join_endpoint(runner_url, f"{session_id}/stop"), allow_redirects=False)
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