Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

codeaf do "" runs a paid job with an empty brief

Aperta Adatta ai principianti
#1,566 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli, testing-qa

Direzione di ricerca

Inizia in cmd/codeaf/main.go intorno a readText alle righe 1101-1112 e ai controlli noGoalGiven alle righe 1109, 1121 e 1126. Esegui le riproduzioni descritte codeaf do "" e codeaf do " ", quindi aggiungi o aggiorna la copertura unit ed e2e. È fatto quando entrambe le forme terminano con un valore diverso da zero usando la usage esistente su una sola riga, non viene scritta alcuna riga di usage e readText gestisce gli argomenti vuoti come un goal mancante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:headless bug sev:critical

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

  1. 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.
  2. 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).
  3. On a busy machine set task.max_load to 0 (/settings, Tasks) so the busy-machine gate does not hold tasks.
  4. 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.
  5. Run codeaf do "" --json; echo exit=$?.
  6. 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

Lingua principale
Go
Stelle
115
Fork
14
Merge medio
9h 44m
PR unite (30g)
766

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Agent-Field/CodeAF

Tutte le issue di Agent-Field/CodeAF

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.