From d9405a6888ab2ecbe5a2a6cc49b6d37da0baaa22 Mon Sep 17 00:00:00 2001 From: minasarustamyan <156230623+minasarustamyan@users.noreply.github.com> Date: Sat, 9 May 2026 21:10:39 +0200 Subject: [PATCH] Move marketplace plugin updates from hook to /update-agnes-plugins skill (#237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move marketplace plugin updates from hook to /update-agnes-plugins skill The SessionStart hook used to run `agnes refresh-marketplace --quiet`, which performed a full fetch+reset+install cycle on every Claude Code session start. That work was invisible to the user, slowed session startup, and was unrecoverable interactively when something failed. Split the responsibility: - `agnes refresh-marketplace --check` is a new lightweight detector: `git fetch` only, compares local HEAD with remote FETCH_HEAD, emits a Claude Code hook JSON message pointing the user at `/update-agnes-plugins` when the marketplace has changes. No reset, no plugin install/update side effects. - `/update-agnes-plugins` is a new slash command (installed by `agnes init` into `/.claude/commands/`) that runs `agnes refresh-marketplace` (default chatty path). Output streams into the Claude Code transcript so the user sees install/update progress and can react to errors interactively. - The SessionStart hook now runs `--check`. Existing workspaces auto-upgrade on next `agnes init` (substring marker matches both the old `--quiet` entry and the new `--check` one). BREAKING: `agnes refresh-marketplace --quiet` is removed. Old hooks calling it silent-noop after the CLI upgrade (the hook's `|| true` swallows the unknown-flag error) until re-init rewrites them. * Point marketplace 'Added to your stack' hint at /update-agnes-plugins The post-install green panel on plugin and skill/agent detail pages referenced the SessionStart auto-install path and a shell-prompt `agnes refresh-marketplace` invocation. With the hook now being detect-only, that copy was misleading — the actual install path is the new slash command. Condensed to a single instruction: "Open a new Claude Code session and run:" followed by `/update-agnes-plugins` in a copy-chip. JS clipboard string updated to match. --------- Co-authored-by: Minas Arustamyan --- CHANGELOG.md | 47 +++ .../templates/marketplace_item_detail.html | 20 +- .../templates/marketplace_plugin_detail.html | 20 +- cli/commands/init.py | 6 +- cli/commands/refresh_marketplace.py | 186 ++++++--- cli/lib/commands.py | 82 ++++ cli/lib/hooks.py | 20 +- .../commands/update-agnes-plugins.md | 19 + tests/test_cli_refresh_marketplace.py | 390 +++++++++--------- tests/test_lib_commands.py | 83 ++++ tests/test_lib_hooks.py | 57 +++ 11 files changed, 647 insertions(+), 283 deletions(-) create mode 100644 cli/lib/commands.py create mode 100644 cli/templates/commands/update-agnes-plugins.md create mode 100644 tests/test_lib_commands.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ed4ad..0f6414f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,55 @@ CalVer image tags (`stable-YYYY.MM.N`, `dev-YYYY.MM.N`) are produced for every C ## [Unreleased] +### Added + +- **`/update-agnes-plugins` slash command** — installed automatically by + `agnes init` into `/.claude/commands/`. Runs + `agnes refresh-marketplace` (the chatty default mode) so the user sees + install/update progress streamed into the Claude Code transcript and + can react to errors interactively, instead of having a full reconcile + happen silently behind a SessionStart hook. + +- **`agnes refresh-marketplace --check`** — lightweight detector mode for + the SessionStart hook. Runs `git fetch` only, compares local `HEAD` + with remote `FETCH_HEAD`, and emits a Claude Code hook JSON message + pointing the user at `/update-agnes-plugins` when there are remote + changes. Silent when up to date. No `git reset`, no + `claude plugin marketplace update`, no plugin install/update side + effects. + +### Changed + +- **SessionStart marketplace hook is now read-only.** The hook installed + by `agnes init` was previously `agnes refresh-marketplace --quiet`, + which performed a full fetch+reset+install cycle on every session start + (slow, invisible to the user, not interactively recoverable). It now + runs `agnes refresh-marketplace --check` — detect-only — and surfaces a + hint to run `/update-agnes-plugins` when updates are available. + Existing workspaces auto-upgrade on next `agnes init` (the substring + marker `agnes refresh-marketplace` matches both the old and new entry + shapes, so the idempotent-replace path correctly rewrites them). + +- **Marketplace "Added to your stack" hint points at `/update-agnes-plugins`.** + The post-install green panel on plugin and skill/agent detail pages + used to suggest `agnes refresh-marketplace` in a shell prompt and + reference the SessionStart auto-install. With the hook now being + detect-only, that text was outdated. The hint is condensed to a + single instruction — open a new Claude Code session and run + `/update-agnes-plugins` — with the slash command in a copy chip. + Affects `marketplace_plugin_detail.html` and `marketplace_item_detail.html`. + ### Removed +- **BREAKING: `agnes refresh-marketplace --quiet` flag.** Replaced by + `--check` (detect-only) and the new `/update-agnes-plugins` slash + command (interactive update). Existing SessionStart hooks calling + `--quiet` will silent-noop after the CLI upgrade — the hook's + `2>/dev/null || true` swallows the unknown-flag error — until the user + re-runs `agnes init`, which rewrites the hook to use `--check` and + installs the slash command. Dashboard `/setup` flow re-runs + `agnes init` automatically on next paste. + - **BREAKING: legacy `git config --global http..sslVerify=false` downgrade in the install setup prompt.** The marketplace step (step 5) used to emit this line on `AGNES_DEBUG_AUTH=1` instances when no diff --git a/app/web/templates/marketplace_item_detail.html b/app/web/templates/marketplace_item_detail.html index 4817218..41a9ac6 100644 --- a/app/web/templates/marketplace_item_detail.html +++ b/app/web/templates/marketplace_item_detail.html @@ -523,18 +523,12 @@ ✓ Added to your stack -
To use it in Claude Code:
-
    -
  1. Open a new Claude Code session — it auto-installs via the SessionStart hook.
  2. -
  3. Or run now in your terminal: -
    - $ - agnes refresh-marketplace - -
    - Then in the running session: /reload-plugins -
  4. -
+
Open a new Claude Code session and run:
+
+ / + update-agnes-plugins + +