Skip to content

V2: Snowflake Cortex OAuth login not supported #34780

Closed

Description

@kitlangton

Summary

The v2 branch does not support the Snowflake Cortex OAuth login. V1 supports it (account-scoped PKCE OAuth with role selection and per-account endpoint); V2 has no Snowflake login method registered.

Part of the systemic V2 provider-login gap (see #34765).

Evidence

  • No snowflake-cortex plugin registers a login method in packages/core/src/plugin/provider/ — only openai and opencode register OAuth methods.
  • (The provider may exist in the catalog, but without the login + request auth it cannot authenticate.)

How V1 does it (reference)

packages/opencode/src/plugin/snowflake-cortex.ts:

  • Collects an account input (myorg-myaccount) and optional role; PKCE OAuth against https://<account>.snowflakecomputing.com/oauth/authorize + /oauth/token-request (HTTP Basic client auth).
  • Requires refresh_token in the token response; refreshes via the same account host and persists via client.auth.set (stores accountId in the credential).
  • loader custom fetch that, for OAuth credentials: refreshes when expired, requires accountId, and sets Authorization: Bearer <access> (+ User-Agent). The account host determines the endpoint.

What V2 needs

  1. Register the Snowflake OAuth login method (account + role inputs; PKCE; Basic client auth) in a V2 snowflake-cortex plugin.
  2. Persist the Snowflake account/accountId in credential metadata (needed for both refresh and endpoint).
  3. Request-time: derive the per-account base URL from credential metadata and inject Authorization: Bearer <access>; route refresh through V2's integration refresh.

Because the endpoint is account-specific, this is a good test case for the shared credential-aware request hook in #34765 setting endpoint.baseURL from credential.metadata on the native @opencode-ai/llm path.

Environment

  • Branch: v2
  • Status: verified against source; not runtime-reproduced (requires a Snowflake account).

Activity

  1. opencode-agent commented on Jul 2, 2026

    @opencode-agent
    Contributor

    Tracker update from V2 TODO LIST audit (2026-07-02):

    This is part of the broader V2 provider-login / credential-aware request-routing gap. Please coordinate with:

    The likely durable fix should live at the native provider package / provider-resolution seam so OAuth credential metadata and per-provider request headers/base URLs work across the native @opencode-ai/llm path, instead of re-porting one-off V1 fetch monkey-patches.

  2. opencode-agent commented on Jul 8, 2026

    @opencode-agent
    Contributor

    Audit update (2026-07-08): #34843 only fixed ChatGPT/OpenAI OAuth routing (#34765); it did not add Snowflake Cortex OAuth. This issue remains open and is not resolved by that cross-reference.

  3. 686f6c61 commented on Aug 7, 2026

    @686f6c61

    I'll take this: port Snowflake Cortex OAuth login from V1 into the V2 provider plugin path (account-scoped PKCE, credential metadata, request auth/refresh).

  4. 686f6c61 commented on Aug 7, 2026

    @686f6c61

    Opened #41111 with V2 Snowflake Cortex OAuth (PKCE login, credential metadata, per-account Cortex baseURL on the native model path).

  5. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    V2 supports Snowflake Cortex sign-in natively: the OAuth login stores a credential and refreshes it, and requests go to the per-account Cortex endpoint.

    Added in #47156.

    Closing as completed.

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

    2.0bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions