Skip to content

openAI support#12

Merged
broven merged 6 commits intomainfrom
dev
Feb 8, 2026
Merged

openAI support#12
broven merged 6 commits intomainfrom
dev

Conversation

@broven
Copy link
Owner

@broven broven commented Feb 8, 2026

No description provided.

broven and others added 6 commits February 8, 2026 17:56
* feat: add OpenAI format provider support

Add bidirectional format conversion for OpenAI Chat Completions API, enabling fallback providers like OpenRouter, Together AI, and any OpenAI-compatible endpoint.

Changes:
- Add format field to ProviderConfig (anthropic|openai)
- Implement request/response conversion with tool_use support
- Add streaming SSE conversion via TransformStream
- Update admin UI with format selector
- Add 37 comprehensive tests (259 total passing)
- Validate format field at API boundary

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* test: improve format-converter coverage to 99%+

Add tests for edge cases: non-string/non-array content, invalid JSON
in stream, interleaved text+tool_calls, flush with remaining buffer,
and usage in regular chunks.

* chore: add Codecov configuration with relaxed thresholds

Allow coverage to decrease by up to 5% and set patch target to 70%
to prevent CI failures on minor coverage fluctuations.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: test multiple Claude models in testConnection with mapping suggestions

Refactor testProvider to test 4 models (Sonnet, Opus 4, Opus 4.6, Haiku) in
parallel instead of a single hardcoded model. Shows per-model results in the
admin UI and suggests adding model mappings when models fail without one
configured. Also adds claude-opus-4-6-20250415 to CLAUDE_MODELS.

* feat: add provider disable/enable toggle in admin panel

Show Anthropic primary API as fixed first entry with toggle switch.
Replace reorder arrow buttons with enable/disable toggles on all
providers. Disabled providers are skipped during request routing.

* test: add tests for provider disable/enable skipping behavior

Verify disabled Anthropic primary and fallback providers are skipped
during request routing, and that 502 is returned when all are disabled.

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
…error messages, and logging format. Adjust provider configurations and enhance circuit breaker functionality. Remove DEBUG variable from wrangler configuration.
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
claude-code-fallback d0142d3 Feb 08 2026, 11:24 AM

@broven broven merged commit 56a403b into main Feb 8, 2026
2 checks passed
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 94.09836% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.76%. Comparing base (3aba47d) to head (d0142d3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/admin.ts 83.54% 13 Missing ⚠️
src/config.ts 81.81% 2 Missing ⚠️
src/utils/format-converter.ts 98.88% 1 Missing and 1 partial ⚠️
src/utils/provider.ts 94.73% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##              main      #12      +/-   ##
===========================================
- Coverage   100.00%   96.76%   -3.24%     
===========================================
  Files            6        7       +1     
  Lines          315      557     +242     
  Branches        82      168      +86     
===========================================
+ Hits           315      539     +224     
- Misses           0       17      +17     
- Partials         0        1       +1     
Files with missing lines Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/utils/circuit-breaker.ts 100.00% <100.00%> (ø)
src/utils/provider.ts 97.67% <94.73%> (-2.33%) ⬇️
src/config.ts 97.29% <81.81%> (-2.71%) ⬇️
src/utils/format-converter.ts 98.88% <98.88%> (ø)
src/admin.ts 90.90% <83.54%> (-9.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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