Repository navigation
codeaf do "" runs a paid job with an empty brief #1566
Copy link
Copy link
Closed
Labels
area:headlesscodeaf do and codeaf exec, runs with no screencodeaf do and codeaf exec, runs with no screenbugSomething the code does that it should notSomething the code does that it should notsev:criticalData loss, money spent wrongly, a false done, or the merge queue blockedData loss, money spent wrongly, a false done, or the merge queue blocked
Milestone
Description
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, binarybin/codeaf), or install the dev build withcurl -fsSL https://agentfield.ai/get/devaf | bash. - Use an isolated profile:
export HOME=$(mktemp -d), exportOPENROUTER_API_KEY, and keep the default model (~deepseek/deepseek-v4-flash-latest, crew on auto). - On a busy machine set
task.max_loadto0(/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.gofile and commit it. - Run
codeaf do "" --json; echo exit=$?. - Read the JSON:
stopisdone,spend_usdis non-zero, andgit statusshows edits nobody asked for.
Evidence
- JSON record:
"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. 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 ""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). - Unit:
readTextreturns thenoGoalGivenerror for an all-blank argument list.
Found while writing the public docs; manual text differences are in #1545.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
area:headlesscodeaf do and codeaf exec, runs with no screencodeaf do and codeaf exec, runs with no screenbugSomething the code does that it should notSomething the code does that it should notsev:criticalData loss, money spent wrongly, a false done, or the merge queue blockedData loss, money spent wrongly, a false done, or the merge queue blocked
Activity
headless: a blank brief is refused before any work starts
Consolidate reviewed CodeAF fixes — batch 2 (#1632)
AbirAbbas commentedon Sep 30, 2026
Fixed on dev — checked on
2f33722b2(2026-09-30):codeaf do "" --jsonin a fresh repo exits 1 before any model work, printserror: no goal given, and the JSON readsok:false,stop:"error",calls:0,spend:0. The empty-brief refusal came with #1604 (v0.5.0).