refactor: replaced abortableSleep with scheduler.wait and fetchWithRetry

- Removed local `abortableSleep` in favour of Node's built-in `scheduler.wait` from `node:timers/promises`.
- Consolidated per-provider retry/fetch loops into a shared `fetchWithRetry` utility in `packages/utils`.
- Moved `extractHttpStatusFromError`, `isRetryableError`, and related helpers out of `packages/ai` into `packages/utils`.
- Deleted `extractRetryDelay` in favour of `extractRetryHint` with unified header and body parsing.
This commit is contained in:
can1357
2026-05-13 16:40:58 +02:00
parent 7530114c01
commit 6eda70aada
21 changed files with 470 additions and 667 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ Watch flow:
- `gh` interactive editor fallback is suppressed for `pr_create` by forcing either `--body-file` or `--body ""`.
- `gh-renderer` provides compact headers for all ops and a custom live watch view for `run_watch`.
- Background work / cancellation
- `run_watch` loops until success/failure and uses `abortableSleep()` between polls.
- `run_watch` loops until success/failure and uses `scheduler.wait()` between polls.
- `GithubTool.execute()` is wrapped in `untilAborted()`; `git.github.run()` forwards the abort signal into `Bun.spawn()`.
## Limits & Caps