fix(refresh-marketplace): align manual-mode hint with hook JSON

Hook JSON path uses /reload-plugins (no restart needed); manual-mode
echo path was still telling the operator to /exit + restart. Both now
say /reload-plugins.

Tests renamed to *_reload_hint_* to match the new wording.
This commit is contained in:
Minas Arustamyan 2026-05-07 02:29:58 +02:00 committed by ZdenekSrotyr
parent 3aeb0f2fbd
commit cd10aefdbd
2 changed files with 9 additions and 13 deletions

View file

@ -113,9 +113,8 @@ def refresh_marketplace(
_emit_hook_message(events) _emit_hook_message(events)
elif not quiet and (events["installed"] or events["updated"]): elif not quiet and (events["installed"] or events["updated"]):
typer.echo( typer.echo(
"\nRestart Claude Code (`/exit`, then `claude`) to load the " "\nRun `/reload-plugins` in Claude Code to load the "
"new/updated plugins — they're on disk now but Claude only " "new/updated plugins into the running session — no restart needed."
"picks them up on session start."
) )

View file

@ -475,13 +475,13 @@ def test_quiet_emits_hook_json_when_plugin_installed(
assert "/reload-plugins" in additional assert "/reload-plugins" in additional
def test_manual_mode_prints_restart_hint_when_anything_changed( def test_manual_mode_prints_reload_hint_when_anything_changed(
with_clone, with_token, claude_in_path, recorder, monkeypatch, tmp_path, with_clone, with_token, claude_in_path, recorder, monkeypatch, tmp_path,
): ):
"""When `agnes refresh-marketplace` runs without --quiet AND something """When `agnes refresh-marketplace` runs without --quiet AND something
actually got installed/updated, the operator needs to know they should actually got installed/updated, the operator needs to know they should
/exit + restart Claude Code for the change to take effect (Claude only `/reload-plugins` in Claude Code to pick up the change. Print the hint
scans plugins at session start). Print the hint at end of run.""" at end of run."""
workspace = tmp_path / "ws" workspace = tmp_path / "ws"
workspace.mkdir() workspace.mkdir()
monkeypatch.chdir(workspace) monkeypatch.chdir(workspace)
@ -492,15 +492,14 @@ def test_manual_mode_prints_restart_hint_when_anything_changed(
result = runner.invoke(refresh_marketplace_app, []) result = runner.invoke(refresh_marketplace_app, [])
assert result.exit_code == 0 assert result.exit_code == 0
out = _clean(result.output) out = _clean(result.output)
assert "Restart Claude Code" in out or "restart" in out.lower() assert "/reload-plugins" in out
assert "/exit" in out
def test_manual_mode_no_change_does_not_print_restart_hint( def test_manual_mode_no_change_does_not_print_reload_hint(
with_clone, with_token, claude_in_path, recorder, monkeypatch, tmp_path, with_clone, with_token, claude_in_path, recorder, monkeypatch, tmp_path,
): ):
"""Manual `agnes refresh-marketplace` over an already-up-to-date stack """Manual `agnes refresh-marketplace` over an already-up-to-date stack
must NOT spam the restart hint there's nothing to restart for.""" must NOT spam the reload hint there's nothing to reload for."""
workspace = tmp_path / "ws" workspace = tmp_path / "ws"
workspace.mkdir() workspace.mkdir()
monkeypatch.chdir(workspace) monkeypatch.chdir(workspace)
@ -514,9 +513,7 @@ def test_manual_mode_no_change_does_not_print_restart_hint(
result = runner.invoke(refresh_marketplace_app, []) result = runner.invoke(refresh_marketplace_app, [])
assert result.exit_code == 0 assert result.exit_code == 0
out = _clean(result.output) out = _clean(result.output)
# The restart hint sentence specifically — not the substring "restart" assert "/reload-plugins" not in out
# which might appear elsewhere benignly.
assert "Restart Claude Code" not in out
def test_quiet_emits_hook_json_when_bundle_silently_auto_updated_by_claude( def test_quiet_emits_hook_json_when_bundle_silently_auto_updated_by_claude(