Skip to content

fix(runtime): unreachable policy host no longer skips the gateway refresh - #1

Merged
VickyXAI merged 1 commit into
mainfrom
fix/policy-failure-keeps-gateway
Sep 30, 2026
Merged

VickyXAI merged 1 commit into
mainfrom
fix/policy-failure-keeps-gateway

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

refresh() fetched the policy snapshot before the gateway inside one try. If the policy host was unreachable (a GitHub outage, or a network blocking raw.githubusercontent.com), the gateway was never contacted and clients fell back to the bundled model list. Found while reviewing BlockRunAI/Franklin#181.

  • Policy and gateway are now fetched concurrently (worst case is one 4 s timeout instead of two back to back).
  • A policy failure keeps the last good policy, applies the live gateway rows, sets lastError: "Catalog policy: …" and retries on the 15 s error backoff.
  • A gateway failure still commits nothing (the existing atomicity test is unchanged and passes).

npm run check: 21/21 pass. The two new tests fail on main and pass on this branch.

🤖 Generated with Claude Code

…refresh

The snapshot fetch ran before the gateway fetch inside one try, so any
failure reaching the policy host (GitHub outage, networks that block
raw.githubusercontent.com) dropped clients back to the bundled model list
and never contacted the gateway. Fetch both concurrently: a policy failure
keeps the last good policy, still applies live gateway rows, and retries on
the short error backoff. A gateway failure still commits nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant