From ab8c58ff23bf36551e1df8332a2d969a72b2da59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:35:15 +0000 Subject: [PATCH] fix: improve test match specificity and rollback error message per code review Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/spec-kit/sessions/40d5aec5-d8e9-4e3f-ae60-6cf67ff491f3 --- src/specify_cli/__init__.py | 3 ++- tests/test_agent_pack.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index 5a65e6d8..86252fc0 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -2731,7 +2731,8 @@ def agent_switch( ) options["agent_switch_error"] = ( f"Switch to '{agent_id}' failed after teardown of " - f"'{current_agent}'. Restore manually." + f"'{current_agent}'. Run 'specify init --here --agent " + f"{current_agent}' to restore." ) init_options_file.write_text( json.dumps(options, indent=2), encoding="utf-8" diff --git a/tests/test_agent_pack.py b/tests/test_agent_pack.py index e3b66057..ff258a00 100644 --- a/tests/test_agent_pack.py +++ b/tests/test_agent_pack.py @@ -344,7 +344,7 @@ class TestDefaultBootstrap: data["command_registration"]["commands_dir"] = "" m = AgentManifest.from_dict(data) b = DefaultBootstrap(m) - with pytest.raises(AgentPackError, match="empty commands_dir"): + with pytest.raises(AgentPackError, match=f"Agent '{m.id}' has an empty commands_dir"): b.agent_dir(tmp_path)