You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle missing v2 job budgets in non-TTY job list output #39
AntFleet two-model review found a crash in the non-TTY formatter for job list.
Summary
The TTY output path handles active v2 jobs without a budget by printing N/A, but the non-TTY output path unconditionally calls BigInt(j.budget) for every non-legacy job. If a valid active v2 job has no budget, acp job list | cat or any scripted/non-TTY invocation throws instead of printing the job list.
Evidence
src/commands/job.ts: TTY branch handles missing budget as N/A
src/commands/job.ts: non-TTY branch formats budget with BigInt(j.budget) without checking presence
Impact
Scripted consumers and piped invocations can fail on valid job data that the interactive TTY path already treats as expected.
Reproduction shape
Mock or return an active non-legacy/v2 job with budget missing, null, or undefined.
Force non-TTY output, for example acp job list | cat.
The command attempts BigInt(j.budget) and throws before printing the list.
Suggested fix
Use the same missing-budget handling in the non-TTY branch as the TTY branch. Emit N/A or an empty field unless j.budget is present before calling BigInt.
Suggested regression test
Mock getActiveJobs() to return a non-legacy job without budget, force isTTY() false, run the job list action, and assert it prints a row rather than throwing.
Activity