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
Contributor

@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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Bundle Report

Changes will increase total bundle size by 287.48kB (1.16%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 25.13MB 287.48kB (1.16%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/react-*.js -24.13kB 725.17kB -3.22%
assets/cells-*.js 1.19kB 704.6kB 0.17%
assets/index-*.js 3.61kB 606.0kB 0.6%
assets/chunk-*.js 26.24kB 370.78kB 7.62% ⚠️
assets/index-*.css 3.74kB 366.02kB 1.03%
assets/JsonOutput-*.js 23.83kB 360.58kB 7.08% ⚠️
assets/dist-*.js 379 bytes 339.6kB 0.11%
assets/edit-*.js -5.84kB 323.77kB -1.77%
assets/ai-*.js 4.14kB 254.34kB 1.66%
assets/glide-*.js -44 bytes 251.07kB -0.02%
assets/layout-*.js 10.68kB 196.59kB 5.74% ⚠️
assets/cell-*.js 241 bytes 183.15kB 0.13%
assets/reveal-*.js (New) 177.04kB 177.04kB 100.0% 🚀
assets/swiper-*.js (New) 116.4kB 116.4kB 100.0% 🚀
assets/file-*.js -221 bytes 46.81kB -0.47%
assets/file-*.js (New) 102.64kB 102.64kB 100.0% 🚀
assets/worker-*.js 25 bytes 85.01kB 0.03%
assets/loro_wasm_bg-*.js -664 bytes 70.83kB -0.93%
assets/es-*.js -595 bytes 60.61kB -0.97%
assets/reveal-*.css (New) 54.54kB 54.54kB 100.0% 🚀
assets/panels-*.js 8 bytes 45.36kB 0.02%
assets/dagre-*.js -42 bytes 11.16kB -0.38%
assets/dagre-*.js 1.43kB 29.73kB 5.04% ⚠️
assets/useNotebookActions-*.js 22 bytes 27.7kB 0.08%
assets/utils-*.js 25 bytes 5.98kB 0.42%
assets/session-*.js 38 bytes 25.04kB 0.15%
assets/vega-*.browser-BegSZk0G.js (New) 24.8kB 24.8kB 100.0% 🚀
assets/state-*.js 471 bytes 24.52kB 1.96%
assets/home-*.js 2.25kB 23.99kB 10.37% ⚠️
assets/purify.es-*.js 16 bytes 21.05kB 0.08%
assets/command-*.js 5 bytes 18.33kB 0.03%
assets/form-*.js -10.19kB 16.12kB -38.73%
assets/swiper-*.css (New) 15.12kB 15.12kB 100.0% 🚀
assets/run-*.js -735 bytes 9.74kB -7.02%
assets/graphlib-*.js 3.62kB 9.59kB 60.78% ⚠️
assets/react-*.esm-D9xfKaPZ.js (New) 8.37kB 8.37kB 100.0% 🚀
assets/_baseUniq-*.js -3.56kB 7.08kB -33.46%
assets/_baseFor-*.js (New) 6.9kB 6.9kB 100.0% 🚀
assets/RunButton-*.js (New) 6.81kB 6.81kB 100.0% 🚀
assets/column-*.js -659 bytes 6.53kB -9.16%
assets/RenderHTML-*.js 505 bytes 5.51kB 10.09% ⚠️
assets/radio-*.js (New) 5.47kB 5.47kB 100.0% 🚀
assets/readonly-*.js 1 bytes 4.68kB 0.02%
assets/emotion-*.esm-DD4AwVTU.js (New) 4.37kB 4.37kB 100.0% 🚀
assets/merge-*.js 3.03kB 4.34kB 229.92% ⚠️
assets/components-*.js -1.56kB 2.58kB -37.71%
assets/mermaid-*.core-BQULBKwL.js (New) 2.38kB 2.38kB 100.0% 🚀
assets/tree-*.js -91.84kB 1.8kB -98.07%
assets/get-*.js -9 bytes 1.5kB -0.6%
assets/isEmpty-*.js -9 bytes 1.21kB -0.74%
assets/debounce-*.js -31 bytes 1.03kB -2.92%
assets/pathUtils-*.js (New) 898 bytes 898 bytes 100.0% 🚀
assets/paths-*.js 57 bytes 843 bytes 7.25% ⚠️
assets/hasIn-*.js -9 bytes 814 bytes -1.09%
assets/constants-*.js 32 bytes 637 bytes 5.29% ⚠️
assets/now-*.js 545 bytes 636 bytes 598.9% ⚠️
assets/min-*.js -1.17kB 618 bytes -65.4%
assets/pick-*.js 179 bytes 509 bytes 54.24% ⚠️
assets/_baseSet-*.js 24 bytes 478 bytes 5.29% ⚠️
assets/memoize-*.js -9 bytes 377 bytes -2.33%
assets/slides-*.css -15.1kB 305 bytes -98.02%
assets/house-*.js (New) 281 bytes 281 bytes 100.0% 🚀
assets/square-*.js -127 bytes 147 bytes -46.35%
assets/square-*.js -101 bytes 274 bytes -26.93%
assets/range-*.js (Deleted) -413 bytes 0 bytes -100.0% 🗑️
assets/flatten-*.js (New) 112 bytes 112 bytes 100.0% 🚀
assets/clone-*.js -1 bytes 102 bytes -0.97%
assets/slides-*.js -116.37kB 0 bytes -100.0%
assets/vega-*.browser-DXARUlxo.js (Deleted) -24.8kB 0 bytes -100.0% 🗑️
assets/isArrayLikeObject-*.js (Deleted) -9.99kB 0 bytes -100.0% 🗑️
assets/react-*.esm-BUYTQ32a.js (Deleted) -8.37kB 0 bytes -100.0% 🗑️
assets/emotion-*.esm-DYxi7n2b.js (Deleted) -4.37kB 0 bytes -100.0% 🗑️
assets/mermaid-*.core-CvPV98yl.js (Deleted) -2.38kB 0 bytes -100.0% 🗑️
assets/toNumber-*.js (Deleted) -588 bytes 0 bytes -100.0% 🗑️
assets/useAddCell-*.js (Deleted) -549 bytes 0 bytes -100.0% 🗑️
assets/_basePickBy-*.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/toFinite-*.js (Deleted) -179 bytes 0 bytes -100.0% 🗑️

Files in assets/ai-*.js:

  • ./src/components/app-config/ai-config.tsx → Total Size: 76.65kB

  • ./src/components/ai/ai-provider-icon.tsx → Total Size: 1.89kB

  • ./src/core/ai/ids/ids.ts → Total Size: 1.27kB

  • ./src/components/ai/ai-utils.ts → Total Size: 2.07kB

Files in assets/utils-*.js:

  • ./src/core/config/config-schema.ts → Total Size: 6.86kB

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OpenCode Go configuration

2 participants