fix(openrouter): translate the provider on startSession input - #78
Conversation
Orchestration addresses the adapter as `openrouter`, but ClaudeAdapter rejects any startSession input whose provider is not its own kind, so every OpenRouter turn failed with ProviderAdapterValidationError. The identity decorator only restamped outputs; it now translates the input provider on the way in too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Every OpenRouter turn failed immediately with
ProviderAdapterValidationError: Expected provider 'claudeAgent' but received 'openrouter'.The OpenRouter adapter is the Claude adapter wrapped in an identity decorator. The decorator restamped outputs (sessions, events) to
openrouter, butClaudeAdapter.startSessionalso validates its input provider and rejects anything that is not its own kind. Orchestration passesprovider: 'openrouter', so the call never got past validation.The decorator now translates the input provider to the wrapped adapter's kind on the way in, and still restamps on the way out. Inputs with no provider are passed through untouched.
Adds a regression test that drives a validating fake adapter; it fails without the fix.
🤖 Generated with Claude Code