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.
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 callsBigInt(j.budget)for every non-legacy job. If a valid active v2 job has nobudget,acp job list | cator any scripted/non-TTY invocation throws instead of printing the job list.Evidence
src/commands/job.ts: TTY branch handles missing budget asN/Asrc/commands/job.ts: non-TTY branch formats budget withBigInt(j.budget)without checking presenceImpact
Scripted consumers and piped invocations can fail on valid job data that the interactive TTY path already treats as expected.
Reproduction shape
budgetmissing, null, or undefined.acp job list | cat.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/Aor an empty field unlessj.budgetis present before callingBigInt.Suggested regression test
Mock
getActiveJobs()to return a non-legacy job withoutbudget, forceisTTY()false, run thejob listaction, and assert it prints a row rather than throwing.