This commit addresses issues #1514, #1520, and #1522. It ensures cache_control is only injected for supported Anthropic models and removes Gemini-specific validation tools from Vertex AI Claude adapter envelopes.
Reject invalid API keys even when authentication is optional and add
OPTIONS handlers for batch and file routes to support CORS preflights.
Also recover orphaned batches stuck in finalizing after restarts,
include finalizing in pending batch queries, preserve multipart upload
content handling, and fetch remote vision images as data URIs for
Anthropic requests.
* feat(vision-bridge): add automatic image description fallback for non-vision models
Implements VisionBridgeGuardrail (priority 5) that intercepts image-bearing
requests to non-vision models, extracts descriptions via a configurable
vision model (default: gpt-4o-mini), and replaces images with text before
forwarding. Fails open on any error.
- Add VisionBridgeGuardrail class extending BaseGuardrail
- Add visionBridgeHelpers: extractImageParts, callVisionModel, replaceImageParts, resolveImageAsDataUri
- Add visionBridgeDefaults with configurable settings
- Register VisionBridgeGuardrail in GuardrailRegistry at priority 5
- Add 51 unit tests covering all spec scenarios (VB-S01 through VB-S10)
- Dependency injection for getSettings and callVisionModel (testable without SQLite)
Closesdiegosouzapw/OmniRoute#1424
* fix(vision-bridge): resolve Anthropic API, parallel processing, provider keys, structuredClone
Register LM Studio as an OpenAI-compatible local provider and map the
new grok-4.3 thinking model for web executor requests.
This update also hardens related platform behavior by switching backup
archive creation to execFileSync, validating ACP agent ids, expanding
shared CORS handling, and making prompt injection guard failures return
an explicit 500 response.
To preserve existing stored credentials, encryption now derives new
keys from a secret-based salt while still falling back to the legacy
static-salt key during decryption.
1. Remove 429 from PROVIDER_FAILURE_ERROR_CODES
- 429 (rate limit) is already handled by model-level and account-level locks
- Including it in provider-wide circuit breaker causes premature cooldown
2. Fix reference counting in ModelStatusContext
- Changed registeredModels from Set to Map<string, number>
- Prevents polling stop when one component unmounts while others still track the model
3. Fix model ID parsing for providers with slashes in model names
- Use indexOf/substring instead of split to handle models like "modelscope/moonshotai/Kimi-K2.5"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mergeProviderProfile function was missing the three new fields
added to PROVIDER_PROFILES (providerFailureThreshold, providerFailureWindowMs,
providerCooldownMs). This caused tests to fail because the profile
returned by getRuntimeProviderProfile did not include these fields.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- add provider-level circuit breaker config to PROVIDER_PROFILES
- remove hardcoded threshold constants in favor of profile-based config
- use getProviderProfile() to read thresholds with fallback defaults
- support different failure tolerance per provider type
- create createSettingsApiHarness function with temp directory setup
- add beforeEach/afterEach hooks for storage reset between tests
- add after hook for cleanup
- use dynamic imports after env setup to ensure proper initialization