Files
hermes-agent/scripts
BearHuddleston 3562efb348 fix(releases): bound R2 time inside post-publication reconcilers
Post-publication reconcilers (`_reconcile_store`, `_reconcile_linux`)
run after durable channels have already moved, inside `reconcile`'s
30-minute timeout. Previously they inherited `r2.py`'s 600-second
per-request socket timeout and unbounded retries, so a stalled R2
request could outlast the workflow timeout and fail the run after
publication. `_reconcile_store` also caught only `(StoreError,
ValueError, OSError)` and did not handle `r2.R2RequestError` or
`http.client.HTTPException` when reading the archived candidate
manifest.

Add a `ContextVar`-backed `r2.time_budget(total_seconds, *,
per_request_timeout=None)` context manager wired through
`signed_request`, `read_public_receipt`, `_download_url`, and
`_stream_and_hash` (clamping open socket reads and retry sleeps to the
remaining deadline, strictly tightening nested budgets). Wrap
`_reconcile_store` and `_reconcile_linux` in a 300 s budget with 60 s
per-request caps, and widen `_reconcile_store`'s advisory catch tuple
to log a structured Microsoft Store warning on R2/HTTP errors.
2026-11-29 13:06:26 -06:00
..
…