Skip to content

feat(sessions): master switches for external sources and hooks#396

Merged
sudomaggie merged 1 commit into
developfrom
feat/session-source-master-switches
Jul 16, 2026
Merged

feat(sessions): master switches for external sources and hooks#396
sudomaggie merged 1 commit into
developfrom
feat/session-source-master-switches

Conversation

@Harry19081

Copy link
Copy Markdown
Member

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:

  • auto-scan scheduler, including the startup pass
  • manual "rescan all" (button disables while off)
  • sidebar/list loading — external categories clear, session_aggregate_list drops includeExternalHistory
  • the open-replay auto-refresh interval

Per-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 masterEnabled flag in the hook preferences file gates the effective install state of all 11 managed platform hooks:

  • switching off uninstalls every managed hook — signals stop at the source instead of being spawned and discarded on every external tool file operation
  • per-platform choices are preserved and reinstalled on re-enable
  • startup reconciliation honors the same effective state
  • the capture entrypoint (--session-provenance-hook) discards input as a backstop when a stale hook line survives a failed uninstall (read-only/corrupt provider config)
  • new session_provenance_hooks_master_enabled / set_master_enabled commands; the hooks panel gains a top-level toggle that disables the per-platform switches while off

Preferences use serde struct-level defaults, so existing preference files upgrade in place without a schema bump.

Verification

cargo check clean; agent_cli tests 43/43; session store vitest 127/127; eslint and tsc --noEmit clean on all touched files. zh/en strings included (other locales fall back to English).

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
@sudomaggie
sudomaggie merged commit 3c2f8ef into develop Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants