Repository navigation
refactor(playback): classify planner refusals beside the planner - #3946
Conversation
The start and replan handlers decide what to try after a planner refusal: another version, the same file without its subtitle, or a retry when settings or tone-map capabilities failed to load. They decided it from the planner's strings. Two reasons were re-declared as literals in the handler, and the settings case matched message text. The answers now live in internal/playback next to the code that produces the refusals, as AnotherVersionMayPlay, SubtitleRefusal and ToneMapDependentRefusal on PlannerResultV3. The planner marks the four refusals a setting decides with SettingsDependentRefusal, which replaces the message matching. no_alternate_version and subtitle_conversion_unsupported are declared once and shared with the watch-together source fallback. No change in planner output or in what a client receives. Part of #3407. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 9 minutes. View limit details
Pre-merge checks:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: #3407
Validation tasks: none. #1177 C3 (worker failover) replans through this code, with no intended change.
When the planner refuses a file, the start and replan handlers decide what to try next: another version of the item, the same file without its subtitle, or a retry when settings or tone-map capabilities failed to load. They decided that from the planner's strings. Two reasons were declared a second time as literals in the handler, and one case searched the refusal's message for "this HDR source" and "4K transcoding is disabled". Rewording a planner message, or changing which reason a cause reports, could stop a fallback from running without any test or type noticing.
This change moves those answers next to the code that produces the refusals. It is the first of three stacked pull requests for #3407.
Approach
PlannerResultV3answers the handlers' questions itself, ininternal/playback/plan_refusal_v3.go:AnotherVersionMayPlay,SubtitleRefusalandToneMapDependentRefusal. The handlers call these in place of their own reason lists.SettingsDependentRefusalon the four refusals a playback setting decides. The handler reads that field where it matched message text.no_alternate_versionandsubtitle_conversion_unsupportedare declared once ininternal/playbackand shared with the watch-together source fallback.No reason, message or status a client receives changes.
PlannerResultV3is in memory only, so the new field touches no stored format. The classification is the same as before, including one quirk the new comment now states: everysubtitle_conversion_unsupportedrefusal counts as tone-map dependent, whether or not a tone-map recipe was involved.Validation
go build,go vet,gofmt,make lint-changed): pass on this branch.mainon the machine used (its FFmpeg has nosubtitlesfilter).make verify-playback-fixtures: no diff.Tests: the handler's test of the moved classification moved to the playback package with it, the settings-retry test now covers the marker, and two existing planner tables assert which refusals carry it.
Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3946/
No user-visible change.
Risks
A refusal classified differently would change which fallback the handlers try. The set of reasons and the four marked refusals were checked against every producer of those reasons in the planner; none is classified differently.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Move planner refusal classification from playback handlers to
PlannerResultV3terminalAllowsAlternateFileV3,subtitleRefusalV3) toPlannerResultV3.AnotherVersionMayPlay,SubtitleRefusal, andToneMapDependentRefusalin plan_refusal_v3.goSettingsDependentRefusaltoPlannerResultV3. HDR/tone-map and 4K-setting refusals are marked viasettingsRefusalV3, and retryIncompletePlaybackSettingsV3 converts marked refusals into retryable planning failures when settings could not be loaded. Unmarked refusals stay unchanged.TerminalNoAlternateVersionV3andTerminalSubtitleConversionUnsupportedV3in protocol_v3.go; replaces string literals in the watchtogether fallback reasons.Macroscope summarized 39e90da.