Skip to content

(janitor/dedupe): consolidate fetch-with-timeout helper in web worker clients - #5926

Merged
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dedupe/fetch-with-timeout
Sep 7, 2026
Merged

(janitor/dedupe): consolidate fetch-with-timeout helper in web worker clients#5926
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dedupe/fetch-with-timeout

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Three web worker clients in apps/web each carried an identical, timeout-only
fetchWithTimeout helper:

  • lib/auto-fix/client/auto-fix-worker-client.ts
  • lib/auto-triage/client/triage-worker-client.ts
  • lib/code-reviews/client/code-review-worker-client.ts

The three copies were byte-for-byte identical apart from their default timeout
(10s, 10s, 30s). Any future fix to the abort/timeout handling would have to be
applied in three places and would be easy to miss in one.

Change

Extract the shared helper into lib/fetch-with-timeout.ts and have each client
import it and pass its own timeout explicitly.

  • fetchWithTimeout(url, options, timeoutMs) now lives in one module.
  • Each client keeps its own timeout constant (unchanged values: 10s / 10s / 30s).
  • The user-deployments/fetch-utils.ts retry-aware fetchWithTimeout is left
    untouched: it layers retry/backoff on top and serves a different contract, so
    folding it in would have changed dispatch behavior (introducing retries).

Verification

  • tsgo --noEmit -p apps/web/tsconfig.json — clean
  • oxlint on the four changed files — 0 warnings, 0 errors
  • oxfmt on the four changed files

No behavior change: each caller still uses its original timeout.

… clients

Three web worker clients (auto-fix, auto-triage, code-review) each
carried an identical timeout-only `fetchWithTimeout` helper. Extract the
shared helper into lib/fetch-with-timeout.ts and have each client pass
its own timeout, so a timeout-handling fix is applied once instead of
three times. No behavior change.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 7, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 7, 2026 07:13
@kilo-code-bot

kilo-code-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • apps/web/src/lib/fetch-with-timeout.ts
  • apps/web/src/lib/auto-fix/client/auto-fix-worker-client.ts
  • apps/web/src/lib/auto-triage/client/triage-worker-client.ts
  • apps/web/src/lib/code-reviews/client/code-review-worker-client.ts

Reviewed by grok-4.6 · Input: 79.4K · Output: 6.2K · Cached: 120.7K

Review guidance: REVIEW.md from base branch main

@kilo-code-bot
kilo-code-bot Bot merged commit f52c106 into main Sep 7, 2026
17 checks passed
@kilo-code-bot
kilo-code-bot Bot deleted the janitor/dedupe/fetch-with-timeout branch September 7, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant