DashboardcliAuthenticated fetch, redirects, retries…

Authenticated fetch, redirects, retries, and response caching

Category: architecture
Confidence: 0.90
ID: 01a08c39-bc6b-7fdc-85be-70c439f070dc
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 2
Source session: (none)
Created: 2026-06-16 13:34:46
Updated: 2026-09-10 16:49:49

Cross-Project Recalls

ProjectHitsLast recalled
opencode 1 8d ago
opencode-lore 6 2026-08-08

Content

createAuthenticatedFetch adds auth, tracing, a 30-second default timeout, up to two retries, and 401 refresh. Preserve the initial fetch shape and clone or snapshot replay state without materializing FormData or consuming streams. Redirect method conversion must not overwrite the original headers/body used by outer retries; same-origin 307/308 redirects must replay request bodies, and FormData boundaries must survive. When a caller supplies a Request without init, retain input.headers. The RFC 7234 GET-2xx cache uses stable/volatile/immutable TTLs of 5 minutes/60 seconds/24 hours. Tests must isolate auth/config and reset or disable both fetch and cache state because cache lookup precedes mocked fetch.

Move to: