Repository navigation
Add “Keep Custom Streams” profile option so plugin fallback streams aren’t removed - #555
CurtisFeatures wants to merge 3 commits into
Conversation
bttfw
left a comment
There was a problem hiding this comment.
The per-profile option is useful: plugin-managed fallback streams should survive normal channel maintenance and remain at the end. I approved the pending Tests and CodeQL workflows; all six checks are now green on 4296ca80adbac1b819a20ccdf382430f62938305.
Requesting changes because the complete checker/validation paths still break preservation in two cases, detailed in the inline comments:
- A healthy, higher-scoring custom stream can consume the only normal stream slot before it is moved to the end. With
stream_limit=1,provider_stream_limit=0, real streams 1/2 and custom 900, the writer receives[900]; preservation should retain[1, 900]. Separate preserved custom streams before every normal candidate/limit selection, and append them only after selecting the real streams. - Regex validation keeps an offline custom stream in its intermediate list, but its real
update_channel_streams()call still filters it out. Carry the protected custom IDs through the actual validation write. Do not allow all dead provider streams as a workaround. The checker also still schedules and marks a preserved custom stream dead before subtracting it from the local ID set; address that tracker side effect or consistently protect the stream in every subsequent write path.
Validation: 116 existing targeted/runtime tests passed locally (41 profile/inventory/validation tests and 75 checker/integration tests). The additional 29-case matrix below has 24 passes and 5 failures on this exact head: the limit failure in both normal and sequential entry points, the retained dead-tracker marking in both entry points, and offline removal during validation. Disabled preservation, lower-ranked custom streams, provider-cap selection and SQL create/update round-trip controls pass. These are isolated tests with controlled analysis results and mocked external I/O, using the real quality sort, checker/validator methods and validation writer/dead filtering. No live Unraid validation has been performed for this PR.
Please add regression coverage for both failures, including both checker entry points, then rerun CI. Also please target dev for our validation/merge flow; the PR currently targets main.
Runnable review regressions (save as backend/tests/test_pr555_review_reproductions.py)
From the repository root with backend test dependencies installed:
PYTHONPATH=backend python -m pytest backend/tests/test_pr555_review_reproductions.py -q"""Local review reproductions for PR 555, exact head 4296ca80; no live requests."""
import json
from unittest.mock import Mock, patch
import pytest
from apps.stream.stream_checker_service import StreamCheckerService
from backend.tests.test_concurrent_limiter_integration import (
_make_bitrate_runtime_udi,
_configure_bitrate_runtime_service,
)
def run_checker(monkeypatch, *, preserve=True, custom_dead=False, custom_score=.99,
provider_cap=0, sequential=False):
streams = [
{'id': sid, 'name': f'Feed {sid}', 'url': f'http://provider.invalid/{sid}',
'm3u_account': 1 if sid != 900 else None, 'is_custom': sid == 900,
'stream_stats': {}}
for sid in (1, 2, 900)
]
udi = _make_bitrate_runtime_udi(77, streams)
profile = {'id': 'review', 'name': 'Review',
'stream_matching': {'enabled': True, 'preserve_custom_streams': preserve},
'stream_checking': {'enabled': True, 'stream_limit': 1,
'provider_stream_limit': provider_cap,
'remove_dead_streams': True, 'allow_revive': True,
'm3u_priority_mode': 'quality', 'grace_period': False}}
service = StreamCheckerService()
_configure_bitrate_runtime_service(service, {'channels': {}})
monkeypatch.setattr('apps.stream.stream_checker_service.get_udi_manager', lambda: udi)
monkeypatch.setattr('apps.stream.stream_checker_service.get_automation_config_manager',
lambda: Mock(get_profile=Mock(return_value=profile)))
monkeypatch.setattr('apps.stream.stream_checker_service.fetch_channel_streams', lambda cid: streams)
monkeypatch.setattr('apps.stream.stream_checker_service._get_base_url', lambda: 'http://dispatcharr.invalid')
monkeypatch.setattr('apps.stream.stream_checker_service.batch_update_stream_stats', Mock(return_value=(3, 0)))
writer = Mock(return_value=True)
monkeypatch.setattr('apps.stream.stream_checker_service.update_channel_streams', writer)
monkeypatch.setattr('apps.stream.stream_checker_service.get_session_manager',
lambda: Mock(is_channel_in_active_session=Mock(return_value=False)))
service._require_quality_check_connectivity = Mock(return_value=None)
service._check_channel_limits = Mock(return_value=None)
service._get_active_viewer_protected_stream_ids = Mock(return_value=set())
service._run_deferred_bitrate_rechecks = Mock()
service._is_stream_dead = lambda item, *a, **kw: (
custom_dead and item['stream_id'] == 900,
'offline' if custom_dead and item['stream_id'] == 900 else '',
)
service._calculate_stream_score = lambda item, *a, **kw: {1: .8, 2: .5, 900: custom_score}[item['stream_id']]
scheduler = Mock()
scheduler.check_streams_with_limits.return_value = [
{'stream_id': s['id'], 'stream_name': s['name'], 'stream_url': s['url'],
'status': 'OK', 'resolution': '1920x1080', 'fps': 50,
'bitrate_kbps': 5000, 'video_codec': 'h264', 'audio_codec': 'aac'}
for s in streams
]
monkeypatch.setattr('apps.stream.concurrent_stream_limiter.get_smart_scheduler', lambda **kw: scheduler)
check = service._check_channel_sequential if sequential else service._check_channel_concurrent
result = check(77, forced_profile_id='review', force_check_override=True)
assert not result.get('error'), result
written = writer.call_args.args[1]
marked = [call.args[1] for call in service.dead_streams_tracker.mark_as_dead.call_args_list]
print(json.dumps({'preserve': preserve, 'custom_dead': custom_dead,
'custom_score': custom_score, 'provider_cap': provider_cap,
'sequential': sequential,
'written_ids': written, 'marked_dead_ids': marked,
'scheduled_ids': [s['id'] for s in scheduler.check_streams_with_limits.call_args.kwargs['streams']]}))
return written, marked
@pytest.mark.parametrize('preserve', [False, True])
@pytest.mark.parametrize('provider_cap', [0, 1])
@pytest.mark.parametrize('custom_score', [.99, .1])
@pytest.mark.parametrize('sequential', [False, True])
def test_custom_does_not_consume_real_stream_limit(monkeypatch, preserve, provider_cap,
custom_score, sequential):
written, _ = run_checker(monkeypatch, preserve=preserve, provider_cap=provider_cap,
custom_score=custom_score, sequential=sequential)
expected = [1, 900] if preserve else ([900] if custom_score > .8 and not provider_cap else [1])
assert written == expected
@pytest.mark.parametrize('preserve', [False, True])
@pytest.mark.parametrize('sequential', [False, True])
def test_preserved_custom_is_not_still_marked_dead(monkeypatch, preserve, sequential):
_, marked = run_checker(monkeypatch, preserve=preserve, custom_dead=True, sequential=sequential)
assert (900 in marked) is (not preserve)
@pytest.mark.parametrize('preserve', [False, True])
@pytest.mark.parametrize('offline', [False, True])
@pytest.mark.parametrize('remove_dead', [False, True])
def test_validation_keeps_custom_even_if_tracker_says_offline(monkeypatch, preserve, offline, remove_dead):
from apps.core import api_utils
from backend.tests.test_scheduled_validate_existing_streams import (
TestValidateExistingStreamsIsAuthoritative, STREAMS, _profile,
)
case = TestValidateExistingStreamsIsAuthoritative()
case.setUp()
try:
case._add_custom_stream()
STREAMS[-1]['url'] = 'http://custom.invalid/fallback'
case.manager._is_dead_stream_removal_enabled = Mock(return_value=remove_dead)
real_writer = api_utils.update_channel_streams
case.mock_update_streams.side_effect = real_writer
monkeypatch.setattr(api_utils, 'get_valid_stream_ids', lambda: {101, 102, 900})
monkeypatch.setattr(api_utils, 'get_streams', lambda **kw: list(STREAMS))
monkeypatch.setattr(api_utils, '_get_base_url', lambda: 'http://dispatcharr.invalid')
monkeypatch.setattr(api_utils, '_verify_channel_assignment_after_patch', Mock(return_value=True))
http_patch = Mock(return_value=Mock(status_code=200))
monkeypatch.setattr(api_utils, 'patch_request', http_patch)
tracker = Mock()
tracker.get_dead_stream_reasons.return_value = {'http://custom.invalid/fallback': 'offline'} if offline else {}
with patch('apps.stream.dead_streams_tracker.DeadStreamsTracker', return_value=tracker):
results = case._run(force=False, profile=_profile(
validate_existing_streams=True, preserve_custom_streams=preserve))
assert not results.get('error'), results
written = http_patch.call_args.args[1]['streams']
print(json.dumps({'validation_keep_ids': case.mock_update_streams.call_args.args[1],
'preserve': preserve, 'offline': offline, 'remove_dead': remove_dead,
'actual_patch_ids': written}))
assert written == ([101, 900] if preserve else [101])
finally:
case.doCleanups()
def test_preserve_option_survives_sql_profile_round_trip():
from apps.automation.automation_config_manager import AutomationConfigManager
manager = AutomationConfigManager()
profile_id = manager.create_profile({'name': 'Review preservation', 'stream_matching': {
'enabled': True, 'preserve_custom_streams': True}})
assert profile_id
assert manager.get_profile(profile_id)['stream_matching']['preserve_custom_streams'] is True
assert manager.update_profile(profile_id, {'stream_matching': {
'enabled': True, 'preserve_custom_streams': False}})
assert manager.get_profile(profile_id)['stream_matching']['preserve_custom_streams'] is False|
|
||
| protected_write_stream_ids = set(protected_active_stream_ids) | ||
| if custom_stream_ids: | ||
| reordered_ids = self._append_custom_stream_ids(reordered_ids, custom_stream_ids) |
There was a problem hiding this comment.
[P1] Exclude preserved custom streams before applying the normal stream limit
_select_profile_streams() has already truncated the scored list at lines 1121–1125, while custom IDs are only appended here. A higher-ranked custom fallback therefore consumes a real-stream slot. Reproduced through the complete checker with preservation on, stream_limit=1, provider cap disabled, scores custom 900=.99 / real 1=.8 / real 2=.5: the actual write is [900], expected [1, 900]. Both _check_channel_concurrent() and the sequential entry point fail. Remove preserved custom candidates from the normal selection/limit pipeline before truncation, then append their original IDs last; add a checker-level regression rather than only testing _append_custom_stream_ids().
| # Custom streams (e.g. a fallback/slate added by a plugin) have no | ||
| # provider name to match against; optionally never treat them as | ||
| # regex mismatches. | ||
| if preserve_custom and full_stream.get('is_custom', False): |
There was a problem hiding this comment.
[P1] Preserve the custom IDs through the real validation write
Adding an ID to streams_to_keep does not exempt it from the writer's dead-stream filter. With preservation and dead removal enabled, an offline custom 900, matching real 101 and nonmatching real 102, validation computes [101, 900], but update_channel_streams() at line 5234 receives no protected_stream_ids and the actual PATCH contains only [101]. This can occur after this PR's checker still calls mark_as_dead() for the custom stream; subtracting from the local dead_stream_ids set does not clear that stored state. Pass the applicable protected custom IDs through validation to the writer and cover the actual filter/PATCH boundary. The existing validation test mocks update_channel_streams() itself, so it misses the removal.
There was a problem hiding this comment.
Thanks for the detailed review and the reproductions. Both issues are fixed,
and the branch is rebased onto dev and retargeted.
-
Stream limit: with preserve_custom_streams on, custom streams are now
split out of the evaluated set before probing, scoring and limit
selection, then appended last at write-back. Your repro (limit 1, real
1/2, custom 900) now writes [1, 900]. They are also never probed or
marked dead, and a stale dead marker is cleared. -
Validation: the preserved custom IDs are passed as protected_stream_ids
to the real update_channel_streams() call, so an offline custom stream
that regex validation kept survives the dead-stream filter.
Also: _check_channel_sequential only delegates to
_check_channel_concurrent, so the earlier edits to its unreachable body
are reverted; the tests cover both entry points through the real checker.
Tests added: checker-level cases for both entry points (limit repro,
offline custom stream, stale dead marker, custom-only channel, disabled
control) and two tests of the real validation write (patch payload with
and without the option). The new tests fail on the previous head and
pass now; full backend suite passes locally (2557 passed).
Live check: tested on a Dispatcharr + Unraid setup with could-not-dispatch.
The fallback stream stays last on the channel through repeated stream
checks and no longer appears in "Removing dead streams" log lines.
4296ca8 to
1ee85d6
Compare
|
Thanks for addressing the two findings and adding regression coverage. The PR still targets GitHub also currently reports merge conflicts for this PR. Please retarget and update against Please make these changes yourself in this existing PR and reply when it targets |
Add "Keep Custom Streams" option to Stream Matching profile settings Validate Existing Streams removes any channel stream that doesn't match the channel's regex/TVG-ID rules. Custom streams (is_custom), such as a fallback/slate stream added by a Dispatcharr plugin, have no provider name to match, so they were removed on every validation pass. Add a per-profile stream_matching.preserve_custom_streams option (default off, so existing behaviour is unchanged). When on, validation keeps custom streams and still prunes non-matching provider streams. - backend: read the option per channel and skip custom streams in _validate_channels_batch - frontend: add "Keep Custom Streams" switch on the Stream Matching tab - tests: cover custom stream removed by default and kept when enabled - docs: document the option in automation.md and stream-matching.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TH51arYfwxXoSsAUvZNPEm
The stream checker marked a plugin's fallback stream dead and removed it, cut it with the stream limit, or ranked it above real streams. With stream_matching.preserve_custom_streams on, custom streams are no longer treated as dead, are re-appended last after limiting, and are exempt from the dead-stream filter at write-back. Adds helper tests and updates docs and the switch description.
…lidation writes Review fixes for the Keep Custom Streams option: - Stream checker: with stream_matching.preserve_custom_streams on, custom streams are split out of the evaluated set before probing, scoring and stream-limit selection, then appended last at write-back. A high-scoring custom stream can no longer consume a real stream's slot (limit 1 with real 1/2 and custom 900 now writes [1, 900]). They are never probed or marked dead, and a stale dead marker is cleared. - Validation: pass the preserved custom IDs as protected_stream_ids to the real update_channel_streams() write so the dead-stream filter cannot drop an offline custom stream that regex validation kept. - Revert edits to the unreachable body of _check_channel_sequential; the legacy entry point delegates to _check_channel_concurrent. - Tests drive both checker entry points and the real validation writer and dead-stream filter (only HTTP and the tracker are mocked).
1ee85d6 to
b431d80
Compare
bttfw
left a comment
There was a problem hiding this comment.
Thanks for retargeting this to dev and fixing the two earlier findings. Reviewed and tested exact head b431d800197a14a3ed3ac4d97328c68e3083f890 against dev (ea21c505). The previous 29-case review matrix now passes, and all 55 targeted preservation/validation/scheduling/provider-cap/active-viewer tests pass.
One additional automation-path regression still blocks approval:
- Assign normal stream
101and custom fallback900to a channel;900has an existingofflinerecord in the real dead-stream tracker (for example, from before enabling preservation). - Enable
stream_matching.preserve_custom_streams, dead-stream removal, and checking withallow_revive=falseandstream_limit=1. Make normal stream102a newly discovered regex match. - Execute the real phase methods in automation order: validation -> discovery/assignment -> quality checking.
Observed assignments: [101,900] after validation -> [101,102] after discovery -> [101] after the completed quality check. Expected final assignment: [101,900]. Discovery's append write already filters the existing custom ID out; the checker cannot recover an ID that is no longer assigned. The same result occurs through both concurrent and sequential checker entry points.
Please extend the preservation policy to the matching/discovery append path before its dead-stream filter can remove existing custom IDs. Keep this scoped to the channel's effective profile and retain the normal dead-provider-stream filtering. Please add the regression below (or equivalent coverage) and push the fix on your branch.
Verified reproduction: 2 failed, 6 passed on this exact head. It uses the real validation/discovery/checker implementations, real add/update assignment writers, real dead filtering, and an isolated real SQL dead-stream tracker. External HTTP/UDI/probe results and unrelated capacity/session state are controlled; assignment PATCH payloads are captured. The check completes without skipping.
CI was also refreshed and approved on this head: backend stable 2,456 passed / 1 skipped, integration 101 passed / 1 skipped, and CodeQL passed. The frontend job stops at npm audit --audit-level=high on the picomatch advisory GHSA-fc5q-39xc-vjpf, before frontend tests/build. Both frontend package manifests are unchanged from current dev, so this is a separate inherited dependency gate, not attributed to your patch. CI run.
Native Unraid acceptance and merging remain pending until the functional regression and required checks pass.
Runnable regression: save as backend/tests/test_preserve_custom_streams_matching_review.py
Run from the repository root in the test environment:
PYTHONPATH=backend python -m pytest -q -s backend/tests/test_preserve_custom_streams_matching_review.py"""Review the validation -> discovery append path before quality checking."""
import json
from unittest.mock import Mock
import pytest
pytestmark = pytest.mark.integration
@pytest.mark.parametrize('preserve', [False, True])
@pytest.mark.parametrize('allow_revive', [False, True])
@pytest.mark.parametrize('sequential', [False, True])
def test_existing_offline_custom_survives_matching_append(monkeypatch, preserve, allow_revive, sequential):
from apps.automation import automated_stream_manager as asm
from apps.core import api_utils
from apps.database.manager import get_db_manager
from apps.stream.stream_checker_service import StreamCheckerService
from backend.tests.test_concurrent_limiter_integration import (
_make_bitrate_runtime_udi, _configure_bitrate_runtime_service,
)
rows = [
{'id': 101, 'name': 'News One', 'url': 'http://provider.invalid/101', 'm3u_account': 1},
{'id': 102, 'name': 'News Two', 'url': 'http://provider.invalid/102', 'm3u_account': 1},
{'id': 900, 'name': 'Fallback', 'url': 'http://custom.invalid/offline',
'm3u_account': None, 'is_custom': True},
]
by_id = {row['id']: row for row in rows}
assigned = [101, 900]
channel = {'id': 1, 'name': 'News', 'channel_group_id': None, 'streams': assigned, 'tvg_id': 'news'}
account = {'id': 1, 'name': 'Provider', 'is_active': True, 'max_streams': 1}
profile = {'id': 'p', 'name': 'Preservation',
'stream_matching': {'enabled': True, 'validate_existing_streams': True,
'preserve_custom_streams': preserve},
'stream_checking': {'enabled': True, 'allow_revive': allow_revive,
'remove_dead_streams': True, 'stream_limit': 1},
'global_action': {'affected': False}}
effective = {'profile': profile, 'period_id': 'p1',
'periods': [{'id': 'p1', 'name': 'P1', 'profile': profile}]}
udi = _make_bitrate_runtime_udi(1, rows)
udi.get_channels.side_effect = lambda: [channel]
udi.get_channel_by_id.side_effect = lambda cid: dict(channel)
udi.get_channel_streams.side_effect = lambda cid: [by_id[sid] for sid in assigned]
udi.get_streams.return_value = rows
udi.get_m3u_accounts.return_value = [account]
udi.get_stream_by_id.side_effect = by_id.get
udi.get_valid_stream_ids.return_value = set(by_id)
acm = Mock()
acm.get_effective_configuration.return_value = effective
acm.get_profile.return_value = profile
monkeypatch.setattr(asm, 'get_udi_manager', lambda: udi)
monkeypatch.setattr(asm, 'get_automation_config_manager', lambda: acm)
monkeypatch.setattr('apps.automation.automation_config_manager.get_automation_config_manager', lambda: acm)
monkeypatch.setattr(asm, 'get_m3u_accounts', lambda: [account])
monkeypatch.setattr(asm, 'get_streams', lambda **kw: rows)
monkeypatch.setattr(asm, 'get_stream_checker_service', lambda: Mock())
sessions = Mock()
sessions.get_channels_in_active_sessions.return_value = []
sessions.get_active_sessions.return_value = []
sessions.is_channel_in_active_session.return_value = False
monkeypatch.setattr('apps.stream.stream_session_manager.get_session_manager', lambda: sessions)
assert get_db_manager().set_system_setting(
'stream_checker_config', {'dead_stream_handling': {'enabled': True}})
manager = asm.AutomatedStreamManager()
manager.config['enabled_features']['changelog_tracking'] = False
manager._m3u_accounts_cache = [account]
assert manager._is_dead_stream_removal_enabled()
manager.regex_matcher.add_channel_pattern(
channel_id='1', name='News', regex_patterns=[r'^News '], enabled=True)
manager.dead_streams_tracker.mark_as_dead(rows[-1]['url'], 900, 'Fallback', 1, reason='offline')
monkeypatch.setattr(api_utils, 'get_udi_manager', lambda: udi)
monkeypatch.setattr(api_utils, 'get_streams', lambda **kw: rows)
monkeypatch.setattr(api_utils, 'get_valid_stream_ids', lambda: set(by_id))
monkeypatch.setattr(api_utils, '_fetch_authoritative_channel_stream_ids', lambda cid: list(assigned))
monkeypatch.setattr(api_utils, '_get_base_url', lambda: 'http://dispatcharr.invalid')
payloads = []
def patch_assignment(url, payload):
payloads.append(list(payload['streams']))
assigned[:] = payload['streams']
return Mock(status_code=200)
monkeypatch.setattr(api_utils, 'patch_request', patch_assignment)
validation = manager.validate_and_remove_non_matching_streams(force=False, skip_changelog=True)
assert not validation.get('error'), validation
before_matching = list(assigned)
if preserve:
assert before_matching == [101, 900]
result = manager.discover_and_assign_streams(force=True, skip_check_trigger=True, skip_changelog=True)
assert result.get('success', True), result
assert 102 in assigned, result
after_matching = list(assigned)
# Continue the same automation order through the real checker. A source
# dropped by discovery is no longer in the channel's fetched stream list.
checker = StreamCheckerService()
_configure_bitrate_runtime_service(checker, {'channels': {}})
checker.dead_streams_tracker = manager.dead_streams_tracker
monkeypatch.setattr('apps.stream.stream_checker_service.get_udi_manager', lambda: udi)
monkeypatch.setattr('apps.stream.stream_checker_service.get_automation_config_manager', lambda: acm)
monkeypatch.setattr('apps.stream.stream_checker_service.get_session_manager', lambda: sessions)
monkeypatch.setattr('apps.stream.stream_checker_service.fetch_channel_streams',
lambda cid: [by_id[sid] for sid in assigned])
monkeypatch.setattr('apps.stream.stream_checker_service._get_base_url', lambda: 'http://dispatcharr.invalid')
monkeypatch.setattr('apps.stream.stream_checker_service.batch_update_stream_stats', Mock(return_value=(2, 0)))
checker._require_quality_check_connectivity = Mock(return_value=None)
checker._check_channel_limits = Mock(return_value=None)
checker._get_active_viewer_protected_stream_ids = Mock(return_value=set())
checker._run_deferred_bitrate_rechecks = Mock()
checker._is_stream_dead = lambda row, *a, **kw: (False, '')
checker._calculate_stream_score = lambda row, *a, **kw: {101: .8, 102: .6, 900: .99}[row['stream_id']]
scheduler = Mock()
scheduler.check_streams_with_limits.side_effect = lambda streams, **kw: [
{'stream_id': row['id'], 'stream_name': row['name'], 'stream_url': row['url'],
'resolution': '1920x1080', 'fps': 50, 'bitrate_kbps': 5000,
'video_codec': 'h264', 'audio_codec': 'aac'} for row in streams]
monkeypatch.setattr('apps.stream.concurrent_stream_limiter.get_smart_scheduler', lambda **kw: scheduler)
check = checker._check_channel_sequential if sequential else checker._check_channel_concurrent
checked = check(1, forced_profile_id='p', force_check_override=True)
assert not checked.get('error'), checked
assert not checked.get('skipped'), checked
print(json.dumps({'preserve': preserve, 'allow_revive': allow_revive, 'sequential': sequential,
'before_matching': before_matching, 'after_matching': after_matching,
'after_quality_check': assigned,
'actual_patches': payloads}))
assert (900 in assigned) is preserve| url = stream.get('url') | ||
| tracker = getattr(self, 'dead_streams_tracker', None) | ||
| if url and tracker is not None and tracker.is_dead(url): | ||
| tracker.mark_as_alive(url) |
There was a problem hiding this comment.
[P1] Preserve existing custom IDs during discovery before checking
Clearing stale custom dead markers here runs too late in a normal automation cycle: validation is followed by discovery/assignment before the quality checker. With preservation enabled, dead removal enabled, allow_revive=false, an already assigned offline custom 900, and a new normal regex match 102, discover_and_assign_streams() -> assign_streams_to_channel() -> add_streams_to_channel() calls the real update writer without custom-ID protection. It filters [101,900,102] to [101,102] before this helper can run; the subsequent completed checker leaves [101] instead of [101,900]. Please protect preserved customs in that append path too, scoped to the effective profile. The review body includes the full-phase regression: both checker entry points fail, with six passing controls.
Problem
Plugins such as could-not-dispatch add a custom fallback stream
(is_custom) as the last stream on every channel. StreamFlow removes it
in two places: "Validate Existing Streams" (it never matches a regex)
and the stream checker (marks it dead, applies the stream limit, and
re-ranks it by quality).
Change
New per-profile option stream_matching.preserve_custom_streams, shown as
"Keep Custom Streams" on the Stream Matching tab. Default off, so
existing behaviour is unchanged. When on:
stream limit, and exempts them from the dead-stream filter
Testing