Skip to content

fix(jellycompat): reject remote starts that ignore MPEG-TS copy packaging - #3358

Merged
Quick104 merged 1 commit into
mainfrom
fix/jellycompat-mpegts-attestation
Nov 1, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/jellycompat-mpegts-attestation

Conversation

@Quick104

@Quick104 Quick104 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #3355
Related issue: N/A
Validation tasks: none

A Jellyfin-compat client that gets an MPEG-TS video copy from a remote transcode node can receive fMP4 segments on an MPEG-TS stream. This happens when the node was built before MPEG-TS copies (#3026). That node ignores the copy_video_mpegts request field and writes fMP4. The API never checks the node's reply, so it still publishes the stream on the remux-ts-v1 route with TranscodingContainer: ts.

Today this reaches Roku video copies and webOS Dolby Vision copies during a rolling upgrade or on a mixed-version node pool. #3341 extends MPEG-TS copies to every client that lists the source codecs only for MPEG-TS HLS, so more clients will hit it.

Approach

The jellycompat remote start now calls transcodenode.ValidateCopyVideoMPEGTSAttestation next to its other attestation checks. On a mismatch it stops the remote job and returns errRemoteTranscodeStartFailed, the same handling as the audio, throttle, and keyframe-playlist checks, so the start is treated as a failed remote start. The native start and the native rehome already run this check. Nodes built since #3026 echo the field, so a same-version pool is unaffected.

Validation

  • Not reproduced live: that needs a transcode node built before feat(playback): package copy remuxes as MPEG-TS on request #3026 in the pool. The defect is proven from the source path above and by the regression test.
  • Regression test: the existing old-node rejection test in jellycompat is now a table. Its new row uses a node that attests everything except copy_video_mpegts. On main the row fails because the start returns no error. With the fix, the start fails with the retryable error and the node gets the stop request.
  • go test ./internal/jellycompat/ ./internal/transcodenode/: pass.
  • make lint-changed: 0 issues.

Evidence

No user-visible change. The page holds the test runs on main and on this branch.

Evidence: https://evidence.siloserver.org/r/silo-server/issue-3355/

Risks

During a rolling upgrade, a jellycompat MPEG-TS copy placed on a node that predates #3026 now fails like the other attestation mismatches (502 TranscodeStartFailed when the start can't be placed elsewhere) instead of playing fMP4 segments under an MPEG-TS playlist. The native API already behaves this way.

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 says there is none.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated at the maintainer's request; human verification is the review requested on this PR
  • Adversarial review: found by a code-review subagent while reviewing feat(jellycompat): copy video as MPEG-TS for clients that list only TS #3341 and checked against the source; this fix had a single-pass self-review of the diff. A background adversarial review (gpt-6.1-sol via Codex, reviewed fabd6f5) attacked other remote-start paths, rollback and retry, node echo, and the test; it found nothing.

🤖 Generated with Claude Code

…ging

A Jellyfin-compat video copy packaged as MPEG-TS asks the transcode node for
copy_video_mpegts, but the start never checked the node's reply. A node built
before MPEG-TS copies ignores the field and writes fMP4, while the API still
serves the stream on the remux-ts-v1 route. Check the attestation like the
native start does, stop the remote job, and return the retryable start error.

Closes #3355

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T16:14:53.680599Z fabd6f5 PR opened
🔒 Security Review ✅ Completed 2026-11-01T16:16:09.715019Z fabd6f5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 19747b19-72f2-4e90-8385-4cfa03496cf5
Commits

Reviewing files that changed from the base of the PR and between 8bc4f2a and fabd6f5.

Files selected for processing: 2
  • internal/jellycompat/audio_selection_test.go
  • internal/jellycompat/handlers_playback.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

Jellycompat remote transcode startup now validates the MPEG-TS copy attestation. If validation fails, startup stops the remote transcode and returns a retryable start failure. Tests cover missing audio and MPEG-TS attestations.

Changes: Remote transcode attestation

Layer / File(s) Summary
Validate remote MPEG-TS copy attestation
internal/jellycompat/handlers_playback.go, internal/jellycompat/audio_selection_test.go
Remote startup validates the MPEG-TS copy attestation after the keyframe-playlist check. On failure, it stops the remote transcode and wraps the validation error as errRemoteTranscodeStartFailed. Tests cover missing audio and MPEG-TS attestations, retryable start failures, and cleanup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: neurekadev

Merge Risk: Minimal · up to fabd6

MPEG-TS copy starts now reject nodes that do not attest support. No actionable merge-blocking risk remains.

Security architecture risk: Low · up to fabd6

The change rejects incompatible remote starts before accepting their execution results, without adding authority or widening access. Risk is limited, but remote cleanup remains best-effort when a node cannot confirm cancellation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The added failure action targets the selected node and the same upstream session identifier used for startup. It introduces no bulk cancellation operation or additional node-selection authority.

Trust Boundaries and Controls

  • observed — Remote start and stop requests retain the existing node-signing control. The new response check narrows acceptance of an executor's result without changing credentials, request destinations, or privileges.

Resilience and Maintainability Implications

  • observed — Existing per-session serialization and publication ownership checks contain competing starts. Compensating deletion is independent of caller cancellation and treats an absent job as success, while leaving local live-map state untouched.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: rejecting remote starts that lack MPEG-TS copy packaging attestation.
Linked Issues check Passed Issue #3355 requires Jellyfin-compatible remote starts to validate the CopyVideoMPEGTS attestation. The change calls transcodenode.ValidateCopyVideoMPEGTSAttestation(reqBody, nodeResponse) in `sta…
Out of Scope Changes check Passed The diff contains one production change for issue #3355 and focused regression-test changes. The test also preserves coverage for the existing audio-recipe attestation behavior. No unrelated productio…
Description check Passed The description explains a concrete defect and fix: jellycompat remote transcode starts do not check the node's copy_video_mpegts attestation, so pre-#3026 nodes can serve fMP4 under an MPEG-TS route.…
Full details: Linked Issues check

Explanation

Issue #3355 requires Jellyfin-compatible remote starts to validate the CopyVideoMPEGTS attestation. The change calls transcodenode.ValidateCopyVideoMPEGTSAttestation(reqBody, nodeResponse) in startRemoteTranscodeWithToneMapMode. On failure, it stops /transcode/upstream-1 and wraps the error with errRemoteTranscodeStartFailed. The table-driven regression test covers the missing MPEG-TS attestation and checks both results. The change satisfies the linked issue coding requirements.

Full details: Out of Scope Changes check

Explanation

The diff contains one production change for issue #3355 and focused regression-test changes. The test also preserves coverage for the existing audio-recipe attestation behavior. No unrelated production behavior or unrelated files appear in the reviewed diff.

Full details: Description check

Explanation

The description explains a concrete defect and fix: jellycompat remote transcode starts do not check the node's copy_video_mpegts attestation, so pre-#3026 nodes can serve fMP4 under an MPEG-TS route. It names the new ValidateCopyVideoMPEGTSAttestation call, the errRemoteTranscodeStartFailed handling, the regression test, and the validation runs. It is clearly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish labels Nov 1, 2026
@Quick104
Quick104 merged commit 7eced83 into main Nov 1, 2026
22 checks passed
@Quick104
Quick104 deleted the fix/jellycompat-mpegts-attestation branch November 1, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Jellyfin-compat remote starts accept a node that ignores the MPEG-TS copy request

1 participant