Skip to content

Stop sending temperature to OpenRouter (fixes Claude Opus 5 404) - #134

Merged
Programcode merged 2 commits into
mainfrom
t3/fix-openrouter-no-endpoints-error
Oct 9, 2026
Merged

Programcode merged 2 commits into
mainfrom
t3/fix-openrouter-no-endpoints-error

Conversation

@Programcode

@Programcode Programcode commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

Every Claude Opus 5 request failed with:

OpenRouter error: No endpoints found that can handle the requested parameters … "failed_routing_step":"Filter by Parameters"

The catalog marked Opus 5 as supportsTemperature: true, so we sent temperature. None of Opus 5's 11 OpenRouter endpoints accept it, and provider.require_parameters: true drops any endpoint that doesn't support every parameter in the request. Nothing was left to route to. Auto Pro could pick Opus 5 too, so it was hit the same way. The JSON repair retry always sent temperature: 0, so that path had the same problem for any model flagged as supporting it.

Change

temperature is removed from every model request:

  • Server: the supportsTemperature catalog field is gone, the ai and ai-stream payloads no longer include it, and the feature handlers, research sub-calls and JSON repair retry stop passing it. A temperature sent by an older cached client is ignored.
  • Client: ProviderConfig no longer has temperature. The settings store drops it from defaults and normalization. Saved feature_configs that still contain it fail the existing canonical check once and get rewritten without it.
  • Guard: the routing test in handler-research.test.ts now fails if any catalog model's request body contains temperature. It failed on the old code (first hit: Gemini 3.8 Flash) and passes now.

Deploy order doesn't matter. Either side works with the old version of the other.

Verification

  • npm run lint, npm run typecheck, npm test (273 passed), npm run build: all pass locally.
  • npm run test:edge: 333 passed, including the guard.
  • Real OpenRouter: called anthropic/claude-opus-5 and google/gemini-3.8-flash through the new callOpenRouter with the production key shape. Both returned valid JSON, and the request keys were max_tokens, messages, model, provider, reasoning, response_format. Before the change, the same Opus 5 request reproduced the 404 exactly.
  • Not run: a verify-debatelab browser pass. Another worktree's thread holds the shared local Supabase stack. The client change only removes a field from request bodies.

After merge

The ai and ai-stream Edge Functions need deploying (staging, then production). The Vercel merge deploy only ships the client.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • AI Behavior
    • AI features no longer use a configurable temperature setting. Responses are now generated based on the selected provider and model, with reasoning effort retained where supported.
    • Temperature is no longer included in AI requests, including Ask, research, and streaming requests.

Claude Opus 5 requests failed with "No endpoints found that can handle the
requested parameters". The catalog marked Opus 5 as accepting temperature,
but none of its 11 OpenRouter endpoints do, and require_parameters: true
drops every endpoint that lacks a sent parameter.

Temperature is now gone from every request: the catalog flag, the ai and
ai-stream payloads, the research sub-calls, the JSON repair retry, and the
client's saved feature settings. Saved settings that still carry a
temperature get rewritten once through the existing canonical check.
Older clients that still send temperature are ignored by the server.

The routing test now fails if any catalog model's request carries
temperature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 16:59
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 9, 2026 5:15pm UTC
debatelab-staging Ready Ready Preview Oct 9, 2026 5:15pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Free
  • Run ID: 08f680d6-d9e3-4646-a24b-e53dc89fe7c9

📥 Commits

Reviewing files that changed from the base of the PR and between 558b410 and 2f3f2c8.


📒 Files selected for processing (2)
  • src/lib/stores/settings-store.ts
  • src/test/settings/settings-migration.test.ts


ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Free
  • Run ID: a4a7d0b8-8233-4117-bc1e-f1732f50c03a

📥 Commits

Reviewing files that changed from the base of the PR and between 56a94d7 and 558b410.


📒 Files selected for processing (24)
  • e2e/animation-polish.spec.ts
  • e2e/authed-pages.spec.ts
  • packages/core/src/ai/providers/types.ts
  • src/lib/ai/client.ts
  • src/lib/ai/streaming.ts
  • src/lib/stores/settings-store.ts
  • src/test/ai/streaming.test.ts
  • src/test/debate/debate-context.test.tsx
  • src/test/pages/CrossfireVoice.test.tsx
  • src/test/pages/SparringVoice.test.tsx
  • supabase/functions/_shared/model-catalog.ts
  • supabase/functions/_shared/research.ts
  • supabase/functions/ai-stream/index.ts
  • supabase/functions/ai/features/ask.ts
  • supabase/functions/ai/features/attack.ts
  • supabase/functions/ai/features/brainstorm.ts
  • supabase/functions/ai/features/crossfire.ts
  • supabase/functions/ai/features/factoids.ts
  • supabase/functions/ai/features/generate.ts
  • supabase/functions/ai/features/sparring.ts
  • supabase/functions/ai/features/types.ts
  • supabase/functions/ai/handler-research.test.ts
  • supabase/functions/ai/index.ts
  • supabase/functions/ai/provider.ts

