[PR #11455] Cortex patch #13794

Open
opened 2026-02-16 18:18:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11455

State: open
Merged: No


feat: # Snowflake Cortex Compatibility Patch

This repo applies a Snowflake Cortex compatibility patch to OpenCode

What the patch changes

  • Snowflake Cortex error handling: Treats Snowflake “conversation complete” errors as a normal stop condition.
  • Snowflake request compatibility: When snowflakeCortex: true is set, converts max_tokensmax_completion_tokens for Snowflake’s OpenAI-compatible API.
  • Provider options merge: Ensures the snowflakeCortex flag flows from provider options into the model options used at runtime.

Configure the Snowflake Cortex provider

Add to your config file:

  • User config: ~/.opencode/opencode.jsonc
  • Project config: ./opencode.json

Example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "snowflake-cortex": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Snowflake Cortex",
      "options": {
        "baseURL": "https://<account>.snowflakecomputing.com/api/v2/cortex/v1",
        "headers": {
          "X-Snowflake-Authorization-Token-Type": "PROGRAMMATIC_ACCESS_TOKEN"
        },
        "snowflakeCortex": true
      },
      "models": {
        "claude-4-sonnet": {
          "name": "Claude 4 Sonnet",
          "tool_call": true,
          "attachment": true,
          "limit": { "context": 200000, "output": 8192 }
        },
        "claude-opus-4-5": {
          "name": "Claude Opus 4.5",
          "tool_call": true,
          "attachment": true,
          "limit": { "context": 200000, "output": 8192 }
        }
      }
    }
  },
  "model": "snowflake-cortex/claude-opus-4-5"
}
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11455 **State:** open **Merged:** No --- feat: # Snowflake Cortex Compatibility Patch This repo applies a Snowflake Cortex compatibility patch to OpenCode ## What the patch changes - **Snowflake Cortex error handling**: Treats Snowflake “conversation complete” errors as a normal stop condition. - **Snowflake request compatibility**: When `snowflakeCortex: true` is set, converts `max_tokens` → `max_completion_tokens` for Snowflake’s OpenAI-compatible API. - **Provider options merge**: Ensures the `snowflakeCortex` flag flows from provider options into the model options used at runtime. ## Configure the Snowflake Cortex provider Add to your config file: - **User config**: `~/.opencode/opencode.jsonc` - **Project config**: `./opencode.json` Example: ```jsonc { "$schema": "https://opencode.ai/config.json", "provider": { "snowflake-cortex": { "npm": "@ai-sdk/openai-compatible", "name": "Snowflake Cortex", "options": { "baseURL": "https://<account>.snowflakecomputing.com/api/v2/cortex/v1", "headers": { "X-Snowflake-Authorization-Token-Type": "PROGRAMMATIC_ACCESS_TOKEN" }, "snowflakeCortex": true }, "models": { "claude-4-sonnet": { "name": "Claude 4 Sonnet", "tool_call": true, "attachment": true, "limit": { "context": 200000, "output": 8192 } }, "claude-opus-4-5": { "name": "Claude Opus 4.5", "tool_call": true, "attachment": true, "limit": { "context": 200000, "output": 8192 } } } } }, "model": "snowflake-cortex/claude-opus-4-5" } ```
yindo added the pull-request label 2026-02-16 18:18:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13794