agnes-the-ai-analyst/cli/lib
minasarustamyan 17159bfad9
fix: refresh-marketplace enables stack plugins; override sentinel is init-time only (#307)
* fix(refresh-marketplace): also enable stack plugins in workspace settings

Reconcile previously stopped at `claude plugin install --scope project`,
which only writes the global plugin registry. Without an entry in the
workspace `.claude/settings.json` `enabledPlugins` map, Claude Code
treats every plugin as disabled — `/plugins` doesn't list them and
their slash commands, skills, and agents are unreachable.

Refresh now writes the enable map after install/update, treating the
user's marketplace stack as the source of truth (re-enables anything a
prior `claude plugin disable` locally turned off). Override workspaces
are skipped via `is_override_workspace`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(override): sentinel governs init only, not runtime CLI

Sentinel `.claude/init-complete` with `override: true` was meant to
let admins ship INITIAL workspace content. The implementation was
over-scoped — `is_override_workspace` check sat inside every Agnes
writer (`install_claude_hooks`, `install_claude_commands`,
`maybe_refresh_claude_hooks`, `_enable_plugins_in_workspace_settings`),
which blocked runtime commands too. Operators on override workspaces
got trapped at the template snapshot: no `enabledPlugins` map from
`agnes refresh-marketplace`, no hook auto-migration from
`agnes self-upgrade`.

Move the check to the init-time call site (cli/commands/init.py,
`if not override_active:`) — the single place where init-time skip
is the right behavior. Writers themselves become unconditional;
runtime CLI now updates `.claude/` regardless of the sentinel.

Admin custom hooks survive — refresh only rewrites entries matching
`_OUR_COMMAND_MARKERS` (foreign commands fall through unchanged,
same contract as default workspaces).

Existing override workspaces auto-converge on next
`agnes self-upgrade` (fires from every SessionStart). No manual
migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Minas Arustamyan <arustamyan.minas@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 18:43:32 +02:00
..
__init__.py feat(cli-lib): cli/lib/hooks.py:install_claude_hooks 2026-05-04 17:53:20 +02:00
claude_sessions.py fix(push): read sessions from ~/.claude/projects/<encoded-cwd>/ 2026-05-04 20:29:59 +02:00
commands.py fix: refresh-marketplace enables stack plugins; override sentinel is init-time only (#307) 2026-05-14 18:43:32 +02:00
hooks.py fix: refresh-marketplace enables stack plugins; override sentinel is init-time only (#307) 2026-05-14 18:43:32 +02:00
initial_workspace.py feat(initial-workspace): per-instance agnes init override (#292) 2026-05-13 20:35:01 +00:00
marketplace.py feat(marketplace): clone-based plugin setup + auto-refresh SessionStart hook 2026-05-07 06:59:13 +02:00
override.py fix: refresh-marketplace enables stack plugins; override sentinel is init-time only (#307) 2026-05-14 18:43:32 +02:00
private_list.py Session capture queue, private session, and setup-prompt fixes (#242) 2026-05-11 13:31:16 +00:00
pull.py release: 0.52.0 — UX/hygiene round (5 fixes from 0.51.0 retro) 2026-05-12 15:09:14 +02:00
push_lock.py Session capture queue, private session, and setup-prompt fixes (#242) 2026-05-11 13:31:16 +00:00
session_health.py release: 0.53.2 — diagnose silent-capture check + urllib3 2.7.0 + flaky-test fix (#270) 2026-05-12 18:28:04 +02:00
session_queue.py Session capture queue, private session, and setup-prompt fixes (#242) 2026-05-11 13:31:16 +00:00