Conversation
The Agents settings can now write the app's MCP entry into ~/.config/opencode/opencode.json under its `mcp` root (type: "remote"), and the chat picker offers opencode's models through a host that drives `opencode serve` over HTTP and Server-Sent Events, one child server per session.
The probe reads GET /provider from a short-lived `opencode serve`, so each model carries its display name and its provider's name as a group. The picker collapses models into a submenu per group instead of one flat list, so a harness with a hundred models is a few rows.
The base submenu caps at the viewport height, which lets a provider's seventy-odd models fill the screen. A fixed cap keeps the menu and its scrollbar a readable size; other submenus are untouched.
|
@askmaddyy is attempting to deploy a commit to the Diffusion Studio Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opencode to the two places Diffusion Studio connects to an agent.
MCP settings -> Agents
A new
opencoderow writes the app'sdiffusionentry into~/.config/opencode/opencode.json, under opencode's ownmcproot:{ "mcp": { "diffusion": { "type": "remote", "url": "http://127.0.0.1:3274/mcp" } } }This needs a new
ConfigFormat("mcp"); the JSON merge / remove / read paths are shared with the existing JSON agents, so only the root key and the entry shape differ.enabledis omitted because opencode defaults it to true.Chat agent picker
OpenCodeHarnessspawnsopencode serveon a loopback port it picks, creates (or resumes) a session, streams the turn from the server's SSE/eventfeed, and maps text, reasoning, tool calls, andpermission.asked/question.askedonto the existingItemandQuestionBoxtypes. Interrupt, close and resume follow the codex adapter.One child server per live session, so its event stream carries only that project's work. The MCP entry and the chat instructions are injected as
OPENCODE_CONFIG_CONTENTand a per-promptsystem, so nothing is written to the user's own config.Picker
model.groupinto a submenu per provider, labelled with the provider's display name.probereadsGET /providerfrom a short-livedopencode serve(~400ms), so each model carries its real display name (Claude Sonnet 4.6, notclaude-sonnet-4-6) and its provider's name as the group (OpenCode Zen). Only connected providers are listed.max-h-96, so a provider's seventy-odd models scroll instead of filling the screen.HarnessInfo.modelsgained an optionalgroup; models without one list flat, so Claude Code and Codex are unchanged.Testing
npm run check- agent-chat, desktop, web all passnpm test- agent-chat 42 pass; desktop 58 pass (the 3projects.watch.test.tsfailures are a pre-existing flake, reproduced on a clean checkout)npm run lint- cleanopencode.jsonis read by opencode itself (opencode mcp listreportsdiffusion connected), and a live turn against opencode 1.18.31 streamsitem.started->item.delta->item.completedand resolvescompleted, with the diffusion MCP injected inlinePre-existing and unrelated:
packages/encoder(and its dependents) fail typecheck onshowSaveFilePickerinpackages/assets/src/browser.ts.