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(playback): default cellular quality to Auto up to 10 Mbps and cap Data Saver at 2 Mbps - #5135
Related issue: N/A
Validation tasks: changes #1220 C2 (cellular default resolves to Auto / 10 Mbps instead of 720p / 2 Mbps when no override is set)
Other clients: Apple Silo-Server/silo-apple#1254; Android Silo-Server/silo-android#1036; Roku N/A (TV client without cellular quality settings)
Silo's cellular quality defaults (playback.cellular_preferred_quality = 720p, playback.cellular_max_bitrate_kbps = 2000) forced transcoding for 1080p files on mobile data even when the file's bitrate fit normal cellular bandwidth. Under Auto with a bandwidth cap, the server also had three gaps that prevented a 10 Mbps cellular cap and 2 Mbps Low Data Mode / Data Saver transitions from working cleanly:
Alternate-version selection (lowerBufferedVersionForIntent) required a non-nil BandwidthEstimateKbps, so an Auto + BandwidthCapKbps start on mobile data (where probes are skipped) transcoded a 4K source instead of picking a fitting 1080p sibling.
quality_change replans compared only resolution and learned-limit clear, so moving between Auto / 2 Mbps, Auto / 10 Mbps, and Auto / uncapped did not reconsider the requested version.
When transcoding was disabled, routeFacts dropped Auto reductions that lacked an admin cap, allowing an over-cap file to direct-play past the client's explicit cellular cap.
Approach
Bumped the settings contract manifest from revision 29 to 30 (playback.cellular_preferred_quality default "auto", playback.cellular_max_bitrate_kbps default 10000), added a conformance case (cellular_quality_defaults_to_auto_10mbps), and regenerated Go and Web bindings.
Updated ResolveQualityPolicyV3 and routeFacts (QualityResultV3.SourceExceedsCap) so an over-cap source (or unknown video bitrate under a cap) is never restored to original quality when transcoding is unavailable, even when a bandwidth estimate or device limit lowered the selected rung first; if no fitting sibling can direct-play, planning refuses with transcoding_disabled instead of streaming past the cap.
Updated lowerBufferedVersionForIntent to search direct-playable sibling versions under Auto whenever BandwidthEstimateKbps != nil or BandwidthCapKbps > 0, treating unknown video bitrate as over-budget while leaving serverCap-only starts unchanged. Updated markLearnedLimit to account for BandwidthCapKbps under Auto so sibling swaps attribute learned limits accurately.
Updated executeReplanV3 to include changed BandwidthCapKbps in intentChange for quality_change and quality_changed.
Updated the Web client (bandwidth-probe.ts, playbackQualitySettings.ts, qualityPreference.ts, WatchPlaybackChrome.tsx, WatchPage.tsx, usePlaybackSession.ts) to classify networks into unmetered, metered, and low_data (navigator.connection?.saveData === true), applying a 2 Mbps cap-only ceiling on low_data without changing resolution or raising a stricter saved override, and subscribing the playback host to network-tier changes so active sessions issue a quality_change replan when the effective cap or quality changes.
Validation
make verify-settings-bindings-all across server, Android, and Apple: passed.
Go settings contract, resolver, playback planner, and targeted handler tests (including new tests for explicit cap refusal with and without lower estimate or device limit, Low Data cap-only ceiling, sibling selection under cap, unknown bitrate / server-cap boundaries, quality_change cap transitions, and learned-limit attribution): passed.
make lint-changed: 0 issues across 4 changed packages.
Web pnpm run format:check, pnpm run lint, vitest across playback quality settings, usePlaybackSession (including mid-session network-tier replanning), and query hooks, and production build (pnpm run build): passed.
Rollout order: Merge and ship the paired Apple and Android Low Data Mode / Data Saver PRs before or alongside this PR. Older Apple builds map Low Data Mode directly to the cellular pair, so serving settings contract revision 30 before clients separate the 2 Mbps Low Data Mode tier would temporarily raise their Low Data Mode cap from 2 Mbps to 10 Mbps.
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: Antigravity (T3 Code)
Tool(s): Antigravity, multi-model council plan review
Model(s): Gemini 4 Neon (design and implementation), gpt-6.2-sol (council plan review), claude-opus-5-5 (council plan review)
Involvement: AI-assisted
Adversarial review: Plan reviewed independently by gpt-6.2-sol and claude-opus-5-5 against the codebase before implementation. Key adopted findings: cap-only 2 Mbps Low Data ceiling, preserving explicit BandwidthCapKbps when transcoding is disabled, treating changed BandwidthCapKbps as a quality intent change on quality_change replans, handling unknown video bitrate and serverCap boundaries in lowerBufferedVersionForIntent, fixing markLearnedLimit baseline attribution under Auto + cap, and documenting client-first rollout order. Completed a simplify pass on the final diff.
Note
Default cellular playback quality to Auto (10 Mbps cap) and cap Data Saver at 2 Mbps
Changes settings defaults for cellular playback to auto quality with a 10,000 Kbps max bitrate, bumping the settings revision to 30 in settingsContract.ts and the manifest/conformance fixtures.
Introduces a three-state network tier (unmetered, metered, low_data) in bandwidth-probe.ts; Data Saver playback uses cellular settings with a 2,000 Kbps ceiling via LOW_DATA_CAP_KBPS in playbackQualitySettings.ts.
usePlaybackSession now reconciles network-tier and quality-setting changes against the adopted plan: it issues quality-change replans on tier changes, clears a kept cellular estimate when leaving a metered tier, retires the session when a cap-tightening replan is refused or fails, and ignores stale refusals after the cap relaxes.
Server-side, qualityIntentChangedV3 treats cap changes, relaxed estimates, and Auto file-reselection cases as quality intent changes, and lowerBufferedVersionForIntent can pick a fitting sibling version from an explicit cap alone.
The planner no longer falls back to original-quality playback when the source exceeds an explicit bandwidth cap and transcoding is unavailable, returning transcoding_disabled instead.
Behavioral Change: cellular users without saved settings now get Auto with a 10 Mbps cap; Data Saver sessions are capped at 2 Mbps; over-cap sources with transcoding disabled now refuse playback rather than direct-playing.
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.
The settings revision advances to 30, with cellular defaults changing to Auto and 10000 Kbps. The client distinguishes low-data connections and applies a 2000 Kbps ceiling. V3 playback planning and replanning account for bandwidth caps when selecting or retaining video versions.
Changes: Cellular Playback Quality Caps
Layer / File(s)
Summary
Cellular setting defaults and revision contracts/settings/v1/manifest.json, contracts/settings/v1/conformance.json, internal/settingskeys/keys.go, web/src/lib/settingsContract.ts, web/src/lib/settingsConformance.json
The settings revision advances to 30. The cellular quality default changes to auto, and the bitrate default changes to 10000 Kbps. The conformance fixtures check both defaults.
The client classifies connections as unmetered, metered, or low-data. Low-data settings apply a 2000 Kbps ceiling. Playback quality resolution receives the network tier.
Network-tier changes during playback web/src/player/types.ts, web/src/player/components/WatchPage.tsx, web/src/player/hooks/usePlaybackSession.ts, web/src/player/hooks/usePlaybackSession.test.ts
The playback session receives the network tier and replans when tier or cap changes require a quality update. Tests cover in-flight replans, queued actions, and refusal or request-error handling.
Explicit caps in V3 quality planning internal/playback/plan_v3.go, internal/playback/candidate_video_v3.go, internal/playback/cellular_cap_v3_test.go
V3 quality results indicate when the source exceeds an explicit cap. Routing retains cap-driven reductions. Tests cover capped playback with transcoding enabled and disabled.
Cap-aware alternate selection and replanning internal/api/handlers/playback_connection.go, internal/api/handlers/playback_v3.go, internal/api/handlers/playback_v3_cellular_cap_test.go, internal/api/handlers/playback_v3_test.go
Auto alternate-version selection uses the request cap when calculating its budget. Replans detect cap changes and relaxed estimates as quality-intent changes. Tests cover alternate selection and learned limits.
sequenceDiagram
participant Network as Browser network state
participant Session as usePlaybackSession
participant API as V3 playback API
Network->>Session: Report network-tier change
Session->>API: Send quality-change replan with current cap
API-->>Session: Return playback plan or refusal
Loading
Possibly related PRs
Silo-Server/silo-server#2624: Introduced the cellular quality settings and metered-link behavior that this PR updates.
Playback caps and network-tier replanning mostly work as intended. Two narrow edge cases in the Web playback session can leave a stream at a stale lower cap, or let a queued track change undo a successful manual quality pick. They are unlikely and recoverable, but worth fixing before merge. Per the PR notes, the paired Apple and Android Data Saver releases should ship before or alongside this change.
Security architecture risk: Minimal · up to ebd8d
The inspected changes do not establish increased access or weakened isolation. Playback retains access checks and stops an active session when a tighter data limit cannot be applied.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — Client-controlled quality and cap inputs can change delivery and alternate-version selection within an authenticated playback session. The inspected path retains user/profile ownership checks, access-filtered candidates and the server-stored bitrate cap; it does not establish expanded cross-profile asset access.
Trust Boundaries and Controls
observed — Browser network classification supplies a playback preference, not authoritative entitlement. Replans independently require authentication, matching user/profile ownership and playback-attempt identity. Alternate selection checks file access and limits its budget by the server cap.
Resilience and Maintainability Implications
observed — A failed tightening replan retires the active session while the tighter cap remains applicable. Refusals can transfer that obligation to eligible queued replans. A failure arriving after the cap has relaxed does not unnecessarily retire playback; retirement clears local playback state and requests a best-effort server stop.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main behavior changes: the cellular default moves to Auto at 10 Mbps, and Data Saver is capped at 2 Mbps. The changeset matches both, along with the settings revision bump and …
Description check
The description states the problem, the approach, validation steps, rollout risks, and AI disclosure. It matches the changes in settings contracts, server planner, and web playback code, so it is rela…
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.
Full details: Title check
Explanation
The title names the two main behavior changes: the cellular default moves to Auto at 10 Mbps, and Data Saver is capped at 2 Mbps. The changeset matches both, along with the settings revision bump and the server-side planner changes that support them.
Full details: Description check
Explanation
The description states the problem, the approach, validation steps, rollout risks, and AI disclosure. It matches the changes in settings contracts, server planner, and web playback code, so it is related to the changeset.
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
Inject the server-cap snapshot into this boundary test.
This direct helper call does not convert access.Scope into the context value that serverBitrateCapV3 reads. The test therefore runs with a zero server cap.
Wrap the context with withServerBitrateCapV3(ctx, 10_000). Assert that serverBitrateCapV3(req.Context()) is positive before calling the helper. This will test that a real server cap alone does not trigger sibling selection.
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: 74cdb492-75e9-47b6-8491-503b11523295
Commits
Reviewing files that changed from the base of the PR and between 4d5040e and e9b7982.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
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: 797689c4-9b07-4170-806a-67d51463dd53
Commits
Reviewing files that changed from the base of the PR and between e9b7982 and 2ba521b.
Files selected for processing: 10
internal/playback/candidate_video_v3.go
internal/playback/cellular_cap_v3_test.go
internal/playback/plan_v3.go
web/src/hooks/queries/qualityPreference.ts
web/src/playback/WatchPlaybackChrome.tsx
web/src/playback/playbackQualitySettings.ts
web/src/player/components/WatchPage.tsx
web/src/player/hooks/usePlaybackSession.test.ts
web/src/player/hooks/usePlaybackSession.ts
web/src/player/types.ts
Files skipped from review as they are similar to previous changes: 1
web/src/playback/playbackQualitySettings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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 reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Record the adopted cap when a queued output refresh carries a… · usePlaybackSession.ts:966-969
web/src/player/hooks/usePlaybackSession.ts:966-969 Minor · Functional Correctness · Quick win
Record the adopted cap when a queued output refresh carries a changed cap.
When a tightening quality_change is refused, a queued output_change can adopt the current, lower cap. The server applies that cap to the plan. The client does not record it, because adoptDecision updates activeBandwidthCapRef only for quality_change requests. When the cap returns to its earlier value, the tier reconciliation compares against the stale recorded cap and skips the replan. The plan then stays at the lower cap until another cap or tier change occurs.
After an adopted plan, the recorded active cap must match the cap that plan was requested with. This applies to every operation whose request the server applies. The fix belongs in the adoption path.
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: e86021d6-d4c9-4524-b187-dbf91192fe4b
Commits
Reviewing files that changed from the base of the PR and between e103505 and ebd8d22.
Files selected for processing: 2
web/src/player/hooks/usePlaybackSession.test.ts
web/src/player/hooks/usePlaybackSession.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Main shipped revision 30 for the cellular quality default (Silo-Server#5135) without
this key. A server built from it reports revision 30, so a client gating
playback.next_up_enabled on revision 30 would offer Off there and write a
key that server rejects. Introduce the key at 31 and bump the manifest,
conformance fixtures and generated bindings to match.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main took manifest revision 30 for the cellular quality defaults (Silo-Server#5135),
so the new key is introduced at revision 31. Bindings and conformance
fixtures are regenerated, and both HIDDEN_KEYS entries are kept.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Server revision 30 went to the cellular quality default
(Silo-Server/silo-server#5135), and Silo-Server/silo-server#4501 now adds
playback.next_up_enabled in revision 31. Re-vendor the manifest, the
conformance fixture and the generated bindings from that commit, and gate
the key on 31, so a current server at revision 30 is never sent it and
keeps answering the batch it shares with the cellular pair.
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: playbackCan't play, stalls, or wrong medianeeds-reviewNeeds maintainer review to resolve uncertain classification, scope, or changed evidence.priority: P2Limited scope, workaround exists, or polishsize/XXL1000–2999 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 #1220 C2 (cellular default resolves to Auto / 10 Mbps instead of 720p / 2 Mbps when no override is set)
Other clients: Apple Silo-Server/silo-apple#1254; Android Silo-Server/silo-android#1036; Roku N/A (TV client without cellular quality settings)
Silo's cellular quality defaults (
playback.cellular_preferred_quality = 720p,playback.cellular_max_bitrate_kbps = 2000) forced transcoding for 1080p files on mobile data even when the file's bitrate fit normal cellular bandwidth. UnderAutowith a bandwidth cap, the server also had three gaps that prevented a 10 Mbps cellular cap and 2 Mbps Low Data Mode / Data Saver transitions from working cleanly:lowerBufferedVersionForIntent) required a non-nilBandwidthEstimateKbps, so anAuto+BandwidthCapKbpsstart on mobile data (where probes are skipped) transcoded a 4K source instead of picking a fitting 1080p sibling.quality_changereplans compared only resolution and learned-limit clear, so moving betweenAuto / 2 Mbps,Auto / 10 Mbps, andAuto / uncappeddid not reconsider the requested version.routeFactsdroppedAutoreductions that lacked an admin cap, allowing an over-cap file to direct-play past the client's explicit cellular cap.Approach
playback.cellular_preferred_qualitydefault"auto",playback.cellular_max_bitrate_kbpsdefault10000), added a conformance case (cellular_quality_defaults_to_auto_10mbps), and regenerated Go and Web bindings.ResolveQualityPolicyV3androuteFacts(QualityResultV3.SourceExceedsCap) so an over-cap source (or unknown video bitrate under a cap) is never restored to original quality when transcoding is unavailable, even when a bandwidth estimate or device limit lowered the selected rung first; if no fitting sibling can direct-play, planning refuses withtranscoding_disabledinstead of streaming past the cap.lowerBufferedVersionForIntentto search direct-playable sibling versions underAutowheneverBandwidthEstimateKbps != nilorBandwidthCapKbps > 0, treating unknown video bitrate as over-budget while leavingserverCap-only starts unchanged. UpdatedmarkLearnedLimitto account forBandwidthCapKbpsunderAutoso sibling swaps attribute learned limits accurately.executeReplanV3to include changedBandwidthCapKbpsinintentChangeforquality_changeandquality_changed.bandwidth-probe.ts,playbackQualitySettings.ts,qualityPreference.ts,WatchPlaybackChrome.tsx,WatchPage.tsx,usePlaybackSession.ts) to classify networks intounmetered,metered, andlow_data(navigator.connection?.saveData === true), applying a 2 Mbps cap-only ceiling onlow_datawithout changing resolution or raising a stricter saved override, and subscribing the playback host to network-tier changes so active sessions issue aquality_changereplan when the effective cap or quality changes.Validation
make verify-settings-bindings-allacross server, Android, and Apple: passed.quality_changecap transitions, and learned-limit attribution): passed.make lint-changed: 0 issues across 4 changed packages.pnpm run format:check,pnpm run lint, vitest across playback quality settings,usePlaybackSession(including mid-session network-tier replanning), and query hooks, and production build (pnpm run build): passed.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/cellular-quality-default-low-data/
Risks
Rollout order: Merge and ship the paired Apple and Android Low Data Mode / Data Saver PRs before or alongside this PR. Older Apple builds map Low Data Mode directly to the cellular pair, so serving settings contract revision 30 before clients separate the 2 Mbps Low Data Mode tier would temporarily raise their Low Data Mode cap from 2 Mbps to 10 Mbps.
Follow-ups
Checklist
AI Disclosure
BandwidthCapKbpswhen transcoding is disabled, treating changedBandwidthCapKbpsas a quality intent change onquality_changereplans, handling unknown video bitrate andserverCapboundaries inlowerBufferedVersionForIntent, fixingmarkLearnedLimitbaseline attribution underAuto+ cap, and documenting client-first rollout order. Completed a simplify pass on the final diff.Note
Default cellular playback quality to Auto (10 Mbps cap) and cap Data Saver at 2 Mbps
autoquality with a 10,000 Kbps max bitrate, bumping the settings revision to 30 in settingsContract.ts and the manifest/conformance fixtures.unmetered,metered,low_data) in bandwidth-probe.ts; Data Saver playback uses cellular settings with a 2,000 Kbps ceiling viaLOW_DATA_CAP_KBPSin playbackQualitySettings.ts.usePlaybackSessionnow reconciles network-tier and quality-setting changes against the adopted plan: it issues quality-change replans on tier changes, clears a kept cellular estimate when leaving a metered tier, retires the session when a cap-tightening replan is refused or fails, and ignores stale refusals after the cap relaxes.qualityIntentChangedV3treats cap changes, relaxed estimates, and Auto file-reselection cases as quality intent changes, andlowerBufferedVersionForIntentcan pick a fitting sibling version from an explicit cap alone.transcoding_disabledinstead.Macroscope summarized b0f0fc1.