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
feat(admin): show why a session transcodes and redesign the Activity page - #4315
Related issue: N/A
Validation tasks: changes #1206 C1 and #1207 C1 (session metadata and controls on the Activity page; neither case has a result yet)
Other clients: N/A (Apple has no admin Activity screen, Android removed its admin screens, and Roku has none)
The admin Activity page shows that a session is transcoding or repackaging, but not why. An admin can't tell whether the device lacks a codec, the connection buffered, a bitrate limit applied, or the viewer picked a lower quality. The plan's decision_reason doesn't answer it either: it names only the last step that shaped the recipe, so a 4K HEVC file sent to an H.264-only device reports quality_auto_source.
This change has the playback planner record the reasons and shows them on the Activity page. The page is redesigned so the reasons fit without making rows taller: each session is one compact row, and its details open with the decision and every reason in plain words.
Approach
Reasons. The candidate planner derives AdaptationReasons from the facts it already chose the route by: video and audio eligibility, dynamic range, the quality step (device limit, measured connection speed, earlier buffering or a learned limit, the viewer's Maximum bitrate setting, the access group's stream bitrate limit, a chosen quality), subtitle burn-in, copy routes already failed, and what kept the original file off a copyable video (container, audio track selection, subtitles). The vocabulary is closed and ordered; docs/admin-api.md lists every value.
The list follows the other session stream fields:
The planner result carries it.
The executable recipe carries it, so a seek reanchor keeps it.
So does the stored recovery card, and a session rebuilt from a stream token reads it back from the live row.
Session sync writes it to a new nullable playback_sessions_sync.adaptation_reasons column.
/api/v2/admin/sessions reports it as adaptation_reasons, and the capabilities response adds adaptation_reasons and adaptation_reason_values. All three are additive, and the frozen v1 row doesn't carry the field.
The plan wire format is unchanged. Jellyfin-protocol sessions report no reasons: their route decision doesn't come from this planner, and the Jellyfin-style reasons that path sends clients are inferred (they fall back to "video codec not supported"), so reusing them here would mislead admins.
Activity page. Each session is a three-line row:
the title with its poster, progress and a paused marker
the user and active profile, client, and Local/Remote with the address
the method badge, the first reason and a "+N" button, then the video and audio as "source → delivered" (untouched streams stay muted), with the hardware or software encoder
Below the table width, sessions become stacked cards. The expanded details start with a Decision row (the method and what it means) and a Reasons row, then a Source/Delivered table for video, audio and container, the client, route and session, and the FFmpeg console.
The page scrolls as a whole with a sticky column header. The method, type and node filters share one toolbar with the IP lookup, which now opens in a dialog. A summary under the title counts streams, video transcodes, outbound bitrate, and remote and paused sessions. The route column only appears when sessions take different routes. Terminate moves from a button on every row into each session's menu, where the dashboard widget already has it.
playback_sessions.go and adminActivityPresentation.ts were at their size limits, so the admin session capability vocabulary and the reason text table move into their own files.
Planner: table tests drive PlanPlaybackV3 through 14 video routes (direct play, unconfirmed and unsupported video, a failed original, the original delivery's channel ceiling, a remux within the server limit that failed, container, audio codec, resolution, probed and buffering estimates, request cap, access group limit, chosen quality) and 4 audio-only routes (original, no original-file delivery, the original delivery's channel ceiling, the progressive channel ceiling), and check that reasons survive the recipe used by seek reanchors.
Restart recovery: the header-auth restart test checks that the stored card and the rebuilt session carry the started plan's reasons; it fails without the fix.
Session sync: the snapshot-change test covers reason changes, and nil vs empty lists.
Web: the Activity tests cover the filter chips, row badges, encoder and tone-map placement, the first reason, the "+N" button and the full reason list, and the IP lookup dialog. Typecheck, lint and format pass; the page was checked under the en-XA and ar-XB pseudo-locales.
Full gate from CONTRIBUTING.md, after merging current main: build, gofmt, go mod tidy -diff, vet, make lint-changed, router recovery lint, web lint, format, build, bundle budget, and every verify-* target pass.
make test-go passes except TestRunStatsWithRealFFmpeg and TestCopyRemuxSubtitleRenditionRealFFmpeg, which fail the same way on main on this host's FFmpeg 6.1 (CI runs them on its own FFmpeg), and TestLoginAccountNameWithHashDB, which failed under full-suite load on the shared test database and passes alone.
make test-web passes except pgs.test.ts ("drops objects past 16 MiB"), which timed out under load and passes alone.
verify-actionlint and verify-shellcheck weren't run locally (tools not installed; no workflow or shell changes).
Sandbox end to end: five sessions started through /api/v2/playback/start (a direct-play episode, a remux, a direct stream, an HEVC 4K transcode, and a transcode after buffering) showed the expected reasons in the admin API and on the page.
Surface and build: web admin Activity page, desktop and phone width, on a sandbox built from this branch. The before captures run main's web app against the same backend and sessions.
Risks
Migration adds one nullable column; older rows read as no reasons.
Every encode also converts audio, so a video transcode lists an audio reason only when the audio alone couldn't have been copied.
"Direct play failed" is inferred from the replan's attempted plans when nothing else forced the change, so a replan that carries attempted keys for another reason can show it.
Only the quality step that won is named: a 4K source on a 1080p device over a bitrate limit shows the limit, not also the resolution limit.
A session started before this change and seek-reanchored after it reports no reasons until its next plan.
Terminate now takes two clicks (the menu, then the item) instead of one.
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: T3 Code (Claude Code harness)
Tool(s): Claude Code
Model(s): claude-opus-5-5; claude-fable-5-2 for design and wording advice
Involvement: Fully AI-generated; the maintainer directed the design and reviewed it on a live preview
Adversarial review: two independent Claude Code reviewers, each given only the code and the change's stated goal. The first checked the backend: reason derivation against the planner facts, every path that rebuilds session stream state, the sync SQL and the API contract. It found that the restart recovery card copied reasons from the session before the new plan reached it (and the same staleness when a replan reuses the stream), and that a remux chosen after direct play failed reported no reason; both are fixed and tested. The second checked the redesigned page for lost behaviour, accessibility and translation. It found that stacked cards dropped the session age, Jellyfin pill and user link, that the auto-switched source note was lost, that the expand controls pointed at a missing panel, that the search and IP fields had no accessible names, and that a tooltip joined labels with a hard-coded comma; all are fixed. Issues it raised that the old page already had (repeated control names, unspoken sort direction) are left for a separate change.
Add playback adaptation reasons and redesign the admin Activity page
The playback planner now records why a session adapts (video, quality, subtitle, audio, packaging reasons) in PlannerResultV3.AdaptationReasons, and these reasons persist through recipe cards, session stream state, and session sync (adaptation_reasons_v3.go, session.go, reconciler.go).
Adds a nullable adaptation_reasons TEXT[] column to playback_sessions_sync (migration) and exposes the field plus an adaptation_reasons capability in the admin sessions API and OpenAPI schema.
The Activity page is rebuilt in AdminActivity.tsx: a totals summary, interactive method and node filters, responsive table/stacked layouts, per-row expanded panels showing the decision and adaptation reasons, a dedicated FFmpeg console, and IP lookup moved into a dialog.
New localized strings for reason labels, descriptions, and summary messages are added across all locale catalogs.
Risk: the schema migration must be applied before the reconciler writes adaptation_reasons; the frozen v1 admin row intentionally does not carry the field, per admin-api.md.
The playback planner now records why a route converts or repackages the
file (unsupported video or audio codec, HDR, resolution limit, bandwidth,
buffering, bitrate caps, a chosen quality, subtitle burn-in, container,
and so on). The live session keeps the list through seek reanchors and
restarts, syncs it to playback_sessions_sync, and /api/v2/admin/sessions
reports it as adaptation_reasons. The web Activity page shows it as a Why
line on each row and as a list in the expanded details.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
playback_sessions.go reached its 1000-line size limit with the new
adaptation_reasons field. The capabilities type and its builder move
into playback_session_features.go, with named constants for the
effective_play_method buckets that effectivePlayMethod also returns.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The playback planner now assigns ordered adaptation reasons and carries them through session recipes and synchronization. The v2 admin API advertises and returns these reasons. The admin activity page displays reasons, conversion details, and stream summaries, with revised filters and an IP lookup dialog.
Changes: Playback adaptation reasons and activity view
Layer / File(s)
Summary
Define and calculate adaptation reasons internal/playback/adaptation_reasons_v3.go, internal/playback/candidate_*_v3.go, internal/playback/plan_v3.go, internal/playback/executable_recipe_v3.go, internal/playback/adaptation_reasons_v3_test.go
The planner defines an ordered reason vocabulary and assigns reasons to video and audio plans. Frozen recipes preserve the reasons, and tests cover reason selection and recipe rebuilding.
Carry reasons through sessions and storage internal/api/handlers/playback*.go, internal/playback/session.go, internal/playback/recipecard.go, internal/playback/transcode_manager.go, cmd/silo/session_sync.go, internal/worker/reconciler.go, migrations/sql/*, internal/worker/reconciler_test.go
Transport and recovery recipes, session state, and synchronized session rows carry adaptation reasons. Reconciliation stores and compares the values.
Expose reasons through the admin API internal/api/handlers/playback_sessions.go, internal/api/handlers/playback_session_features.go, internal/apiv2/admin_sessions.go, contracts/api/v2/openapi.json, docs/admin-api.md
The v2 admin session response includes adaptation reasons and advertises support and ordered values. Session loading normalizes values. The API schema and documentation describe the field and its behavior.
The activity page adds reason and conversion details, progress, filters, and aggregate summaries. It revises session rows and expanded details, adds an IP lookup dialog, and includes related tests and translations.
sequenceDiagram
participant PlaybackPlanner
participant SessionRecipe
participant SessionSync
participant PostgreSQL
participant AdminPlaybackSession
participant AdminActivity
PlaybackPlanner->>SessionRecipe: Store plan adaptation reasons
SessionSync->>PostgreSQL: Upsert adaptation reasons
AdminPlaybackSession->>AdminActivity: Return adaptation reasons and capability values
AdminActivity->>AdminActivity: Translate and render recognized reasons
Loading
Suggested reviewers:blurbery, rhainland
Merge Risk: Low · up to b8a4f
Admin Activity may occasionally show a misleading or missing reason for why a session was converted. Playback behavior is unaffected. The sort controls also do not announce their direction to screen readers. These are small issues that can be fixed or accepted before or after merge.
Security architecture risk: Minimal · up to b8a4f
The inspected changes add explanatory session metadata without establishing a new material security, access-control, or recovery-control risk. The database change requires coordinated deployment and rollback ordering.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The added exposure is route-explanation metadata within existing administrator session reporting and shared session storage. The inspected propagation does not give the reason values authority over session ownership, media authorization, or recipe validity.
Trust Boundaries and Controls
observed — The session and capabilities endpoints remain registered as acting-admin operations. The web helper accepts only own properties of a fixed reason-to-translation map, excluding unknown and inherited property names rather than rendering raw reason strings.
Resilience and Maintainability Implications
observed — The new field participates in session replacement snapshots and revision-checked rollback. Durable synchronization writes reasons with the existing session transaction, removes stale rows by reporting node, and publishes administrator invalidation only after commit. These additions preserve the inspected rollback and cleanup mechanisms.
Pre-merge checks: 4
Check name
Status
Explanation
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.
Title check
The title names the two main changes: adding a reason for each session transcode and redesigning the Activity page. Both match the changeset, which adds adaptation reasons across the planner, API, and…
Description check
The description states the problem (the Activity page shows that a session transcodes or repackages but not why), the approach (planner records AdaptationReasons, carries them through recipes, recover…
Full details: Title check
Explanation
The title names the two main changes: adding a reason for each session transcode and redesigning the Activity page. Both match the changeset, which adds adaptation reasons across the planner, API, and sync, and rewrites AdminActivity.tsx. The title is a single sentence and specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description states the problem (the Activity page shows that a session transcodes or repackages but not why), the approach (planner records AdaptationReasons, carries them through recipes, recovery and session sync, exposes them via the admin sessions API, and redesigns the Activity page), and validation performed. It is directly related to the changeset, which matches the summary's planner, API, schema, storage, and UI changes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Each session is now one three-line row: the title with its poster and
progress, the viewer with client and address, and the delivery as the
method, the first reason it isn't direct play, and source → delivered
video and audio lines with the encoder. The expanded details lead with
every reason, then a source/delivered table for video, audio and
container, the client, route and session, and the FFmpeg console.
The page scrolls as a whole with a sticky column header. The method,
type and node filters share one toolbar with the IP lookup, which opens
in a dialog. A summary under the title counts streams, video
transcodes, outbound bitrate, remote and paused sessions. The route
column only appears when sessions take different routes, and Terminate
moves into each session's menu.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…isible
The expanded details open with a Decision row (the method and what it
means) and a Reasons row, in the same label column as Client and Route.
Each row and card always shows the active profile. Reason labels no
longer read as live states or overlap: "Earlier buffering", "Connection
too slow", "Maximum bitrate setting" (named after the setting) and
"Access group limit" (the access group's stream bitrate cap), and the
docs describe those two limits by where an administrator or viewer sets
them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The stacked card links the user and shows the Jellyfin pill, and the
expanded details give the session's age and note when the server
auto-switched to another version of the title. Search matches profile
names, the search and IP fields have accessible names, the expand
controls only point at a panel that exists, and the "+N" tooltip uses
the locale's list format. The per-stream detail helpers nothing renders
any more are removed; their tests move to the helpers that replaced them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… original delivery
An audio-only file converted for the progressive delivery's channel
ceiling reported an unsupported codec, and one remuxed because the
device offers no original-file delivery reported no reason. Both now
match the video path.
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
❌
Quick104
changed the title
feat(admin): show why a session transcodes on the Activity page
feat(admin): show why a session transcodes and redesign the Activity page
Nov 15, 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: 0849df1b-581b-4324-8648-b63a864dac34
Commits
Reviewing files that changed from the base of the PR and between 6c7af55 and b8a4f7e.
Files selected for processing: 17
.silo-translations
contracts/api/v2/openapi.json
internal/playback/adaptation_reasons_v3.go
internal/playback/adaptation_reasons_v3_test.go
web/src/api/v2/schema.ts
web/src/locales/ar.json
web/src/locales/de.json
web/src/locales/es.json
web/src/locales/fr.json
web/src/locales/ja.json
web/src/locales/keys.ts
web/src/locales/pt-BR.json
web/src/locales/zh-Hans.json
web/src/pages/AdminActivity.tsx
web/src/pages/adminActivityPresentation.test.ts
web/src/pages/adminActivityPresentation.ts
web/src/pages/adminActivityReasons.ts
Files skipped from review as they are similar to previous changes: 1
web/src/locales/keys.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
An encode that followed a remux the server's bitrate limit allowed, and
that then failed on the device, named the limit; it now reports the
failed copy. A route that left the original file for its own delivery's
channel ceiling, while the remux copies the audio, now reports the
channel limit instead of nothing, for video and audio-only files.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main copies a replan's adaptation reasons onto a reused HLS transport's
recipe (#4315); the branch moved that block into reuseActiveHLSTransportV3,
so the copy moves with it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
enhancementNew feature or requestimpact: polishAnnoyance, cosmetic, or nice-to-havepriority: P2Limited scope, workaround exists, or polishsize/XXXL3000+ added + deleted lines (all files); change volume, not priority.
1 participant
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: changes #1206 C1 and #1207 C1 (session metadata and controls on the Activity page; neither case has a result yet)
Other clients: N/A (Apple has no admin Activity screen, Android removed its admin screens, and Roku has none)
The admin Activity page shows that a session is transcoding or repackaging, but not why. An admin can't tell whether the device lacks a codec, the connection buffered, a bitrate limit applied, or the viewer picked a lower quality. The plan's
decision_reasondoesn't answer it either: it names only the last step that shaped the recipe, so a 4K HEVC file sent to an H.264-only device reportsquality_auto_source.This change has the playback planner record the reasons and shows them on the Activity page. The page is redesigned so the reasons fit without making rows taller: each session is one compact row, and its details open with the decision and every reason in plain words.
Approach
Reasons. The candidate planner derives
AdaptationReasonsfrom the facts it already chose the route by: video and audio eligibility, dynamic range, the quality step (device limit, measured connection speed, earlier buffering or a learned limit, the viewer's Maximum bitrate setting, the access group's stream bitrate limit, a chosen quality), subtitle burn-in, copy routes already failed, and what kept the original file off a copyable video (container, audio track selection, subtitles). The vocabulary is closed and ordered;docs/admin-api.mdlists every value.The list follows the other session stream fields:
playback_sessions_sync.adaptation_reasonscolumn./api/v2/admin/sessionsreports it asadaptation_reasons, and the capabilities response addsadaptation_reasonsandadaptation_reason_values. All three are additive, and the frozen v1 row doesn't carry the field.The plan wire format is unchanged. Jellyfin-protocol sessions report no reasons: their route decision doesn't come from this planner, and the Jellyfin-style reasons that path sends clients are inferred (they fall back to "video codec not supported"), so reusing them here would mislead admins.
Activity page. Each session is a three-line row:
Below the table width, sessions become stacked cards. The expanded details start with a Decision row (the method and what it means) and a Reasons row, then a Source/Delivered table for video, audio and container, the client, route and session, and the FFmpeg console.
The page scrolls as a whole with a sticky column header. The method, type and node filters share one toolbar with the IP lookup, which now opens in a dialog. A summary under the title counts streams, video transcodes, outbound bitrate, and remote and paused sessions. The route column only appears when sessions take different routes. Terminate moves from a button on every row into each session's menu, where the dashboard widget already has it.
playback_sessions.goandadminActivityPresentation.tswere at their size limits, so the admin session capability vocabulary and the reason text table move into their own files.New strings come from Silo-Server/silo-translations#41 (merged), and
.silo-translationspins its release.Validation
PlanPlaybackV3through 14 video routes (direct play, unconfirmed and unsupported video, a failed original, the original delivery's channel ceiling, a remux within the server limit that failed, container, audio codec, resolution, probed and buffering estimates, request cap, access group limit, chosen quality) and 4 audio-only routes (original, no original-file delivery, the original delivery's channel ceiling, the progressive channel ceiling), and check that reasons survive the recipe used by seek reanchors.en-XAandar-XBpseudo-locales.main: build, gofmt,go mod tidy -diff, vet,make lint-changed, router recovery lint, web lint, format, build, bundle budget, and everyverify-*target pass.make test-gopasses exceptTestRunStatsWithRealFFmpegandTestCopyRemuxSubtitleRenditionRealFFmpeg, which fail the same way onmainon this host's FFmpeg 6.1 (CI runs them on its own FFmpeg), andTestLoginAccountNameWithHashDB, which failed under full-suite load on the shared test database and passes alone.make test-webpasses exceptpgs.test.ts("drops objects past 16 MiB"), which timed out under load and passes alone.verify-actionlintandverify-shellcheckweren't run locally (tools not installed; no workflow or shell changes)./api/v2/playback/start(a direct-play episode, a remux, a direct stream, an HEVC 4K transcode, and a transcode after buffering) showed the expected reasons in the admin API and on the page.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4315/
Surface and build: web admin Activity page, desktop and phone width, on a sandbox built from this branch. The before captures run
main's web app against the same backend and sessions.Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add playback adaptation reasons and redesign the admin Activity page
PlannerResultV3.AdaptationReasons, and these reasons persist through recipe cards, session stream state, and session sync (adaptation_reasons_v3.go, session.go, reconciler.go).adaptation_reasons TEXT[]column toplayback_sessions_sync(migration) and exposes the field plus anadaptation_reasonscapability in the admin sessions API and OpenAPI schema.adaptation_reasons; the frozen v1 admin row intentionally does not carry the field, per admin-api.md.Macroscope summarized 49a3afb.