AntFleet

Disagreement · 44a066f2-anthropic-1

execute() can fall off the end without returning a number when handleError does not throw

solo Opus
repo 799b2361·PR #1·reviewed 5 days ago

Opus finding

execute() can fall off the end without returning a number when handleError does not throw

lowbugmedium
  • src/commands/register-agent.ts:130-134
execute() is declared `Promise<number>` but the catch block calls `this.handleError(err)` without `return`. If handleError on BaseCommand is implemented to throw (or process.exit), this is fine; if it ever returns normally (e.g., logs and returns a number/void), execute resolves to undefined, which Clipanion will treat as exit code 0 — masking failures. Since BaseCommand source was not provided, this is a latent contract risk. A defensive `return this.handleError(err);` or `return 1;` after it would eliminate the ambiguity.

Recommendation

Either change handleError's return type to `never` (and assert it throws) or add an explicit `return` of a non-zero exit code after the handleError call so the TypeScript signature is honored unconditionally.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →

From the same review

These findings passed the unanimous gate on the same PR review. The disagreement above was filtered out; the findings below were posted.