Skip to content

fix(tui): persist plugin activation choices #42417

Description

@kitlangton

Problem

In the V2 TUI, /plugins currently mutates only the running registration. Editing any plugin source triggers reconciliation from config, which can re-enable unrelated plugins that the user manually disabled. The choice also does not survive a TUI restart.

Desired Behavior

A plugin disabled through /plugins remains disabled when:

  • another plugin source reloads;
  • its own source reloads;
  • the TUI restarts.

Enabling it again should remove or replace that durable preference without disturbing its package declaration or options.

Design Question

Choose a durable config representation. The simplest candidate for declared external plugins is:

{
  "package": "/path/to/plugin.ts",
  "enabled": false,
  "options": {}
}

Built-ins and auto-discovered plugins still require an ID-based override or another explicit representation because they have no package declaration.

PR #42410 demonstrates the bug, regression coverage, and an initial ordered-directive implementation. Finalize the config model before merging.

Acceptance Criteria

  • Activation choice is durable and config-backed.
  • Unrelated hot reload does not reactivate disabled plugins.
  • Package paths and options remain intact.
  • Built-in and discovered plugin behavior is explicit.
  • Reload and restart behavior have regression coverage.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions