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
10 changes: 6 additions & 4 deletions agentdescent/integrations/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ real model and a key):
Then continue with The procedure for a real run on the user's files. If
`demo` refuses a card (unknown name, or a kind with no offline fixture),
surface that error — the same words the CLI prints — and offer
`algorithm_spec` (or `agentdescent algorithms run NAME <path> <cases.jsonl>`)
`algorithm_spec` with the user's `model` / `base_url` (or `agentdescent algorithms run NAME <path> <cases.jsonl> --model <model> [--base-url <url>]`)
after `doctor`. Do not invent a keyless path for those cards.

## The procedure
Expand Down Expand Up @@ -96,9 +96,11 @@ after `doctor`. Do not invent a keyless path for those cards.
same spec still override the algorithm's defaults. `plan` echoes what was
resolved and what it costs.
For a quick first look at a named method, `agentdescent algorithms run
NAME PATH [cases.jsonl] --rounds 1 --workers 1` (same flags on `init`)
writes a one-round, one-worker spec and plans it, so the call estimate is
small; quote that estimate, then scale the flags up once it works.
NAME PATH [cases.jsonl] --model <model> [--base-url <url>] --rounds 1
--workers 1` (same flags on `init`; add `--key-env` when several keys are
set — never guess a model) writes a one-round, one-worker spec and plans
it, so the call estimate is small; quote that estimate, then scale the
flags up once it works.
- No data? Offer to draft 12 to 20 cases into `eval/cases.jsonl`
(`{"prompt": ..., "gold": ...}` per line) and have the user check them.
Fewer than 12 leaves under 4 held-out cases at the default `held_out_frac`
Expand Down
35 changes: 19 additions & 16 deletions agentdescent/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,20 @@ def mcp_manifest(launcher: Optional[List[str]] = None) -> Dict[str, object]:
exists). Stop here unless they ask to run it.
- **`run <name> <path>`** [optional `cases.jsonl`] [optional `--param k=v`]:
call `algorithm_spec` with the name, the absolute path, the absolute cases
file and only the params they gave (validate with `describe_algorithm` /
`show` first); it writes and plans the spec and returns `spec`. Run `doctor`
first, then `plan` that `spec` with `--probe` / `probe=true`. If the probe
refuses, give me its `next` and do not `start`. Show the resolved algorithm
card (including fidelity / surface) and estimate, and wait for my yes
before `start` with that `spec` and `max_calls` (and `max_usd` beside
`usd_per_call` when a price is known), starting at the plan's
`agent_calls_upper_bound` (or smaller for a trial). Same
apply/cancel/resume rules as `/evolve`. Without MCP: `agentdescent algorithms
run <name> <path> [cases.jsonl] [--param k=v...] [--rounds N] [--workers N]`
(init + plan), then `plan <spec> --probe` and `evolve --max-calls N` after
yes. For a quick trial pass `--rounds 1 --workers 1`.
file, the `model` and `base_url` they gave (and `key_env` when several keys
are set — never guess them), and only the params they gave (validate with
`describe_algorithm` / `show` first); it writes and plans the spec and
returns `spec`. Run `doctor` first, then `plan` that `spec` with `--probe` /
`probe=true`. If the probe refuses, give me its `next` and do not `start`.
Show the resolved algorithm card (including fidelity / surface) and
estimate, and wait for my yes before `start` with that `spec` and
`max_calls` (and `max_usd` beside `usd_per_call` when a price is known),
starting at the plan's `agent_calls_upper_bound` (or smaller for a trial).
Same apply/cancel/resume rules as `/evolve`. Without MCP: `agentdescent
algorithms run <name> <path> [cases.jsonl] --model <model> [--base-url
<url>] [--param k=v...] [--rounds N] [--workers N]` (init + plan), then
`plan <spec> --probe` and `evolve --max-calls N` after yes. For a quick
trial pass `--rounds 1 --workers 1`.

If they only named a method with no path, `show` it and ask whether to `run`.
"""
Expand Down Expand Up @@ -1031,7 +1033,7 @@ def dsh_plugin_patch() -> str:
`__start`, `__status`, `__show`, `__apply`, `__list_algorithms`,
`__describe_algorithm` and the rest. Named methods match
`agentdescent algorithms list` / `show` / `run` (dsh has no slash surface; use
the skill, those tools, or `agentdescent algorithms run NAME PATH`).
the skill, those tools, or `agentdescent algorithms run NAME PATH --model <model> [--base-url <url>]`).

Check it composed:

Expand Down Expand Up @@ -1116,9 +1118,10 @@ def grok_bot_host_md() -> str:
box): `agentdescent doctor`, `plan --probe`, `evolve --max-calls N`,
`status`, `apply`. Named methods: `agentdescent algorithms list` /
`show <name>`, then
`agentdescent algorithms run NAME PATH [cases.jsonl]` (init + plan in one
step; add `--rounds 1 --workers 1` for a quick trial; then `plan --probe`
and `evolve --max-calls N` after yes) — or MCP `list_algorithms` /
`agentdescent algorithms run NAME PATH [cases.jsonl] --model <model>
[--base-url <url>]` (init + plan in one step; add `--rounds 1 --workers 1`
for a quick trial; then `plan --probe` and `evolve --max-calls N` after
yes) — or MCP `list_algorithms` /
`describe_algorithm` when the HTTP MCP below is wired. The skill
falls back to those verbs when MCP tools are absent.
3. **MCP (optional, not auto-wired).** Serve the tools over HTTP on loopback
Expand Down
7 changes: 7 additions & 0 deletions changelog.d/1275-algorithms-run-model-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fixed
First-run `algorithms run` recipes on the host skill, the `/algorithms`
slash command (and its MCP `algorithm_spec` run branch), Grok Bot
`HOST.md`, the generated `docs/algorithms.md` cheatsheet, and the
plugin-quickstart refusal line now name `--model` and `--base-url`, in
the same shape the `demo --algorithm` footer already prints, so a copied
first look can plan instead of exiting on placeholders (#1275).
2 changes: 1 addition & 1 deletion docs/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The default recipe for a `kind` is used when no algorithm is named, and
agentdescent algorithms [--kind K] [--json] # same as `algorithms list`
agentdescent algorithms list [--kind K] [--json]
agentdescent algorithms show NAME
agentdescent algorithms run NAME PATH [cases.jsonl] [--param k=v...] [--rounds N] [--workers N] [--probe]
agentdescent algorithms run NAME PATH [cases.jsonl] --model MODEL [--base-url URL] [--param k=v...] [--rounds N] [--workers N] [--probe]
agentdescent init PATH --algorithm NAME --param KEY=VALUE [--rounds N] [--workers N]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ after the command returns.
Pass `--algorithm archive_selection` to watch a named algorithm (from
`agentdescent algorithms list`) run the same offline example end to end. Only
algorithms that work against the offline agent are accepted; any other name is
refused with the `agentdescent algorithms run NAME <path> <cases.jsonl>` command
refused with the `agentdescent algorithms run NAME <path> <cases.jsonl> --model <model> [--base-url <url>]` command
that runs it for real with your model.

## 3. Put it in your agent
Expand Down
26 changes: 14 additions & 12 deletions integrations/claude-code/commands/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ Parse `$ARGUMENTS` (trim; empty means `list`):
exists). Stop here unless they ask to run it.
- **`run <name> <path>`** [optional `cases.jsonl`] [optional `--param k=v`]:
call `algorithm_spec` with the name, the absolute path, the absolute cases
file and only the params they gave (validate with `describe_algorithm` /
`show` first); it writes and plans the spec and returns `spec`. Run `doctor`
first, then `plan` that `spec` with `--probe` / `probe=true`. If the probe
refuses, give me its `next` and do not `start`. Show the resolved algorithm
card (including fidelity / surface) and estimate, and wait for my yes
before `start` with that `spec` and `max_calls` (and `max_usd` beside
`usd_per_call` when a price is known), starting at the plan's
`agent_calls_upper_bound` (or smaller for a trial). Same
apply/cancel/resume rules as `/evolve`. Without MCP: `agentdescent algorithms
run <name> <path> [cases.jsonl] [--param k=v...] [--rounds N] [--workers N]`
(init + plan), then `plan <spec> --probe` and `evolve --max-calls N` after
yes. For a quick trial pass `--rounds 1 --workers 1`.
file, the `model` and `base_url` they gave (and `key_env` when several keys
are set — never guess them), and only the params they gave (validate with
`describe_algorithm` / `show` first); it writes and plans the spec and
returns `spec`. Run `doctor` first, then `plan` that `spec` with `--probe` /
`probe=true`. If the probe refuses, give me its `next` and do not `start`.
Show the resolved algorithm card (including fidelity / surface) and
estimate, and wait for my yes before `start` with that `spec` and
`max_calls` (and `max_usd` beside `usd_per_call` when a price is known),
starting at the plan's `agent_calls_upper_bound` (or smaller for a trial).
Same apply/cancel/resume rules as `/evolve`. Without MCP: `agentdescent
algorithms run <name> <path> [cases.jsonl] --model <model> [--base-url
<url>] [--param k=v...] [--rounds N] [--workers N]` (init + plan), then
`plan <spec> --probe` and `evolve --max-calls N` after yes. For a quick
trial pass `--rounds 1 --workers 1`.

If they only named a method with no path, `show` it and ask whether to `run`.
10 changes: 6 additions & 4 deletions integrations/claude-code/skills/agentdescent/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ real model and a key):
Then continue with The procedure for a real run on the user's files. If
`demo` refuses a card (unknown name, or a kind with no offline fixture),
surface that error — the same words the CLI prints — and offer
`algorithm_spec` (or `agentdescent algorithms run NAME <path> <cases.jsonl>`)
`algorithm_spec` with the user's `model` / `base_url` (or `agentdescent algorithms run NAME <path> <cases.jsonl> --model <model> [--base-url <url>]`)
after `doctor`. Do not invent a keyless path for those cards.

## The procedure
Expand Down Expand Up @@ -96,9 +96,11 @@ after `doctor`. Do not invent a keyless path for those cards.
same spec still override the algorithm's defaults. `plan` echoes what was
resolved and what it costs.
For a quick first look at a named method, `agentdescent algorithms run
NAME PATH [cases.jsonl] --rounds 1 --workers 1` (same flags on `init`)
writes a one-round, one-worker spec and plans it, so the call estimate is
small; quote that estimate, then scale the flags up once it works.
NAME PATH [cases.jsonl] --model <model> [--base-url <url>] --rounds 1
--workers 1` (same flags on `init`; add `--key-env` when several keys are
set — never guess a model) writes a one-round, one-worker spec and plans
it, so the call estimate is small; quote that estimate, then scale the
flags up once it works.
- No data? Offer to draft 12 to 20 cases into `eval/cases.jsonl`
(`{"prompt": ..., "gold": ...}` per line) and have the user check them.
Fewer than 12 leaves under 4 held-out cases at the default `held_out_frac`
Expand Down
2 changes: 1 addition & 1 deletion integrations/dsh-agentdescent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and it cannot drift from the package -- and its `cordis.patch.yml` adds the
`__start`, `__status`, `__show`, `__apply`, `__list_algorithms`,
`__describe_algorithm` and the rest. Named methods match
`agentdescent algorithms list` / `show` / `run` (dsh has no slash surface; use
the skill, those tools, or `agentdescent algorithms run NAME PATH`).
the skill, those tools, or `agentdescent algorithms run NAME PATH --model <model> [--base-url <url>]`).

Check it composed:

Expand Down
2 changes: 1 addition & 1 deletion integrations/dsh-agentdescent/lib/index.js

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions tests/test_first_run_caps.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,47 @@ def test_grok_bot_host_md_names_the_probe_and_the_cap():
assert "plan --probe" in drive
assert "evolve --max-calls" in drive
assert "evolve the written" not in drive

def test_first_run_algorithms_run_recipes_name_model_and_base_url():
"""#1275: leftover first-run recipes must name the flags plan requires."""
from agentdescent.integrations import grok_bot_host_md

skill = skill_text()
offer = skill.split("`algorithm_spec`", 1)[1].split("after `doctor`", 1)[0]
assert "--model" in offer and "--base-url" in offer, offer
assert "model" in offer and "base_url" in offer, offer
look = skill.split("For a quick first look at a named method", 1)[1]
look = look.split("writes a one-round", 1)[0]
assert "--model" in look and "--base-url" in look, look

run_branch = ALGORITHMS_COMMAND.split("**`run", 1)[1]
assert "--model" in run_branch and "--base-url" in run_branch, run_branch
assert "`model`" in run_branch and "`base_url`" in run_branch, run_branch

drive = _section_after(grok_bot_host_md(), "Drive AgentDescent")
drive = drive.split("MCP (optional", 1)[0]
assert "algorithms run" in drive
assert "--model" in drive and "--base-url" in drive, drive

