Skip to content

test(core): provider failover against the real OpenAI provider and turn loop (#209, 2/3) - #412

Merged
ajianaz merged 2 commits into
developfrom
test/provider-failover-integration
Oct 21, 2026
Merged

ajianaz merged 2 commits into
developfrom
test/provider-failover-integration

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What

Part 2 of 3 of #209: integration tests for the failover chain merged in #404, using the real OpenAiProvider and the real turn loop.

Why

The failover decision is made on provider error text. The unit tests in #404 use scripted messages; this proves the classification against the text the real HTTP client actually produces, and that a turn completes on the reserve with the route stored durably.

Changes

  • crates/tole-core/tests/failover.rs (test only):
    • real error text: connection refused, 503 and 429 fail over; 401 fails loud, and the key never appears in the error;
    • a full run_turn with an unreachable primary completes on the reserve; the usage row keeps the reserve's own usage and records tole_route (provider and failover origin), and survives a reopen of the JSONL;
    • an auth error on the primary ends the turn as ProviderFailed without touching the reserve.

Testing

  • 3 tests, run 3 times: all pass.
  • fmt, clippy -D warnings; cora review --staged clean.

Refs #209

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit e576c73 into develop Oct 21, 2026
17 checks passed
@ajianaz
ajianaz deleted the test/provider-failover-integration branch October 21, 2026 01:25
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