feat(sessions): master switches for external sources and hooks#396
Merged
Conversation
Two one-click kill switches (both default on) for users who want the external-session integration fully quiet: - External sessions: a persisted master flag gates every scan and load path — the auto-scan scheduler (including the startup pass), manual rescans, sidebar/list loading (external categories clear and session_aggregate_list drops includeExternalHistory) and the open replay auto-refresh. Per-source enabled flags are preserved and take effect again on re-enable. Frequency selectors and the rescan-all button disable while off. - Provenance hooks: a master flag in the hook preferences file gates the effective install state of all managed platform hooks. Switching off uninstalls every managed hook (signals stop at the source rather than being spawned and discarded); per-platform choices are kept and reinstalled on re-enable. Startup reconciliation honors the same effective state, and the capture entrypoint discards input as a backstop when a stale hook line survives a failed uninstall. New master_enabled / set_master_enabled commands; the hooks panel gets a top-level toggle that disables the per-platform switches while off. Pre-commit hook ran. Total eslint: 1, total circular: 0
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds two one-click master switches (both default on, existing users unaffected) so the external-session integration can be turned fully quiet without losing per-source configuration.
External sessions (Data Sources panel, scanning view)
A persisted flag gates every scan and load path:
session_aggregate_listdropsincludeExternalHistoryPer-source enabled flags and cadences are preserved and take effect again on re-enable; the frequency selectors grey out while off.
Provenance hooks (Data Sources panel, hooks view)
A
masterEnabledflag in the hook preferences file gates the effective install state of all 11 managed platform hooks:--session-provenance-hook) discards input as a backstop when a stale hook line survives a failed uninstall (read-only/corrupt provider config)session_provenance_hooks_master_enabled/set_master_enabledcommands; the hooks panel gains a top-level toggle that disables the per-platform switches while offPreferences use serde struct-level defaults, so existing preference files upgrade in place without a schema bump.
Verification
cargo checkclean;agent_clitests 43/43; session store vitest 127/127;eslintandtsc --noEmitclean on all touched files. zh/en strings included (other locales fall back to English).