Skip to content

Windows onboarding: OpenRouter API key entry fails with provider error #495

Closed

Description

@1jehuang

Reported by tawa.kul in Discord #general (2026-07-16), first-run experience on Windows.

Entering an OpenRouter API key during onboarding leads to a provider error, blocking setup entirely for OpenRouter users.

Related onboarding input bugs from the same report are filed separately. The whole flow is reproducible via jcode --onboarding-sim.

Source: Discord report, https://discord.com/channels/1508955567048364062/1508955567048364065

Activity

  1. added
    bug
    on Jul 17, 2026
  2. 1jehuang commented on Jul 17, 2026

    @1jehuang
    OwnerAuthor

    Root cause found and fixed in 62f25e2.

    This wasn't OpenRouter rejecting the key at all. The key saves fine, but the first message after login fails with HTTP 400 whenever the default model routes to an Anthropic-family upstream (Anthropic/Vertex/Bedrock):

    tools.N.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level
    

    The swarm tool declares its action branches with a top-level anyOf, which those upstreams reject for the entire request, so the provider looks bricked immediately after onboarding. That's exactly the 'provider error' in the Discord report.

    Fix: the OpenRouter request sanitizer now flattens top-level oneOf/anyOf/allOf into a plain object schema (same strategy as the direct Anthropic provider). Verified A/B with a fresh JCODE_HOME and a real OpenRouter key: old binary 400s on the first turn, fixed binary completes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions