Opencode 2.0 #171
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Braid uses opencode, and there is a new major version out. I think we should upgrade, assuming it makes sense to do so.
What Opencode 2 means for Braid, from its migration guide, the release coverage and its source at tag
v2.0.30(read 2026-10-16). This issue follows #170: #170 ships on opencode 1.18.35 first, so its comparison with run 62 measures its own changes alone.What moving costs
prompt_async,/session/status,/event?directory=, the message lists, fork, abort, revert and question replies (src/osf/agent/client.py, which says outright that Braid drives and reads with v1 because 1.x's v2 API could not see sessions driven that way). v2 has about 139/api/...endpoints instead (V2_HTTP_API_AUDIT.md): a prompt goes into a durable inbox withsteerorqueuedelivery,taskissubagent, a permission reply takesdecision, questions are backed by forms, and events come from one/api/eventfeed plus a replayable per-session log.provider→providers, a model'sid→modelID, variants become an array,optionssplits intosettings,headersandbody, thepermissionmap becomes an orderedpermissionslist (bash→shell),agent→agents(prompt→system), skill paths become oneskillslist, MCP servers move undermcp.servers.lspis accepted and does nothing), theCLAUDE.mdfallback (onlyAGENTS.mdis read), 1.x plugins.needs_opencodetests.opencode serve --stdio --port 0withOPENCODE_PASSWORDandOPENCODE_DB(packages/cli/src/services/standalone.ts), so Braid need not use the shared background service.Where it meets #170
toolChoice: "none", "so the cached prompt prefix survives" (specs/v2/tools.md,packages/core/src/session/runner/llm.ts). That is the fix #170 made by hand.specs/v2/session.md,packages/ai/src/protocols/openai-chat.ts): one cause of full re-prefills fewer on trogdor.qwen3.8-27b@highwith anidoverride) becomes v2's own variants,provider/model#high, chosen per session, agent or command. On trogdor a session still keeps one effort, because the Qwen template writes it into the system message; v2 drops mid-session effort changes on OpenAI-compatible routes for the same cache reason (packages/ai/src/effort-updates.ts). On the Claude backend, Claude 5.1 and later take per-turn effort changes without losing the cache, so there Auto could change effort mid-session.experimental.session.wait, a race-free idle barrier, could replace Braid's quiet detection, which exists because v1 has none. It is experimental.after,follow) and could replace much of Braid's backfill. To settle: v2 resumes the sessions it was running when it starts again, which overlaps Braid's own restart recovery.Risk
v2 became the main line on 2026-10-12, and its tags went from
v2.0.5tov2.0.30since. 1.x still gets fixes (1.19.2 on 2026-10-16), and 1.19 is the bridge release.Plan
/tokenize, checking that the prompt prefix holds across a whole step with the last call; variants for effort; the equivalents of permissions, the outside-path rule and agent questions; the event feed and the idle barrier.Sources: migration guide, The New Stack, explainx upgrade guide.
opencode 2.0.30: what shipped
Braid now drives opencode 2.0.30 (
@opencode/cli) on its/api, through the opencode-2 change, archived as2026-10-16-opencode-2. It was one cutover, and the 1.x client is gone.delivery: queue, and the last call is steered into the running turn. Questions are forms. The worktree is named by its real path.osf.agent.v2turns opencode 2's events into the events Braid already recorded, so the log, the console and the budget gauge didn't move. A stream cut by an overflow is made whole by the backfill, which tests replay on recorded cases.AGENTS.md. Code Mode (execute), web search and opencode's ownopencodeandreportskills are denied for every agent. MCP servers are writtencodemode: false; without it, opencode 2 offers their tools only inside Code Mode, andbrowserhad no browser.apptool and the guards (bounded reads, no Playwrightfilename, one browser at a time) are opencode 2 plugins.Verified
highvariant, and itstestsubagent ran. A probe of the llama.cpp stack, qwen38-flash-next, worked too: a streamed tool call, reasoning and text, and the medium variant accepted.74e261c).osfd doctorreports opencode 2.0.30. In run 67 (solo, Subagents Off, llama.cpp at a fixed medium effort):execute,websearchand both of opencode's skills, and no step called any of them.medium.Fixed after the deploy, from run 67 (deployed in
55f376c)Follow-ups