Seen on: dev 837b2b0.
Behaviour
codeaf do "" (one empty argument) starts a real, paid run. It exited 0 with stop:"done" and spent $0.057; the crew invented a goal from the repository (it fixed the failing tests). A missing brief should be refused the way a terminal with no piped text is refused, with nothing spent.
Replication
- Build dev 837b2b0 (
git checkout 837b2b0 && make build, binary bin/codeaf), or install the dev build with curl -fsSL https://agentfield.ai/get/devaf | bash.
- Use an isolated profile:
export HOME=$(mktemp -d), export OPENROUTER_API_KEY, and keep the default model (~deepseek/deepseek-v4-flash-latest, crew on auto).
- On a busy machine set
task.max_load to 0 (/settings, Tasks) so the busy-machine gate does not hold tasks.
- Make a small repo with a failing test:
R=$(mktemp -d) && cd "$R" && git init -q && printf 'package main\n\nfunc main() {}\n' > main.go && printf 'module demo\n\ngo 1.22\n' > go.mod && git add -A && git commit -qm init, then add any failing _test.go file and commit it.
- Run
codeaf do "" --json; echo exit=$?.
- Read the JSON:
stop is done, spend_usd is non-zero, and git status shows edits nobody asked for.
Evidence
- JSON record:
"stop":"done", "spend_usd":0.057, exit 0.
cmd/codeaf/main.go:1101-1112 (readText): with len(args) > 0 it returns strings.TrimSpace(strings.Join(args, " ")), so one empty argument becomes an empty goal with no error. The noGoalGiven check (main.go:1109, :1121, :1126) runs only on the no-argument and piped paths.
Guessed cause
A guess from reading the code, not a confirmed diagnosis. readText never checks the trimmed argument text for emptiness, so an empty brief reaches the crew and the planner fills the gap from the repository.
Acceptance
- e2e:
codeaf do "" and codeaf do " " exit non-zero with the same one-line usage as codeaf do with no argument, and no usage row is written (codeaf logs shows no call).
- Unit:
readText returns the noGoalGiven error for an all-blank argument list.
Found while writing the public docs; manual text differences are in #1545.
🤖 Generated with Claude Code
Seen on: dev 837b2b0.
Behaviour
codeaf do ""(one empty argument) starts a real, paid run. It exited 0 withstop:"done"and spent $0.057; the crew invented a goal from the repository (it fixed the failing tests). A missing brief should be refused the way a terminal with no piped text is refused, with nothing spent.Replication
git checkout 837b2b0 && make build, binarybin/codeaf), or install the dev build withcurl -fsSL https://agentfield.ai/get/devaf | bash.export HOME=$(mktemp -d), exportOPENROUTER_API_KEY, and keep the default model (~deepseek/deepseek-v4-flash-latest, crew on auto).task.max_loadto0(/settings, Tasks) so the busy-machine gate does not hold tasks.R=$(mktemp -d) && cd "$R" && git init -q && printf 'package main\n\nfunc main() {}\n' > main.go && printf 'module demo\n\ngo 1.22\n' > go.mod && git add -A && git commit -qm init, then add any failing_test.gofile and commit it.codeaf do "" --json; echo exit=$?.stopisdone,spend_usdis non-zero, andgit statusshows edits nobody asked for.Evidence
"stop":"done","spend_usd":0.057, exit 0.cmd/codeaf/main.go:1101-1112(readText): withlen(args) > 0it returnsstrings.TrimSpace(strings.Join(args, " ")), so one empty argument becomes an empty goal with no error. ThenoGoalGivencheck (main.go:1109,:1121,:1126) runs only on the no-argument and piped paths.Guessed cause
A guess from reading the code, not a confirmed diagnosis.
readTextnever checks the trimmed argument text for emptiness, so an empty brief reaches the crew and the planner fills the gap from the repository.Acceptance
codeaf do ""andcodeaf do " "exit non-zero with the same one-line usage ascodeaf dowith no argument, and no usage row is written (codeaf logsshows no call).readTextreturns thenoGoalGivenerror for an all-blank argument list.Found while writing the public docs; manual text differences are in #1545.
🤖 Generated with Claude Code