quak backup retries for longer, with the budget set in the library #165

Closed
opened 2026-10-06 01:16:51 +02:00 by clawbot · 0 comments
Collaborator

Part of #162 (one cron-safe command that mirrors the whole account).

What

quak backup retries failed requests for longer than the interactive commands do, so a network or server outage of a few minutes no longer fails files until the next run. The policy stays in the library (src/retry.ts); only the numbers differ.

Definition of done

  • src/retry.ts exports a second set of retry options for unattended runs beside the unchanged default: 10 attempts, 1 s base delay, 60 s cap. That is at most about four minutes of waiting per request before it gives up. The library exports it, so a library user can pass it through ApiClientOptions.retry.
  • quak backup loads its saved session with those options, so every request it makes (refresh, ML data, downloads) uses them. Every other command keeps the default.
  • What is retried and the backoff formula do not change.
  • README "Retries and timeouts": the backup's budget beside the default table, and its worst-case wait.
  • Tests, without real waiting (injected sleep and random) and never the real service: the exported numbers; backup's client gets them; another command keeps the default.
  • TODO.md: an entry at the top of Completed Steps.

Notes

The CLI builds its context in bin/quak.ts, which passes loadSession from src/cli-session.ts (that takes ApiClientOptions). Wiring the backup's options there keeps src/cli-commands.ts untouched. If a test needs a seam in src/cli-commands.ts, change backupCommand only. Name the export plainly.

Touches src/retry.ts, src/index.ts, bin/quak.ts and/or src/cli-session.ts, tests, README.md, TODO.md. Units in flight beside it change src/backup.ts, src/library/index.ts, src/cli-run.ts and the session loading in src/cli-commands.ts; leave those alone.

Model: opus-5-5

Part of https://git.eeqj.de/sneak/quak/issues/162 (one cron-safe command that mirrors the whole account). ## What `quak backup` retries failed requests for longer than the interactive commands do, so a network or server outage of a few minutes no longer fails files until the next run. The policy stays in the library (`src/retry.ts`); only the numbers differ. ## Definition of done - `src/retry.ts` exports a second set of retry options for unattended runs beside the unchanged default: 10 attempts, 1 s base delay, 60 s cap. That is at most about four minutes of waiting per request before it gives up. The library exports it, so a library user can pass it through `ApiClientOptions.retry`. - `quak backup` loads its saved session with those options, so every request it makes (refresh, ML data, downloads) uses them. Every other command keeps the default. - What is retried and the backoff formula do not change. - README "Retries and timeouts": the backup's budget beside the default table, and its worst-case wait. - Tests, without real waiting (injected `sleep` and `random`) and never the real service: the exported numbers; `backup`'s client gets them; another command keeps the default. - `TODO.md`: an entry at the top of Completed Steps. ## Notes The CLI builds its context in `bin/quak.ts`, which passes `loadSession` from `src/cli-session.ts` (that takes `ApiClientOptions`). Wiring the backup's options there keeps `src/cli-commands.ts` untouched. If a test needs a seam in `src/cli-commands.ts`, change `backupCommand` only. Name the export plainly. Touches `src/retry.ts`, `src/index.ts`, `bin/quak.ts` and/or `src/cli-session.ts`, tests, `README.md`, `TODO.md`. Units in flight beside it change `src/backup.ts`, `src/library/index.ts`, `src/cli-run.ts` and the session loading in `src/cli-commands.ts`; leave those alone. Model: opus-5-5
clawbot self-assigned this 2026-10-06 01:16:51 +02:00
Sign in to join this conversation.