Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion agentdescent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,13 @@ def demo_payload(
target = {"text": "<your-prompt.txt>",
"skill_library": "<your-skill-library>"}.get(used_kind, "<your-skill-dir>")
if algo:
# #1145: do not point at evolve agentdescent.{algo}.spec.json — that
# file is only written when `algorithms run` succeeds, and that
# command already prints `evolve` with the absolute path it wrote.
own_steps = [
f"agentdescent algorithms run {algo} {target} <your-cases.jsonl> "
f"--model <model> [--base-url <url>] --rounds 1 --workers 1",
"agentdescent doctor",
f"agentdescent evolve agentdescent.{algo}.spec.json",
]
elif used_kind == "text":
own_steps = [
Expand Down
6 changes: 6 additions & 0 deletions changelog.d/1145-demo-algorithm-next-evolve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixed
`demo --algorithm NAME` no longer ends with `evolve agentdescent.NAME.spec.json`.
That file does not exist until `algorithms run` writes it, so following the
footer (or `--json` / MCP `next`) failed with exit 2. The footer still points
at `algorithms run NAME ...`, which plans and then prints `evolve` with the
absolute path it just wrote (#1145).
7 changes: 5 additions & 2 deletions tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def test_demo_algorithm_evoskill_runs_offline(tmp_path, monkeypatch):
assert "evoskill-select" in out, out
assert "algorithm: evoskill" in out
assert "SKILL.md" in out and "COLUMN: amount" in out
assert "agentdescent evolve agentdescent.evoskill.spec.json" not in out
spec = json.loads((tmp_path / "work" / "spec.json").read_text())
assert spec["kind"] == "skill_library"
assert spec["algorithm"]["name"] == "evoskill"
Expand Down Expand Up @@ -283,6 +284,7 @@ def test_demo_algorithm_evoskill_json(tmp_path, monkeypatch):
assert payload["learned"].lstrip().startswith("column-amount/SKILL.md") or "/SKILL.md" in payload["learned"]
assert any("show" in step for step in payload["next"])
assert any(s.startswith("agentdescent algorithms run evoskill ") for s in payload["next"])
assert "agentdescent evolve agentdescent.evoskill.spec.json" not in payload["next"]
assert "A two-skill library" not in out


Expand Down Expand Up @@ -459,8 +461,9 @@ def test_demo_algorithm_next_steps_keep_the_algorithm(tmp_path, monkeypatch, nam
out = buf.getvalue()
assert code == 0, out
assert f"agentdescent algorithms run {name} " in out, out
assert f"agentdescent evolve agentdescent.{name}.spec.json" in out
assert "agentdescent doctor" in out
# #1145: that spec is not on disk yet; algorithms run prints evolve later.
assert f"agentdescent evolve agentdescent.{name}.spec.json" not in out
assert "--out spec.json" not in out

buf = io.StringIO()
Expand All @@ -470,6 +473,6 @@ def test_demo_algorithm_next_steps_keep_the_algorithm(tmp_path, monkeypatch, nam
payload = json.loads(buf.getvalue())
assert code == 0
assert any(s.startswith(f"agentdescent algorithms run {name} ") for s in payload["next"])
assert f"agentdescent evolve agentdescent.{name}.spec.json" in payload["next"]
assert f"agentdescent evolve agentdescent.{name}.spec.json" not in payload["next"]
target = "<your-skill-dir>" if payload["kind"] != "text" else "<your-prompt.txt>"
assert any(target in s for s in payload["next"])
3 changes: 3 additions & 0 deletions tests/test_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def test_demo_is_on_path_a_and_runs_offline_without_provider_keys(store, monkeyp
assert out["run_id"]
assert "COLUMN: amount" in out["learned"]
assert any("show" in step for step in out["next"])
assert any(s.startswith("agentdescent algorithms run gepa ") for s in out["next"])
assert "agentdescent evolve agentdescent.gepa.spec.json" not in out["next"]


def test_demo_refuses_unknown_cards_like_cli(store, capsys):
Expand Down Expand Up @@ -178,6 +180,7 @@ def test_demo_evoskill_runs_offline_like_cli(store):
assert out["outcomes"].get("evoskill-select", 0) >= 1
assert "SKILL.md" in out["learned"] and "COLUMN: amount" in out["learned"]
assert any(s.startswith("agentdescent algorithms run evoskill ") for s in out["next"])
assert "agentdescent evolve agentdescent.evoskill.spec.json" not in out["next"]


def test_demo_tool_description_lists_evoskill_as_offline():
Expand Down
Loading