Files
zeekay 538f754a57 org: serve the org last resolved when a refresh fails
Every coding run of org hanzo was refused at admission for hours:
"cap authorize: resolve org "hanzo": org: could not resolve organization
context deadline exceeded".  The cap check resolves the caller's org; a
cache entry lives 60 s, and a miss reads the store with its own 4 s
bound.  With the store's reader queued behind a flooded writer, every
refresh timed out, and an org that had resolved a minute earlier became
a refusal of money ops for an authenticated caller.

A refresh that fails now serves the org last resolved, for at most
maxStale (10 min) after that resolve, and asks the store again at most
every staleRetry (10 s), so a busy store has one asker instead of every
caller waiting out the bound.  An org never resolved, or resolved longer
ago than maxStale, still fails.

Claude-Session: https://claude.ai/code/session_015XYKLnBbrbajqj1GpRydF8
2026-11-09 05:12:48 -08:00
..