cheat = _read("docs", "algorithms.md").split("```bash", 1)[1].split("```", 1)[0]
run_line = [ln for ln in cheat.splitlines() if "algorithms run" in ln]
assert run_line and "--model" in run_line[0] and "--base-url" in run_line[0], cheat

pointer = _read("docs", "plugin-quickstart.md")
pointer = pointer.split("Pass `--algorithm", 1)[1].split("## 3.", 1)[0]
assert "algorithms run" in pointer
assert "--model" in pointer and "--base-url" in pointer, pointer


@pytest.mark.parametrize("name", ALGORITHMS)
def test_bare_algorithms_run_without_model_flags_still_refuses(tmp_path, monkeypatch, name):
"""#1275: docs teach the flags; a bare run must still refuse placeholders."""
monkeypatch.chdir(tmp_path)
prompt, cases = _prompt_and_cases(tmp_path)
out = tmp_path / f"{name}.spec.json"
code, text = _run([
"algorithms", "run", name, str(prompt), str(cases),
"--rounds", "1", "--workers", "1", "--out", str(out),
])
assert code != 0, text
assert "<your-model>" in text or "placeholder" in text.lower(), text
2 changes: 1 addition & 1 deletion tools/gen_algorithms_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def render() -> str:
"agentdescent algorithms [--kind K] [--json] # same as `algorithms list`",
"agentdescent algorithms list [--kind K] [--json]",
"agentdescent algorithms show NAME",
"agentdescent algorithms run NAME PATH [cases.jsonl] [--param k=v...] [--rounds N] [--workers N] [--probe]",
"agentdescent algorithms run NAME PATH [cases.jsonl] --model MODEL [--base-url URL] [--param k=v...] [--rounds N] [--workers N] [--probe]",
"agentdescent init PATH --algorithm NAME --param KEY=VALUE [--rounds N] [--workers N]",
"```",
"",
Expand Down
Loading