fix: stop agent --wait polling when the job is cancelled
firecrawl agent "<prompt>" --wait keeps polling after the server reports the job as cancelled, so it never returns without --timeout, and with one it exits 1 with "Agent still processing". Checking an existing job id with --wait already stops on cancelled; this makes the start-and-wait path do the same: exit 0 with the cancelled status and data.
Only the polling loop changes (8 lines). Completed, failed, processing and timeout behavior is unchanged.
Added agent-cancellation.test.ts (6 cases against a local HTTP fixture). The two cancellation cases fail on current main. pnpm test, build, type-check and format:check pass locally.
AI help was used for this change.
Summary by cubic
Stops firecrawl agent "<prompt>" --wait from polling forever when the job is cancelled. Previously it only stopped on completed/failed, so a cancelled job kept polling until timeout or exited with "Agent still processing". Now the start-and-wait path matches the existing-job path: it exits 0 with the cancelled status and data. Only the polling loop changes; completed, failed, processing, and timeout behavior are unchanged.
Added agent-cancellation.test.ts (6 cases against a local HTTP fixture). The two cancellation cases fail on current main. pnpm test, build, type-check and format:check pass locally.