You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(playback): stop a replaced player's segment requests from restarting the new stream - #4641
Related issue: N/A
Validation tasks: none (checked on the board: Distributed transcode nodes #1177 C1–C3 and #1178 are the only passed cases this reaches; clients that haven't opted in get unmarked URLs, and node failover keeps the marker for those that have)
When a replan starts a new HLS transcode on the same playback session, the player being replaced keeps requesting segments from its old playlist. The server served those requests from the new transcode and restarted it at the old player's position, so the stream the client was switching to was destroyed. Picking an ASS subtitle mid-play on Android TV hits this: the switch to server burn-in replans to a new transcode, and the old player's segment requests restarted it. At the end of the file the session then looped on 500 and 404 answers.
This change ties every HLS URL to the transcode that published it. A request from a replaced playlist now gets 404 playback_transport_superseded and can no longer wait for, restart, relay to or rebuild the current transcode.
Approach
A v3 HLS stream URL carries silo_transport, naming its transcode (the plan's output directory, or the transcode node's transport id), when the attempt's hls delivery lists the new feature hls_transport_marker_v1. /api/v2 advertises the feature. The playlist already copies its query into segment and rendition URIs, so a client that opts in carries the marker without handling it. Clients that check a media URL's query against the names they know refuse unknown parameters (the Apple app does), so clients that don't opt in get the same URLs as before.
The session records the marker of its current transcode. A replan that keeps the running transcode (a sidecar subtitle or rendition switch) keeps the same URL and marker. A seek restart and a move to another node after a failure keep it too.
A replan to direct play or remux also replaces the marker, so the old HLS player cannot bring the transcode back from the recipe in its URLs.
The API origin and the proxy's /stream/v3 grant routes enforce the check. /api/v2 reports it as the new problem type playback_transport_superseded and declares silo_transport on the HLS operations. URLs without the marker behave as before.
jellycompat needs no change: its URLs never carry the marker, and it has no v3 replan.
Known limits:
The server switches to the new transport before the replan answers, so the player being replaced can be refused while the client's own replan is in flight. §6 tells the client to wait for the replan's answer; a failed replan restores the previous transport and its URL.
A request that passes the check just before a replan swaps in its new transport, or that reaches the node-failure relay path at that moment, can still be served by the new transport.
The marker lives in the session's memory. After an API restart, the rebuilt session has none until its next replan, so a stale request in that window gets the old behavior once. A replan that keeps the running transcode recovers the marker from the URL it publishes again.
A proxy can only refuse while it still holds the session's grant. If a replan moves delivery off that proxy, it answers the old player as it answers any grant it no longer holds. It still relays nothing to the new transcode.
On ec6b06d (main merged in up to a16a247): internal/playback, internal/api/handlers, internal/proxy, internal/apiv2, internal/transcodenode and internal/jellycompat pass, as do go vet, make lint-changed, verify-apiv2-openapi, verify-apiv2-contract, verify-playback-fixtures, verify-local-paths and verify-bidi.
Focused Go tests for internal/playback, internal/proxy, internal/apiv2 and internal/api/handlers pass. The handler package needs umask 022 locally because of an existing upload-directory permission check that has nothing to do with this change.
make test-go, go vet ./..., gofmt, go mod tidy -diff, make lint-changed and make lint-router-recovery pass.
make verify-apiv2-openapi, verify-apiv2-web-types, verify-apiv2-contract (3 new optional query parameters, none breaking), verify-apiv2-fixtures, verify-route-inventory, verify-playback-fixtures, verify-settings-bindings-all, verify-local-paths, verify-case-collisions, verify-bidi, verify-size-ratchet and verify-migrations pass. Web format:check and the type check pass.
Not run locally: make test-web, the full web lint and build, verify-actionlint, verify-shellcheck and verify-prometheus-rules. This change touches none of their inputs except generated web locale and schema files.
On a7887cf (main merged in, the opt-in gate, the translation sync): internal/playback, internal/api/handlers, internal/proxy, internal/apiv2, internal/transcodenode and internal/jellycompat pass, as do make lint-changed, verify-apiv2-openapi, verify-apiv2-web-types, verify-apiv2-contract, verify-apiv2-fixtures, verify-playback-fixtures, verify-route-inventory, verify-local-paths, verify-bidi, the web type check and the backup web tests that failed on fb506c7. TestPrepareTransportV3KeepsHeaderAuthenticatedRemoteHLSBehindAPI fails on fb506c7 (the header-authenticated URL carried the marker) and passes with the gate.
On c422d2d (main merged in up to af8366f, and the stale-copy fix): internal/playback, internal/api/handlers, internal/proxy, internal/apiv2, internal/transcodenode and internal/jellycompat pass, as do make lint-changed, verify-apiv2-openapi, verify-apiv2-contract, verify-apiv2-fixtures, verify-playback-fixtures, verify-route-inventory, verify-local-paths and verify-bidi. TestTranscodeServeStaleCopyRelaysTheCurrentMarkedPlayer fails on d2536e7 (the current player was refused before main's stale-copy relay) and passes with the fix.
Checked by hand on the branch's first commit, before the review fixes: an Android TV player against a local server, switching a test file with many large embedded fonts ("H264 MoreFonts (2018)") to a burned-in ASS subtitle mid-play. The new stream kept playing.
Evidence
No screen changes; this is server behavior. Server log from the Android TV check before the fix, trimmed (session ids shortened). The new burn-in transcode started at segment 42, then the replaced player's request for segment 75 restarted it at 150 s:
After the fix, on this branch (becbb4705), the tests cover each path:
$ go test ./internal/api/handlers/ -run 'TestTranscodeServeRefusesSupersededTransport|TestReplanPlaybackV2SupersedesThePreviousTransportsURLs|TestReusedHLSTransportKeepsTheMarkerOfTheURLItRepublishes' -v
--- PASS: TestTranscodeServeRefusesSupersededTransport
--- PASS: .../segment_for_a_superseded_transport,_runtime_live (404 playback_transport_superseded, no wait, no seek restart)
--- PASS: .../segment_for_a_superseded_transport,_runtime_gone (404 playback_transport_superseded, nothing rebuilt)
--- PASS: .../segment_for_the_current_transport,_runtime_gone (old behavior)
--- PASS: TestReplanPlaybackV2SupersedesThePreviousTransportsURLs (quality replan and move to direct play)
--- PASS: TestReusedHLSTransportKeepsTheMarkerOfTheURLItRepublishes
$ go test ./internal/proxy/ -run TestProxyGrantTranscodeRefusesASupersededTransport -v
--- PASS: TestProxyGrantTranscodeRefusesASupersededTransport (no relay to the node; current marker relays)
$ go test ./internal/apiv2/ -run TestPlaybackDeliveryProblemTypes -v
--- PASS: TestPlaybackDeliveryProblemTypes/superseded_transport (404 problem type playback_transport_superseded)
Risks
A wrongly refused request would stop a player. Only clients that list hls_transport_marker_v1 get marked URLs. The marker is only compared when both the URL and the session have one, and every path that keeps the running transcode keeps or recovers the marker. Unmarked URLs from older plans are served as before.
/api/v2 gains an hls delivery feature, an optional query parameter and a problem type. All are additive.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code (via T3 Code); Codex CLI for code review
Adversarial review: four independent reviewers (gpt-6.2-sol, gpt-6.2-astra, claude-opus-5-5, claude-fable-5-2) checked the branch for correctness, standards and spec, and all four re-reviewed the follow-up commit. Fixed: a replan that kept the running transcode on a session rebuilt after a restart recorded a new marker and refused the current player; the proxy answered 503 instead of the superseded 404 after a replan to direct play; silo_transport was missing from the v2 contract; the problem type had no translation key; the v1 error header leaked into v2 problems. Documented as limits: proxy refusal after delivery leaves that proxy, and a stale request just after a restart. Dismissed as unlikely: a request that passes the check in the moment before a replan swaps in its new transcode, and a refusal during a replan whose database write then fails and rolls back.
Note
Stop replaced players' HLS segment requests from restarting the new stream
Adds the hls_transport_marker_v1 delivery feature: HLS stream URLs carry a silo_transport query parameter naming the session's transport generation, tracked on playback.Session.TransportGeneration and persisted via session stream state (transport_generation.go, session.go).
Media requests naming a superseded transport now get a prompt 404 with the playback_transport_superseded error code, on both API handlers (playback.go) and proxy grant routes (mediagrant.go), before any session touch, route setup, or transcode runtime reconstruction.
Updates OpenAPI schemas, the delivery-writer problem-type mapping in playback_delivery.go, and documents the feature in playback-protocol-v3.md; all locale catalogs add the new error message.
Fixes synthetic manifest query rewriting in manifest_variables.go: short queries below the per-URI savings threshold now stay literal instead of being substituted with an EXT-X-DEFINE variable.
Behavioral Change: requests without a marker, sessions without a recorded transport, and non-HLS deliveries are unaffected; a marked request against a grant with no transcode transport (moved to direct play) is now refused.
A replan can start a new HLS transport under the same playback session
id. The player being replaced keeps fetching segments by number from the
previous plan's playlist, and those requests seek-restarted the new
transport at the old player's position, so the stream the client was
switching to was destroyed (and at the end of the file the session
looped on 500/404).
Every v3 HLS stream URL now carries silo_transport, naming the transport
generation (the plan's output directory or transcode-node transport id).
The playlist echoes the query into its segment URIs, so playlist-relative
clients carry it unchanged. The session records the generation of its
current transport; a request naming another one answers 404
playback_transport_superseded before it can wait for, restart, relay to
or reconstruct a transport. The API origin and the proxy's /stream/v3
grant routes enforce it, and /api/v2 maps it to a problem type of the
same name. URLs without the marker keep the old behavior.
…rt markers
Use appendPlaybackQueryV3 and playbackTestRequest instead of local copies,
and share the superseded-transport message between the API and the proxy.
A session rebuilt after an API restart has no recorded transport
generation. A replan that reuses its running transport republished the
old URL but recorded a fresh generation, so the server refused the
player it had just kept. The reused transport now takes its generation
from the marker of the URL it republishes.
The proxy grant routes also answer a marked HLS request against a grant
that names no transport (a replan away from HLS) as superseded, matching
the API origin. The v2 contract declares silo_transport on the HLS
operations, v2 problems drop the v1 X-Silo-Playback-Error side channel,
and the new problem type gets its catalog key.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Protocol v3 can mark HLS URLs with a transport generation. Playback sessions track the current generation, and API and proxy handlers return a superseded-transport 404 for requests carrying an outdated marker. API contracts and localized messages document the response. Synthetic playlists also use a higher per-URI query-substitution threshold.
Changes: HLS transport generation
Layer / File(s)
Summary
Negotiate and track transport generations internal/playback/protocol_v3.go, internal/playback/session.go, internal/playback/transport_generation.go, internal/api/handlers/playback_v3.go, internal/api/handlers/playback_v3_test.go, internal/playback/testdata/protocol_v3/*, docs/design/schemas/playback-v3/v3/fixtures/valid/*
Protocol v3 advertises hls_transport_marker_v1. Session state records transport generations, and prepared or reused HLS URLs receive or retain their markers. Tests cover marker changes and reuse.
Playback API and proxy handlers reject stale markers before route handling, reconstruction, or relay. The v2 response mapping distinguishes the superseded-transport 404 from other 404 responses.
Document transport markers and responses contracts/api/v2/openapi.json, web/src/api/v2/schema.ts, docs/architecture/playback-protocol-v3.md, docs/playback-api.md, web/src/locales/*.json, web/src/locales/keys.ts, .silo-translations
API schemas and playback documentation describe marker handling and the superseded-transport response. Locale catalogs add the corresponding message, and the translation version metadata changes.
Synthetic playlist query substitution
Layer / File(s)
Summary
Keep short queries literal internal/playback/manifest_variables.go, internal/playback/transcode_manifest_test.go
Synthetic playlists now require at least 64 bytes of savings per URI before substituting a query. A test verifies that a short query remains literal across 7,200 segments.
sequenceDiagram
participant Player
participant PlaybackAPI
participant PlaybackSession
Player->>PlaybackAPI: Send HLS request with silo_transport
PlaybackAPI->>PlaybackSession: Compare marker with recorded generation
PlaybackAPI-->>Player: Return 404 playback_transport_superseded when generations differ
Loading
Suggested reviewers:quick104
Merge Risk: Moderate · up to a7887
This change makes stale HLS players receive a 404 playback_transport_superseded instead of restarting the current stream, and only for clients that opt in. The server logic looks coherent. Before merging, replace the local translations pin with a published release. Also correct the protocol document so it describes how the proxy treats marked requests after an API restart when the grant names no transport.
Security architecture risk: Low · up to a7887
The change improves isolation between old and replacement streams, but can permanently reject the active playlist before its replacement commits. If replacement fails, restoring the old plan cannot undo that terminal response. The demonstrated impact is limited to the affected playback session; no privilege expansion was established.
Retained concerns
Medium · reliability · inferred: Terminal supersession becomes externally visible before replacement commit. Remote transport preparation overwrites the live proxy grant, and session replacement installs the new generation before CompleteReplan succeeds. A concurrent request for the still-published old playlist can consequently receive terminal 404 playback_transport_superseded. If replacement application or persistence then fails, rollback restores the old plan and grant, but a conforming client may already have stopped that player without receiving a committed replacement. The new refusal turns an existing provisional publication window into an externally irreversible rollback failure.
Security review details
Security Blast Radius
inferred — The identified rollback failure affects the replanning session's marked media URLs. Existing user-ownership checks and proxy grant authorization bound the inspected request paths; the evidence does not establish a cross-user data-access or privilege-escalation path introduced by the marker.
Trust Boundaries and Controls
observed — Grant-backed proxy requests require an access-token JWT, an active login session, grant ownership, applicable remote-profile binding, a session-deny check, and the permitted egress assignment before the new marker refusal runs. The client-controlled marker selects no additional authority.
observed — The proxy's empty-transport-ID refusal does not establish a false refusal of current local HLS requests: locally prepared cards are assigned API egress, which the proxy rejects before reaching that comparison. Current remote generation and grant identity use the same transport ID.
Hardening Proposals
proposed — Separate provisional replacement identity from committed supersession. While rollback can restore the published plan, requests for that plan should remain serviceable or receive a retryable response rather than terminal invalidation.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: stopping a replaced player's segment requests from restarting the new stream. The changeset adds transport-generation markers on HLS URLs and rejects superseded segmen…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description states the problem (a replaced HLS player's segment requests restarting the new transcode), the approach (a silo_transport marker on HLS URLs, a 404 playback_transport_superseded check…
Full details: Title check
Explanation
The title names the main change: stopping a replaced player's segment requests from restarting the new stream. The changeset adds transport-generation markers on HLS URLs and rejects superseded segment requests with 404 playback_transport_superseded, which matches the title.
Full details: Description check
Explanation
The description states the problem (a replaced HLS player's segment requests restarting the new transcode), the approach (a silo_transport marker on HLS URLs, a 404 playback_transport_superseded check on the API and proxy, and an opt-in feature flag), validation, evidence, and risks. It matches the changeset, which touches playback handlers, proxy grant routes, protocol docs, OpenAPI schemas, and locale files.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Maintainability & Code Quality · Quick win
Replace the local- pin with a published release before this pull request merges.
version=local-dd2ed2628375 is a local-build pin. scripts/sync-translations rejects a local-* version in release mode and stops before it downloads anything, so a plain reinstall of this checkout fails. Per AGENTS.md, the client pull request must not merge with this pin. Wait for the silo-translations catalog change to publish its release, then run scripts/sync-translations --version <release>. That command writes version and sha256 for the release and regenerates the files from it.
Also confirm that the release catalog contains the new translation key. A release sync drops any generated key the published catalog lacks, and the dropped key then breaks the typecheck.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. This pin is intentional while Silo-Server/silo-translations#110 is open. Once it merges and publishes a release, I'll re-sync this branch with scripts/sync-translations --version <release> before merge.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ec6b06d (merge of main). Main pins 2026.11.22-d12da65, the first silo-translations release with error.playback_transport_superseded, and the branch now uses that pin. scripts/sync-translations --version 2026.11.22-d12da65 reproduces the committed locale files exactly, and the key is in all 41 locales.
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 5 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Retain distributed firing claims through their own validity windows
Resolve the problem catalog list (main added TypeNodeDeploymentManaged) and re-sync translations from main's catalog plus Silo-Server/silo-translations#110.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
silo-triageBot
added
size/XXXL
3000+ added + deleted lines (all files); change volume, not priority.
and removed
size/XL
500–999 added + deleted lines (all files); change volume, not priority.
labels
Nov 21, 2026
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 29c15c2a-3ef6-4288-b748-c290b07e29a4
Commits
Reviewing files that changed from the base of the PR and between 4c589a7 and e09544c.
Files selected for processing: 46
.silo-translations
contracts/api/v2/openapi.json
internal/apiv2/problem.go
web/src/api/v2/schema.ts
web/src/locales/ar-XB.json
web/src/locales/ar.json
web/src/locales/bg.json
web/src/locales/ca.json
web/src/locales/cs.json
web/src/locales/da.json
web/src/locales/de.json
web/src/locales/el.json
web/src/locales/en-XA.json
web/src/locales/en.json
web/src/locales/es.json
web/src/locales/et.json
web/src/locales/fi.json
web/src/locales/fr.json
web/src/locales/he.json
web/src/locales/hi.json
web/src/locales/hr.json
web/src/locales/hu.json
web/src/locales/id.json
web/src/locales/it.json
web/src/locales/ja.json
web/src/locales/keys.ts
web/src/locales/ko.json
web/src/locales/lt.json
web/src/locales/lv.json
web/src/locales/ms.json
web/src/locales/nb.json
web/src/locales/nl.json
web/src/locales/pl.json
web/src/locales/pt-BR.json
web/src/locales/pt-PT.json
web/src/locales/ro.json
web/src/locales/ru.json
web/src/locales/sk.json
web/src/locales/sl.json
web/src/locales/sv.json
web/src/locales/th.json
web/src/locales/tr.json
web/src/locales/uk.json
web/src/locales/vi.json
web/src/locales/zh-Hans.json
web/src/locales/zh-Hant.json
Files skipped from review as they are similar to previous changes: 1
web/src/locales/ar-XB.json
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Review of e09544c, after merging main into the branch. The diagnosis holds: on main, a segment request built from the replaced plan's URL seek-restarts the new transport. A test that runs on both main and this branch showed the new transport's start segment moving from 6 to 300 on main; on this branch the same request gets 404 playback_transport_superseded and the new transport is untouched. The findings below are on the lines they concern. The first one blocks merging.
One more point, not on a single line (disclosed in the PR, but with a wider effect than the description says): the recorded generation lives only in one API process's memory. Two sequences go further than "a stale request gets the old behavior once":
After a restart, or on a replica that rebuilds the session, the first request decides what the rebuilt session becomes. For a token-carrying URL (the web player), a request from the replaced player rebuilds the session from the old plan's recipe. The current player's requests then pass the check (the rebuilt session has no generation) and are served by, or seek-restart, the old transport.
A replica that still holds the session at an older generation refuses the current player's marker if a replan committed on another replica.
Two cheap ways to narrow both, without new storage: for a node-executed transport, read the generation from TranscodeTransportID, which the recovery card and the proxy grant already carry; for a local one, seed it from the attempt's stored current plan URL, which the header-authenticated rebuild already reads. This is a maintainer decision for the follow-up scope; I haven't changed it.
… builds
A header-authenticated plan URL now carries only the silo_transport marker. On a title past about 95 minutes, that query alone crossed the substitution threshold and the synthetic playlist became version 8 with EXT-X-DEFINE, which a client without hls_variable_substitution_v1 (AetherEngine) can't resolve. Apply the per-URI saving the rewritten playlists already require, so only a credential-sized query is substituted.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Reviewed head: c422d2d (the PR's commits, merges of main up to af8366f, and the commits from this review). Updated from the summary for 15302b0.
Fit: 8/10 · Readiness: 9/10 — conditional
Fit. This fixes a real playback failure: a replan that starts a new transcode, such as switching to a burned-in subtitle, was destroyed by the replaced player's segment requests. The server owns transport identity, so the guard belongs here. It adds an hls delivery feature, an optional query parameter and a problem type to /api/v2, all additive. It holds at 8 because the fix reaches a client only once that client opts in, which adds one more negotiated feature. That is also why the verdict stays conditional.
Readiness. The bug reproduces on main and is gone on this branch: a handler test using only code both sides share (start, quality replan, then a segment request from the replaced plan's URL) seek-restarted the new transport on main, and gets 404 playback_transport_superseded here. The gate keeps every current client on unmarked URLs, so nothing changes for them until they opt in. The translation pin and the validation board check, which held an earlier score at 7, are both settled. Merging main exposed one defect, now fixed (below).
c422d2d: fixes the finding on playback.go. Main's fix(playback): relay a stale session copy to its node instead of transcoding locally #4604 relays a request from a stale session copy (one that missed another replica's replan onto a node) to that node. The copy still recorded its own older generation, so the marker check refused the client's current player first. The check now gives way when the shared node recipe store still holds a recipe for the node transport the marker names. Every replan and teardown deletes that recipe before stopping the transport, so a replaced player is still refused. TestTranscodeServeStaleCopyRelaysTheCurrentMarkedPlayer fails without the fix and passes with it.
Settled since the last summary
Enforcement before the replan commits: settled by the §6 rule above. Moving the switch to commit time would reorder the replan for a window no client has opted into yet.
Check-then-serve window: accepted as a known limit. The window is the few lines between the check and the runtime lookup, plus the node-failure relay path. A re-check would narrow it but not close it.
Smaller points, not blocking: the proxy's CORS ExposedHeaders doesn't list X-Silo-Playback-Error, which §6 says the response carries; the generation check runs before the profile-ownership check, so another profile on the same account learns whether a marker is stale before it gets a 403; Session.TransportGeneration's comment says it's empty for non-HLS deliveries, but those get a synthetic one.
Tests on c422d2d: internal/playback, internal/api/handlers, internal/proxy, internal/apiv2, internal/transcodenode and internal/jellycompat pass, as do go vet on the touched packages, make lint-changed, verify-apiv2-openapi, verify-apiv2-contract, verify-apiv2-fixtures, verify-playback-fixtures, verify-route-inventory, verify-local-paths and verify-bidi. The shared-boundary replan test from the earlier summary failed on main. The new stale-copy test failed on the merged head before c422d2d. The PR's other new tests use symbols the PR adds, so they can't run on main.
All three found the check-then-serve window and the enforcement-before-commit ordering, now settled as above. Sol and Gemini found the playlist-version change (fixed in fb506c7). No new round ran for the last two updates. The first merged main and added one protocol-doc paragraph. This one merges main and adds a narrow fix with its own failing-then-passing test. Both merges were checked by hand against the overlapping code and by the tests above.
The silo_transport marker went on every v3 HLS URL. Apple's player
accepts only `seek` in a header-authenticated media URL's query, so it
refused every HLS transcode and remux plan.
The marker now needs the hls delivery feature hls_transport_marker_v1,
which /api/v2 advertises. Without it the URL stays as it was, and an
unmarked request is never refused, so clients keep today's behavior
until they opt in.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Files skipped from review as they are similar to previous changes: 41
web/src/locales/ar-XB.json
web/src/locales/ar.json
web/src/locales/bg.json
web/src/locales/ca.json
web/src/locales/cs.json
web/src/locales/da.json
web/src/locales/de.json
web/src/locales/el.json
web/src/locales/en-XA.json
web/src/locales/en.json
web/src/locales/es.json
web/src/locales/et.json
web/src/locales/fi.json
web/src/locales/fr.json
web/src/locales/he.json
web/src/locales/hi.json
web/src/locales/hr.json
web/src/locales/hu.json
web/src/locales/id.json
web/src/locales/it.json
web/src/locales/ja.json
web/src/locales/ko.json
web/src/locales/lt.json
web/src/locales/lv.json
web/src/locales/ms.json
web/src/locales/nb.json
web/src/locales/nl.json
web/src/locales/pl.json
web/src/locales/pt-BR.json
web/src/locales/pt-PT.json
web/src/locales/ro.json
web/src/locales/ru.json
web/src/locales/sk.json
web/src/locales/sl.json
web/src/locales/sv.json
web/src/locales/th.json
web/src/locales/tr.json
web/src/locales/uk.json
web/src/locales/vi.json
web/src/locales/zh-Hans.json
web/src/locales/zh-Hant.json
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
…requests
A proxy grant written after a replan away from HLS names no transport,
and the proxy refuses every marked HLS request against it. The grant
store outlives an API restart, so the restart fallback has this one
exception.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
…s own replan
The server switches to the new transport before the replan's response is
sent, so the player being replaced can be refused first. Tell clients to
wait for the replan's answer before acting, and that a failed replan
restores the previous transport and its URL.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's Silo-Server#4604 relays a request from a replica whose copy of the session
missed another replica's replan onto a transcode node. That copy still
records the transport generation of its own plan, so the superseded check
refused the client's current player before the relay could run.
When the marker differs from the copy's generation, the check now asks the
shared node recipe store whether the marker names a node transport of this
session that still runs. Every replan and teardown deletes that recipe
before stopping the transport, so a stored recipe marks the request
current and it is relayed; without one the request is still refused. A
copy with a node or local runtime of its own keeps the refusal.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Rerun on 15302b0 after main moved. The branch now conflicts with main, and one of main's new playback fixes interacts with the marker check. Details are on the line below. I'm merging main and fixing this in commits on this branch, so there's no need to change anything yourself.
The reason will be displayed to describe this comment to others. Learn more.
Stale runtimes cause current players to be rejected on other replicas
Requests routed to a replica with a stale runtime or node route can return playback_transport_superseded even though the player's transport is live elsewhere. Check the shared node recipe before trusting the local runtime or route, and relay to the matching current node.
Prompt for LLM
File internal/api/handlers/playback.go, lines 628-629:
Stale runtimes cause current players to be rejected on other replicas
A replica retaining an earlier local runtime or node route rejects the current player's marker before checking the shared node recipe, so requests routed to that replica return `playback_transport_superseded` even though the player's transport is live on another node. Resolve the marked transport against the shared recipe before treating the local runtime or route as authoritative, and relay to the matching current node.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Main gets these two cases wrong too, so this PR doesn't introduce them.
Stale copy that has its own node route. On main, relayOrRehomeTranscode forwards to the copy's own node and transport (remoteTransportID(session)), which the other replica's replan already stopped. It never forwards to the node the current token names.
Main's #4604 forwards only a copy that has neither, and c422d2d matches it: in that case a marked request is forwarded while the shared recipe store holds the transport's recipe. The repair suggested here would make a stale copy with its own route or runtime defer to another replica's plan, which is #4610's fix. It belongs there, so this change leaves it out. I'm leaving the thread open for the maintainers.
The reason will be displayed to describe this comment to others. Learn more.
That distinction makes sense. Both stale-copy cases already fail on main, and making those replicas defer to the current plan appears to belong with #4610 rather than this PR.
The marker does change the failure mode: a current player may now receive playback_transport_superseded where main would have relayed to the old node or served the old local transcode. That is a new refusal, but not a newly introduced loss of correct playback in the scenarios described.
I’d treat the suggested fix as out of scope and leave the thread open for maintainers to decide whether the changed failure mode needs additional documentation or follow-up.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I added the changed failure mode to the PR description's known limits, next to the #4610 note: a stale copy with its own node route or local transcode now answers the current player with playback_transport_superseded, and the #4610 fix has to let this check defer to the current plan too. I'm leaving the thread open for the maintainers.
The reason will be displayed to describe this comment to others. Learn more.
That captures the distinction: the PR changes the failure mode, while resolving the stale replica’s view of the current plan remains part of #4610. Leaving the thread open gives maintainers the opportunity to weigh in.
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
bugSomething isn't workingimpact: playbackCan't play, stalls, or wrong mediapriority: P1Core-path bug; painful workaround — next after P0size/XL500–999 added + deleted lines (all files); change volume, not priority.
2 participants
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.
Problem
Related issue: N/A
Validation tasks: none (checked on the board: Distributed transcode nodes #1177 C1–C3 and #1178 are the only passed cases this reaches; clients that haven't opted in get unmarked URLs, and node failover keeps the marker for those that have)
Other clients: Apple Silo-Server/silo-apple#1250 (accept
silo_transport, then opt in); Android Silo-Server/silo-android#1030 (opt in); Roku N/A (gets unmarked URLs and keeps today's behavior until it opts in)When a replan starts a new HLS transcode on the same playback session, the player being replaced keeps requesting segments from its old playlist. The server served those requests from the new transcode and restarted it at the old player's position, so the stream the client was switching to was destroyed. Picking an ASS subtitle mid-play on Android TV hits this: the switch to server burn-in replans to a new transcode, and the old player's segment requests restarted it. At the end of the file the session then looped on 500 and 404 answers.
This change ties every HLS URL to the transcode that published it. A request from a replaced playlist now gets
404 playback_transport_supersededand can no longer wait for, restart, relay to or rebuild the current transcode.Approach
silo_transport, naming its transcode (the plan's output directory, or the transcode node's transport id), when the attempt's hls delivery lists the new featurehls_transport_marker_v1./api/v2advertises the feature. The playlist already copies its query into segment and rendition URIs, so a client that opts in carries the marker without handling it. Clients that check a media URL's query against the names they know refuse unknown parameters (the Apple app does), so clients that don't opt in get the same URLs as before./stream/v3grant routes enforce the check./api/v2reports it as the new problem typeplayback_transport_supersededand declaressilo_transporton the HLS operations. URLs without the marker behave as before.2026.11.22-d12da65. The branch uses main's pin to that release.Known limits:
playback_transport_superseded, where main relays it to the old node transport or serves the old local transcode. Neither plays the current plan. The fix for [bug] API replica keeps serving its own stale transcode after another replica replans the session #4610 has to let this check defer to the current plan as well.The protocol rule is in
docs/architecture/playback-protocol-v3.md§6 ("Superseded transports"), anddocs/playback-api.mddescribes the new error.Pairs with Silo-Server/silo-android#1010 (Android TV accepts the burn-in replan that starts the new stream) and Silo-Server/silo-translations#110 (the error text). The other fixes from the same report: #4639, #4640 and #4642.
Validation
internal/playback,internal/api/handlers,internal/proxy,internal/apiv2,internal/transcodenodeandinternal/jellycompatpass, as dogo vet,make lint-changed,verify-apiv2-openapi,verify-apiv2-contract,verify-playback-fixtures,verify-local-pathsandverify-bidi.internal/playback,internal/proxy,internal/apiv2andinternal/api/handlerspass. The handler package needsumask 022locally because of an existing upload-directory permission check that has nothing to do with this change.make test-go,go vet ./...,gofmt,go mod tidy -diff,make lint-changedandmake lint-router-recoverypass.make verify-apiv2-openapi,verify-apiv2-web-types,verify-apiv2-contract(3 new optional query parameters, none breaking),verify-apiv2-fixtures,verify-route-inventory,verify-playback-fixtures,verify-settings-bindings-all,verify-local-paths,verify-case-collisions,verify-bidi,verify-size-ratchetandverify-migrationspass. Webformat:checkand the type check pass.make test-web, the full web lint and build,verify-actionlint,verify-shellcheckandverify-prometheus-rules. This change touches none of their inputs except generated web locale and schema files.internal/playback,internal/api/handlers,internal/proxy,internal/apiv2,internal/transcodenodeandinternal/jellycompatpass, as domake lint-changed,verify-apiv2-openapi,verify-apiv2-web-types,verify-apiv2-contract,verify-apiv2-fixtures,verify-playback-fixtures,verify-route-inventory,verify-local-paths,verify-bidi, the web type check and the backup web tests that failed on fb506c7.TestPrepareTransportV3KeepsHeaderAuthenticatedRemoteHLSBehindAPIfails on fb506c7 (the header-authenticated URL carried the marker) and passes with the gate.internal/playback,internal/api/handlers,internal/proxy,internal/apiv2,internal/transcodenodeandinternal/jellycompatpass, as domake lint-changed,verify-apiv2-openapi,verify-apiv2-contract,verify-apiv2-fixtures,verify-playback-fixtures,verify-route-inventory,verify-local-pathsandverify-bidi.TestTranscodeServeStaleCopyRelaysTheCurrentMarkedPlayerfails on d2536e7 (the current player was refused before main's stale-copy relay) and passes with the fix.Evidence
No screen changes; this is server behavior. Server log from the Android TV check before the fix, trimmed (session ids shortened). The new burn-in transcode started at segment 42, then the replaced player's request for segment 75 restarted it at 150 s:
After the fix, on this branch (
becbb4705), the tests cover each path:Risks
hls_transport_marker_v1get marked URLs. The marker is only compared when both the URL and the session have one, and every path that keeps the running transcode keeps or recovers the marker. Unmarked URLs from older plans are served as before./api/v2gains an hls delivery feature, an optional query parameter and a problem type. All are additive.Checklist
AI Disclosure
silo_transportwas missing from the v2 contract; the problem type had no translation key; the v1 error header leaked into v2 problems. Documented as limits: proxy refusal after delivery leaves that proxy, and a stale request just after a restart. Dismissed as unlikely: a request that passes the check in the moment before a replan swaps in its new transcode, and a refusal during a replan whose database write then fails and rolls back.Note
Stop replaced players' HLS segment requests from restarting the new stream
hls_transport_marker_v1delivery feature: HLS stream URLs carry asilo_transportquery parameter naming the session's transport generation, tracked onplayback.Session.TransportGenerationand persisted via session stream state (transport_generation.go, session.go).playback_transport_supersedederror code, on both API handlers (playback.go) and proxy grant routes (mediagrant.go), before any session touch, route setup, or transcode runtime reconstruction.EXT-X-DEFINEvariable.Macroscope summarized 68a5ce9.