fix(datasets): validate, gate, and drain cached file fetches; single retry owner for banking - #79
Conversation
…retry owner for banking Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
Original prompt from Abhinav
|
Co-Authored-By: Abhinav Pola <abhinav.pola@openrouter.ai>
TL;DR
Hardens
fetchCachedTextFile(added in #75/#78) against four issues found by Devin Review on the downstream subtree sync (openrouter-web#41251): cache poisoning by malformed 200s, ignoredBENCH_DATASET_CACHE_DISABLE, unreleased error bodies, and multiplied retries in the banking dataset.What changed?
cached-file.tsvalidate?: (text) => string | undefinedonCachedTextFileRequest; a rejected body fails withCachedFileError(nostatus, so not retried) and is not written to the cache.jsonTextValidator("object" | "array")helper.store.enabledis now honored before bothreadJsonandwriteJson(mirrors the HF page cache).ignore(response.text)) before failing.tau-bench-airline/environment.ts:db.jsonfetch usesjsonTextValidator("object").tau3-bench-banking/environment.ts:ensureBankingData/ensureBankingTasksaccept an optionalRetryConfigand validatedb.json(object) /tasks.json(array).tau3-bench-banking/dataset.ts: drops the outerretry(hfFetchRetrySchedule(retryConfig))and threadsretryConfigintoensureBankingTasks, somaxRetriesbounds origin requests exactly once.Why?
The tau file cache keys on immutable URLs with no TTL, so a single malformed 200 (e.g. an HTML rate-limit page) would be served forever from disk/GCS. Banking retries were
(inner 3 default) × (outer maxRetries), somaxRetries=0still made 4 requests.How to test
New cases: validator rejects a 200 body without caching or retrying; disabled store sees zero reads/writes; failed response
bodyUsed === true; bankingmaxRetries: 0makes exactly one request.Benchmark impact
No score change. Failure mode changes: a malformed dataset download now fails the run instead of silently caching bad data.
Reviewer focus
ensureBankingData/ensureBankingTaskssignature gains an optional trailing param — backward compatible; the solver call sites still use defaults.Checklist
Link to Devin session: https://openrouter.devinenterprise.com/sessions/949ffdf48c7843febc66e0c2d8dc8486
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/949ffdf48c7843febc66e0c2d8dc8486?variant=devin
Requested by: @abhinav-pola