💤 Files with no reviewable changes (5)
  • supabase/functions/ai-stream/index.ts
  • src/lib/ai/streaming.ts
  • supabase/functions/_shared/research.ts
  • packages/core/src/ai/providers/types.ts
  • supabase/functions/ai/features/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The change removes temperature from feature settings, client request construction, server AI call contracts, and provider payloads. Model catalog temperature-support metadata is removed. Reasoning-effort handling and other listed model attributes remain.

Changes

Temperature removal

Layer / File(s) Summary
Client configuration and requests
packages/core/src/ai/providers/types.ts, src/lib/stores/settings-store.ts, src/lib/ai/*, e2e/*.spec.ts, src/test/ai/streaming.test.ts, src/test/debate/debate-context.test.tsx, src/test/pages/*Voice.test.tsx
Client settings and request construction omit temperature. Updated fixtures and tests no longer specify it.
Server AI request paths
supabase/functions/_shared/*, supabase/functions/ai/*, supabase/functions/ai/features/*, supabase/functions/ai-stream/index.ts
Server feature and research calls, streaming requests, and provider payloads omit temperature. The model catalog and its test expectations no longer use temperature-support metadata.

Estimated code review effort: 2 (Simple) | ~12 minutes


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.


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

@Programcode

Copy link
Copy Markdown
Owner Author

CI did not run. Every Actions job stopped within 1 to 3 seconds with "The job was not started because recent account payments have failed or your spending limit needs to be increased" (for example, the quality job). That's the Actions billing limit, not this change.

The same ladder npm run verify runs passed locally at head 558b410. This is a local pass, not a CI pass.

  • docs:check, lint, typecheck: pass
  • npm test: 273 passed
  • test:collaboration: pass
  • test:edge: 333 passed, including the new guard that no routed body carries temperature
  • build: pass
  • test:sw: pass
  • test:e2e:smoke (desktop Chromium): 27 passed, 3 flaky. All three first attempts timed out waiting for the page itself to render (crossfire-resolution, the Motion textbox, the announcement heading) on a cold Vite compile, before any AI request. All three passed on retry, including the Crossfire AI flow.

Not run: the database gate. The PR has no migrations or SQL, and another worktree holds the shared local Supabase stack.

Dropping temperature makes every saved feature_configs non-canonical, so
every existing user now takes the one-time rewrite path. That write sent
the whole snapshot read at hydration, so a model choice saved in the
meantime could be reverted on the server. The rewrite now applies only
while updated_at still matches the read, and only if the user has not
changed settings locally since hydration. A skipped cleanup retries on
the next hydration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Programcode

Copy link
Copy Markdown
Owner Author

Codex review r1 (head 558b410), one medium finding: fixed in 2f3f2c8.

Removing temperature from the canonical keys sends every existing user through the one-time feature_configs rewrite. That write sent the whole snapshot read at hydration, so a model choice saved in the meantime could be reverted on the server.

Confirmed. Before this PR, only users with legacy model IDs took that path. Now the rewrite applies only while user_settings.updated_at still matches what hydration read, and only if the user hasn't changed settings locally since hydration. A save that lands first moves updated_at and wins, and the cleanup retries on the next hydration.

Test: src/test/settings/settings-migration.test.ts, "does not overwrite a settings save that lands before the cleanup". It fails on 558b410 (Expected google/gemini-3.8-flash, Received openai/gpt-5.6-luna) and passes on 2f3f2c8. Ran lint, typecheck and npm test (275 passed), all locally.

@Programcode
Programcode merged commit 781d603 into main Oct 9, 2026
8 of 18 checks passed
@Programcode
Programcode deleted the t3/fix-openrouter-no-endpoints-error branch October 9, 2026 17:24

This branch was successfully deployed

2 active deployments
Preview – debate-navigator — 2f3f2c84 Deployed Oct 9, 2026 by vercel[bot]
Preview – debatelab-staging — 2f3f2c84 Deployed Oct 9, 2026 by vercel[bot]
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.

2 participants