Dollar limit leaves codeaf do pending until the deadline
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- cli, documentation, testing-qa
Hướng nghiên cứu
Start with settlementWatch.wait and settlementWatch.saySomethingIfQuiet in cmd/codeaf/do.go, then trace TaskReasonOf in internal/session/task_status.go to understand how pending work and budget stops are resolved. Run the described e2e and unit scenarios with stub cost accounting, and inspect internal/manual/chat/running-from-the-terminal.md and models-and-cost.md. Done means exhausted dollar limits produce prompt budget stops while higher limits start the task, with matching documentation and change-entry metadata.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
PRE-EXISTING defect seen on commit 17ae56d34 (staging-20260921-17ae56d3496f) on 2026-09-21 and also on v0.3.0 (9258f7052). Lane A2, item A2-05, set both daily_budget_usd and CODEAF_MAX_COST to 0.001. codeaf do then sat at:
1 task pending, none running
Staging exited 3 after 300 seconds with JSON fields "spend": 0.003388978, "spend_work": 0, "stop": "deadline", and "answer": "The time limit was reached before anything finished...". v0.3.0 behaved the same after 240 seconds. Neither named the dollar limit.
Replication
Deterministic (no model).
No no-model reproduction is established; lane A2 reproduced the blocked launch with live accounting.
Field (real models).
Set OPENROUTER_API_KEY, then prepare a fresh home and repository:
root="$(mktemp -d)"; export CODEAF_HOME="$root/home"; repo="$root/repo"
mkdir -p "$CODEAF_HOME" "$repo" && printf '{"daily_budget_usd":0.001}\n' > "$CODEAF_HOME/config.json"
git -C "$repo" init -q
git -C "$repo" -c user.name=Test -c [email protected] commit --allow-empty -m base
CODEAF_MAX_COST=0.001 codeaf do "write numbers 1 to 3000 into numbers.txt one per line, using a bash loop that sleeps 1 second after each number" --dir "$repo" --yes-spend --json --model deepseek/deepseek-v4-flash --timeout 5m
Today stderr says 1 task pending, none running; after five minutes JSON says "stop":"deadline" and the process exits 3.
Budget five minutes and about $0.01. Repeat with a comfortably higher daily and run limit as the control; the task should start instead of remaining pending. v0.3.0 has the same low-limit defect.
Where
The terminal receipt and quiet-wait paths are settlementWatch.wait and settlementWatch.saySomethingIfQuiet in cmd/codeaf/do.go; the task stop reason is exposed by TaskReasonOf in internal/session/task_status.go. The evidence does not establish why the pending state wins over the budget stop.
The fix
If the daily or run dollar limit prevents all pending work from starting, settle immediately as a dollar-limit stop. JSON must use "stop":"budget" and the answer must say a dollar limit you set stopped it; do not wait for --timeout and call it a deadline.
Acceptance
- e2e: Through
codeaf do --jsonwith a stub cost ledger already beyondCODEAF_MAX_COST=0.001, assert prompt exit 3,"stop":"budget", answer texta dollar limit you set stopped it, and nodeadlinevalue. - e2e: Through the same door with a higher limit, assert the stub task leaves
pending, entersrunning, and the result is not stopped for budget. - Unit: A settlement with pending work, no running work, and an exhausted daily or run dollar allowance maps to budget immediately and cannot later map to deadline.
- The manual pages
internal/manual/chat/running-from-the-terminal.mdandinternal/manual/chat/models-and-cost.mdquote the budget-stop wording and JSON field, and the change entry'sinvalidatesnames the old belief that an unstartable dollar-limited task should wait for the time wall.
Filed from the 2026-09-21 staging verification of 17ae56d34; the lane reports, frames and e2e logs are in the owner's handoff folder for this promotion.
- Ngôn ngữ chính
- Go
- Star
- 115
- Fork
- 14
- Merge trung bình
- 9 giờ 38 phút
- Pull request đã merge (30 ngày)
- 749
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Agent-Field/CodeAF
-
area:chat feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1510 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1489 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat bug good first issue sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Agent-Field/CodeAF#1470 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat bug good first issue sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Agent-Field/CodeAF#1469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1468 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Agent-Field/CodeAF
Issue tương tự
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
cvss-severity:high devguard l3montree-cybersecurity/...ard-k8s-image-inventory pkg:oci/devguard-k8s-ima...ch=amd64&tag=main-amd64 pkg:oci/devguard-k8s-ima...ch=arm64&tag=main-arm64 risk:low state:open
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
l3montree-dev/devguard#3094 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
JuliusBrussee/caveman#1127 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement low priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
eugenioenko/ttt#674 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
gpustack/gpustack-operator#640 ·
Maintainer thường phản hồi trong vòng 1 ngày