Skip to content

fix(openrouter): translate the provider on startSession input - #78

Merged
gfsaaser24 merged 1 commit into
turbofrom
fix/openrouter-start-session-provider
Aug 18, 2026
Merged

fix(openrouter): translate the provider on startSession input#78
gfsaaser24 merged 1 commit into
turbofrom
fix/openrouter-start-session-provider

Conversation

@gfsaaser24

Copy link
Copy Markdown
Owner

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, but ClaudeAdapter.startSession also validates its input provider and rejects anything that is not its own kind. Orchestration passes provider: '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

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>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55ed564b-659f-43ba-9a80-a35bfd83a732

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 12.6 KiB 15.1 KiB
Codex Thread snapshot wire 6.3 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.3 KiB 7.8 KiB
Codex Live turn WebSocket decoded 51.8 KiB 66.4 KiB
Codex Live turn messages 16 21
Claude Total thread wire 12.6 KiB 15.1 KiB
Claude Thread snapshot wire 6.3 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.3 KiB 7.8 KiB
Claude Live turn WebSocket decoded 52.7 KiB 66.4 KiB
Claude Live turn messages 16 21

Baseline: unavailable · PR result: 002dfe9 · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 99.9 KiB
  • Claude decoded thread snapshot: 100.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@gfsaaser24
gfsaaser24 merged commit 61a7646 into turbo Aug 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant