Skip to content

OpenCode Go config#9431

Open
fonnesbeck wants to merge 3 commits intomarimo-team:mainfrom
fonnesbeck:opencode_go
Open

OpenCode Go config#9431
fonnesbeck wants to merge 3 commits intomarimo-team:mainfrom
fonnesbeck:opencode_go

Conversation

@fonnesbeck
Copy link
Copy Markdown

@fonnesbeck fonnesbeck commented May 1, 2026

📝 Summary

Adds OpenCode Go to the set of built-in AI model providers. Follows the template used by other providers.

Closes #9208

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 1, 2026 2:31am

Request Review

@github-actions github-actions Bot added the bash-focus Area to focus on during release bug bash label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 13 files

Architecture diagram
sequenceDiagram
    participant User as User (Browser)
    participant UI as Frontend (Marimo UI)
    participant Server as Marimo Server
    participant Info as LLM Info Package
    participant Env as OS Environment
    participant Provider as OpenCode Go API

    Note over User, UI: Configuration Phase
    User->>UI: Inputs API Key & Base URL
    UI->>UI: NEW: Validate via UserConfigSchema
    UI->>Server: Save configuration (opencode_go)
    Server->>Server: Update marimo/_config/config.py

    Note over User, Provider: Runtime LLM Request
    User->>UI: Selects OpenCode Go model (e.g. GLM 5.1)
    UI->>Server: Request AI Completion
    
    Server->>Info: NEW: Fetch model metadata (models.yml)
    Info-->>Server: Return roles (chat/edit) & thinking capability
    
    Server->>Server: NEW: AnyProviderConfig.for_opencode_go()
    
    alt UI Config exists
        Server->>Server: Use configured API Key & Base URL
    else UI Config missing
        Server->>Env: NEW: Check OPENCODE_API_KEY
        Env-->>Server: Return fallback key
    end

    alt No key found
        Server-->>UI: 400 Bad Request (Error detail)
    else Key resolved
        Server->>Provider: NEW: POST request (OpenAI-compatible)
        Note right of Provider: Default: https://opencode.ai/zen/go/v1/
        Provider-->>Server: Stream completion
        Server-->>UI: Return response to user
    end
Loading
@fonnesbeck fonnesbeck requested a review from akshayka as a code owner May 1, 2026 02:30
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 1, 2026
@fonnesbeck
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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

Labels

bash-focus Area to focus on during release bug bash documentation Improvements or additions to documentation

1 participant