Skip to content

fix(provider): do not report OpenAI-compatible transport as native OpenRouter #795

Closed

Description

@Helweg

Problem

Jcode uses a shared transport slot for native OpenRouter and OpenAI-compatible endpoints. When native OpenAI credentials are present, runtime activation can leave an OpenRouter transport marker behind. Status and route-summary reporting then incorrectly describe OpenRouter as configured even though no OPENROUTER_API_KEY exists.

This is distinct from #691: that issue concerns named-profile identity, while this is a false native-OpenRouter availability report caused by shared transport state.

Expected behavior

  • Native OpenAI or direct OpenAI-compatible credentials must not make OpenRouter appear configured.
  • Native OpenRouter remains reported only when it is genuinely configured.
  • Direct compatible routes must continue to work and retain their placeholder behavior.

Fix

Proposed implementation:

  1. Make has_openrouter_credentials() confirm the configured endpoint has native OpenRouter features, not merely a shared transport marker.
  2. Classify native OpenRouter in route summaries using runtime provider-routing support, avoiding process-global transport-state contamination.
  3. Add regressions for native OpenAI credentials, direct-compatible transport overrides, genuine OpenRouter credentials, auth status, and route placeholder behavior.

Likely affected files:

  • crates/jcode-base/src/provider/openrouter.rs
  • crates/jcode-base/src/provider/catalog_routes.rs
  • crates/jcode-base/src/auth/tests.rs

Validation

Focused tests passed for:

  • native OpenAI credentials not reporting OpenRouter
  • direct-compatible transport overrides
  • native OpenRouter credentials still reporting correctly
  • fast auth status
  • route placeholder filtering

On the affected local configuration, auth-test --all-configured now reports OpenAI and OpenCode Go only, with no OpenRouter entry.

Activity

  1. added
    bug
    triage: reproducible
    autonomous: likely
    on Aug 6, 2026
  2. alecuba16 commented on Aug 7, 2026

    @alecuba16
    Contributor

    @1jehuang the fix/custom_openai_compatible branch adds per-provider display_name for custom OpenAI-compatible profiles so the runtime identity is correctly surfaced, which addresses the transport-reporting confusion described here. It has been rebased onto the latest master and validated. Would be great if you could take a look.

  3. 1jehuang commented on Aug 9, 2026

    @1jehuang
    Owner

    Implemented an independent fix in PR #863. Native OpenRouter credential reporting now requires native OpenRouter provider features, while direct compatible transport behavior remains available. Focused auth and route regressions pass.

    --- — Jcode agent (automated triage), on behalf of @1jehuang

  4. added a commit that references this issue on Aug 10, 2026
    6be9852
  5. added a commit that references this issue on Aug 15, 2026
    a8e0afd
  6. added 5 commits that reference this issue on Aug 30, 2026
    14d60c1
    3d4ab8d
    26e8dc5
    0f149ac
    6a5a1d9
  7. added a commit that references this issue on Sep 18, 2026
    e0796a5
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

    autonomous: likelybugtriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions