AISpot

opencode v2.2.6 支援 MCP 連線池共享,run 新增 worktree 與歸檔

OpenCode releases版本更新開發工具產品與方案開源

opencode 發布 v2.2.6,MCP 伺服器可開啟 pool: true,在同一配置的多個專案間共享一條連線,減少程序數、啟動更快。opencode run 新增 --worktree/-w,可在新的 git worktree 中啟動會話;--archived 會把會話直接建成歸檔狀態,使指令碼與 CI 會話不進收件箱和會話列表。run 還會等待自身啟動的後臺 shell、子 agent 與圖片任務返回結果後再退出,且沒有時間上限,CI 需自行設定超時。

MCP 連線池、run 的 worktree/歸檔開關,以及後臺任務改為無超時等待,都是會直接改變指令碼化與 CI 工作流的具體行為,opencode 使用者需確認。

原標題:v2.2.6
閱讀原文

評分74 / 73(平均 73,門檻 60)
狀態精選

全文翻譯

亮點 - 共享 MCP 連線:為 MCP 伺服器開啟連線池,以便在具有相同設定的專案之間共享一個連線,從而減少執行的程序數並加快啟動速度。(#61185) - GUI 外掛主題和新插槽:GUI 外掛現在可以新增顏色主題、在程式碼塊中渲染或新增操作,並使用原生設定和選單元件。(#61485,#61533,#61527,#61509) - 移動端 Composer 停靠欄:在手機和平板電腦上,composer 操作現在位於鍵盤上方的觸控停靠欄中,並配有更大的按鈕。(#61773) - 工作樹中的指令碼化執行:執行 opencode run -w 可在新的 git worktree 中啟動會話,或使用 --worktree=<name> 為其命名。(#60712) - 自動歸檔的執行:為 opencode run 新增 --archived,以使指令碼化和 CI 會話不出現在你的收件箱和會話列表中。(#61270) 核心 改進 - 新增了通過 pool: true 啟用的可選 MCP 連線共享。(#61185) - 新增了 opencode run --archived,它會建立已歸檔的會話,使指令碼化和 CI 執行不出現在收件箱、主頁和會話列表中。歸檔會話也會從 TUI 會話列表中隱藏,並被 --continue 跳過。(#61270) - 新增了 opencode run --worktree(-w),它會在新的 git worktree 中啟動會話。使用 --worktree=<name> 選擇 worktree 名稱。它不能與 --continue 或 --session 組合使用。(#60712) - 新增了特定於提供商和模型的會話預熱設定,包括基於快取 TTL 的 interval: "auto" 模式。(#60025,#60969) - 新增了 websearch.use 策略操作,以及通過 OPENCODE_FLAGS=all 或 experimental.all_flags 啟用所有功能標誌的開關。(#61557,#61826) - 為 Code Mode 新增了實驗性位元組碼 VM。它預設關閉;使用 experimental.codemode_vm: true 或 OPENCODE_FLAGS=codemode_vm 將其開啟。(#62358) - 新增了對 Windows 上 Microsoft Store 安裝的 PowerShell 7 的支援。(#61952) - 為 Foundry Claude 模型新增了 Azure Messages 支援。(#60934) Bug 修復 opencode run 現在會等待其提示啟動的後臺 shell 命令、子代理和影像作業,然後讓模型在退出前對這些結果作出回應。等待期間,它會列印 waiting for N background job(s)(使用 --format json 時為 background_wait 事件)。沒有時間限制:永不退出的作業(例如開發伺服器或檔案監視器)會讓該執行保持開啟,直到你按 Ctrl+C 或傳送 SIGTERM,因此請為 CI 作業設定超時。(#60699,#61911) 重構了非互動式 opencode run 執行,使引數、取消、編譯後的 WebSocket 升級以及服務關閉都能可靠完成。SIGTERM 現在會取消會話及其後臺任務,並以退出碼 143 退出。(#61911、#61721、#61518、#61564) 通過伺服器 API 提供的檔案讀取和媒體訪問現在作為沙箱下載提供,並拒絕跨站點瀏覽器導航以及來自不允許來源對 /api/* 的請求,因此專案中的檔案無法在伺服器的源上執行指令碼。(#62422) Webfetch 和 Code Mode fetch 現在會拒絕包含憑據的 URL,並在匹配權限規則時忽略 #fragment,Code Mode fetch 還會根據你的 webfetch 規則檢查每一次重定向。(#60502、#61701、#62373) 在 session_move 離開當前專案之前,請求 external_directory 權限。(#62204) 在模型呼叫之前,最多等待 2 秒讓仍在連線的 MCP 伺服器完成連線,這樣來自快速連線伺服器的工具就能趕上第一條提示和 opencode run。同時展開本地 MCP 工作目錄中的 ~,處理舊版 stdio 伺服器,並在動態註冊期間傳送 logo_uri。(#60490、#61496、#61817、#59031) OpenCode Console 配置請求在 5 秒後超時,這樣當 Console 接受連線但從不回應時,啟動不再掛起。(#62404) 在提供商主機不可達時重試提供商請求,並恢復提前結束的 Cohere 流。(#61880、#61184) 保留舊版自訂提供商,即使其模型只設定了 limit 的一部分(例如只設定 limit.context),而不是在沒有任何錯誤的情況下丟棄整個提供商。感謝 @Tarquinen。(#62240) opencode acp 現在會移除客戶端通過 session/new 建立且未提示就關閉的會話,因此 IDE 整合不再留下空會話。(#62189) 防止重複的 zsh q 標誌凍結 shell 權限掃描。感謝 @yangguan-xue。(#60791) 再次允許 npm upgrade 安裝指令碼。感謝 @renatomoselli。(#51554) TUI 改進 在設定中新增“傳送時滾動”。選擇“保持”(session.submit_scroll: "keep")可在提交提示後保留你的閱讀位置。(#61460) Bug 修復 允許在表單或對話方塊開啟時使用 Ctrl+Z 掛起 OpenCode。(#62118) 當有提問到達時,保持焦點在已開啟的對話方塊上,並限制渲染期間丟擲異常的外掛對話方塊。(#60365、#62110) 當 Ctrl+V 無法讀取剪貼簿時顯示錯誤。感謝 @jimmyallinai。(#61094) 防止包含換行符的會話標題導致 TUI 崩潰。感謝 @vishalShekhar 。( #57523 ) 改進了訊息間距,並防止滾動時舊歷史記錄閃爍。( #62104 ,#59236 ) 在子代理會話中,使用 Home、End 和 Ctrl+G 跳轉到第一條或最後一條訊息。感謝 @ricky9408 。( #60817 ) 在使用 kitty 鍵盤協議的終端中,小鍵盤的 Home、End、Page Up 和 Page Down 現在可以像主鍵一樣瀏覽對話記錄。感謝 @argszero 。( #59770 ) opencode mini 現在使用你配置中的代理顏色。感謝 @ferdinandyb 。( #62067 ) 登入 MCP 伺服器後返回 /mcp 列表,並保持該伺服器仍處於選中狀態。感謝 @Tarquinen 。( #62245 ) 在 /models 中,當模型來自配置中宣告的提供商或附加元件而非已儲存的連線時,允許使用 Ctrl+F 收藏模型。感謝 @Tarquinen 。( #62244 ) 桌面端 改進 為觸控裝置新增了移動端編輯器停靠欄,具有 44px 的操作目標和可預測的多行輸入。( #61773 ) 在標籤頁選單中新增了關閉其他標籤頁和關閉之後標籤頁的操作。( #61631 ) 在收件箱中新增了未讀會話分組,並在標籤頁上新增了執行失敗指示器。( #61691 ,#62077 ) 當自動重定向不可用時,MCP 登入現在接受貼上的重定向 URL。( #61706 ) Markdown 檔案預覽現在將 frontmatter 顯示為屬性列表。( #60333 ) 對於 7 天或更早的會話,命令面板顯示日期而不是“Xd ago”。懸停時間可檢視完整的日期和時間。( #62314 ) 提示歷史現在最多保留 200 條提示。超過最新的 100 條後,僅保留不帶附件的提示。( #62313 ) Bug 修復 改進了載入、重連、重試、滾動、壓縮和樂觀交付期間的提示提交和時間線行為。( #62025 ,#62037 ,#61932 ,#62151 ) 在審查預覽、檔案搜尋、詳情、Word 頁面和審查差異中顯示載入和離線失敗,而不是顯示空白或正常的結果。( #62114 ,#61862 ) 修復了提供商連線、MCP 登入、設定和外掛載入流程在失敗後可能卡住的問題。( #62102 ,#61917 ,#61580 ) 在失敗或併發轉換期間保留草稿、焦點、游標位置、排隊的提示和選定的終端標籤頁。( #61579 ,#61969 ,#61852 ) 在更新交接失敗後重啟外掛,並從瞬時故障中恢復渲染器、儲存、事件流和後臺服務連線。( #61649 ,#61908 ,#61804 ,#61748 ) 修正了 V2 檔案標籤和提及語法。感謝 @Velmet 和 @cheapredwine 。( #55677 , #60737 ) 行內評論中只附加與現有檔案或資料夾匹配的 @提及時,諸如 Check @here 這樣的評論不再導致傳送失敗。審查窗格顯示所有行時渲染部分差異,而不是空白窗格。感謝 @Tarquinen 。( #62242 , #62241 ) 剪貼簿工具刪除其臨時檔案後,貼上的影像仍可傳送。感謝 @lfscqk67 。( #62057 ) 當輸入法正在組合文字時,Escape、Enter 和 Tab 交給輸入法處理,而不是停止代理或選取建議。( #62318 ) 修復了 WSL 發行版選擇器的內邊距、主頁搜尋結果中工作樹和分支標籤的位置,以及介面佈局設定上的選中環。感謝 @inuyume 。( #53676 , #62317 , #62309 ) SDK 改進 新增 client.experimental.job.list() 及其 Effect 等價物,用於列出後臺 shell、子代理和影像任務,支援按會話、後代、型別和狀態篩選。( #60698 ) 伺服器嵌入方可以為 OpenCode HTTP、模型、Web 和遠端 MCP 流量提供自訂 fetch 實現。( #61582 ) 擴充套件 改進 新增 CodeBlock 和 CodeBlockAction GUI 登錄檔,用於自訂圍欄程式碼渲染和操作。( #61533 ) GUI 外掛可以通過 Theme 登錄檔貢獻主題。( #61485 ) 新增 ctx.ui.Select 、設定佈局元件和選單行元件,用於原生外觀的外掛介面。( #61527 ) GUI 外掛側面板可以設定、讀取並持久化其首選寬度。( #61509 ) 錯誤修復 隔離了外掛對話方塊、Markdown 渲染器、終端檢視、惰性塊和產物檢視器,使故障不會導致其宿主介面崩潰。( #62110 , #62123 , #61993 )

由 AI 翻譯,以原文為準。

原文
Highlights Shared MCP Connections : Turn on pooling for an MCP server to share one connection across projects with the same setup, so you run fewer processes and start faster. ( #61185 ) GUI Plugin Themes and New Slots : GUI plugins can now add color themes, render or add actions to code blocks, and use native settings and menu components. ( #61485 , #61533 , #61527 , #61509 ) Mobile Composer Dock : On phones and tablets, composer actions now sit in a touch dock above the keyboard with larger buttons. ( #61773 ) Scripted Runs in Worktrees : Run opencode run -w to start the session in a new git worktree, or --worktree=<name> to name it. ( #60712 ) Automatically Archived Runs : Add --archived to opencode run to keep scripted and CI sessions out of your inbox and session lists. ( #61270 ) Core Improvements Added opt-in MCP connection sharing through pool: true . ( #61185 ) Added opencode run --archived , which creates the session already archived so scripted and CI runs stay out of the inbox, home, and session lists. Archived sessions are also hidden from the TUI session list and skipped by --continue . ( #61270 ) Added opencode run --worktree ( -w ), which starts the session in a new git worktree. Use --worktree=<name> to choose the worktree name. It cannot be combined with --continue or --session . ( #60712 ) Added provider- and model-specific session warming settings, including an interval: "auto" mode based on cache TTL. ( #60025 , #60969 ) Added the websearch.use policy action and switches for enabling all feature flags with OPENCODE_FLAGS=all or experimental.all_flags . ( #61557 , #61826 ) Added an experimental bytecode VM for Code Mode. It is off by default; turn it on with experimental.codemode_vm: true or OPENCODE_FLAGS=codemode_vm . ( #62358 ) Added support for Microsoft Store installations of PowerShell 7 on Windows. ( #61952 ) Added Azure Messages support for Foundry Claude models. ( #60934 ) Bug fixes opencode run now waits for the background shell commands, subagents, and image jobs that its prompt started, then lets the model respond to their results before it exits. While it waits, it prints waiting for N background job(s) (a background_wait event with --format json ). There is no time limit: a job that never exits, such as a dev server or file watcher, keeps the run open until you press Ctrl+C or send SIGTERM, so set a timeout on CI jobs. ( #60699 , #61911 ) Reworked noninteractive opencode run execution so arguments, cancellation, compiled WebSocket upgrades, and service shutdown complete reliably. SIGTERM now cancels the session and its background jobs and exits with code 143. ( #61911 , #61721 , #61518 , #61564 ) Serve file reads and media from the server API as sandboxed downloads, and refuse cross-site browser navigations and requests from disallowed origins to /api/* , so a file in your project cannot run scripts on the server's origin. ( #62422 ) Webfetch and Code Mode fetch now reject URLs that contain credentials and ignore the #fragment when matching permission rules, and Code Mode fetch checks every redirect against your webfetch rules. ( #60502 , #61701 , #62373 ) Ask for external_directory permission before session_move leaves the current project. ( #62204 ) Wait up to 2 seconds for MCP servers that are still connecting before a model call, so tools from servers that connect quickly reach the first prompt and opencode run . Also expand ~ in local MCP working directories, handle legacy stdio servers, and send logo_uri during dynamic registration. ( #60490 , #61496 , #61817 , #59031 ) Time out OpenCode Console config requests after 5 seconds, so startup no longer hangs when the Console accepts the connection but never answers. ( #62404 ) Retry provider requests while their host is unreachable and recover prematurely ended Cohere streams. ( #61880 , #61184 ) Keep legacy custom providers whose models set only part of limit , such as only limit.context , instead of dropping the whole provider without an error. Thanks @Tarquinen . ( #62240 ) opencode acp now removes a session that a client creates with session/new and closes without prompting, so IDE integrations no longer leave empty sessions behind. ( #62189 ) Prevent repeated zsh q flags from freezing shell permission scanning. Thanks @yangguan-xue . ( #60791 ) Allow npm upgrade install scripts again. Thanks @renatomoselli . ( #51554 ) TUI Improvements Added Scroll on send in Settings. Choose Keep ( session.submit_scroll: "keep" ) to retain your reading position after submitting a prompt. ( #61460 ) Bug fixes Allow Ctrl+Z to suspend OpenCode while a form or dialog is open. ( #62118 ) Keep focus on an open dialog when a question arrives and contain plugin dialogs that throw during rendering. ( #60365 , #62110 ) Show an error when Ctrl+V cannot read the clipboard. Thanks @jimmyallinai . ( #61094 ) Prevent session titles containing newlines from crashing the TUI. Thanks @vishalShekhar . ( #57523 ) Improved message spacing and prevented older history from flashing while scrolling. ( #62104 , #59236 ) Jump to the first or last message with Home, End, and Ctrl+G in subagent sessions. Thanks @ricky9408 . ( #60817 ) Keypad Home, End, Page Up, and Page Down now navigate the transcript like the main keys in terminals that use the kitty keyboard protocol. Thanks @argszero . ( #59770 ) opencode mini now uses the agent colors from your config. Thanks @ferdinandyb . ( #62067 ) Return to the /mcp list after signing in to an MCP server, with that server still selected. Thanks @Tarquinen . ( #62245 ) Allow favoriting models with Ctrl+F in /models when they come from a provider declared in config or an add-on instead of a saved connection. Thanks @Tarquinen . ( #62244 ) Desktop Improvements Added a mobile composer dock for touch devices, with 44px action targets and predictable multiline input. ( #61773 ) Added close-other-tabs and close-tabs-after actions to the tab menu. ( #61631 ) Added unread-session grouping in Inbox and failed-run indicators on tabs. ( #61691 , #62077 ) MCP sign-in now accepts a pasted redirect URL when automatic redirection is unavailable. ( #61706 ) Markdown file previews now display frontmatter as a properties list. ( #60333 ) The command palette shows a date instead of "Xd ago" for sessions 7 or more days old. Hover the time to see the full date and time. ( #62314 ) Prompt history now keeps up to 200 prompts. Past the newest 100, only prompts without attachments are kept. ( #62313 ) Bug fixes Improved prompt submission and timeline behavior during loading, reconnects, retries, scrolling, compaction, and optimistic delivery. ( #62025 , #62037 , #61932 , #62151 ) Surface loading and offline failures in review previews, file search, details, Word pages, and review diffs instead of showing empty or clean results. ( #62114 , #61862 ) Fixed provider connection, MCP sign-in, settings, and plugin loading flows that could become stuck after failures. ( #62102 , #61917 , #61580 ) Preserve drafts, focus, caret position, queued prompts, and selected terminal tabs across failed or concurrent transitions. ( #61579 , #61969 , #61852 ) Restart plugins after failed update handoffs and recover the renderer, storage, event stream, and background-service connection from transient failures. ( #61649 , #61908 , #61804 , #61748 ) Corrected V2 file labels and mention syntax. Thanks @Velmet and @cheapredwine . ( #55677 , #60737 ) Attach only the @mentions in a line comment that match an existing file or folder, so a comment such as Check @here no longer fails the send. Render partial diffs in the review pane when it shows all lines, instead of a blank pane. Thanks @Tarquinen . ( #62242 , #62241 ) Keep pasted images sendable after the clipboard tool deletes its temporary file. Thanks @lfscqk67 . ( #62057 ) While an input method is composing text, Escape, Enter, and Tab go to the input method instead of stopping the agent or picking a suggestion. ( #62318 ) Fixed padding in the WSL distribution picker, the position of worktree and branch labels in Home search results, and the selected ring on the Interface layout setting. Thanks @inuyume . ( #53676 , #62317 , #62309 ) SDK Improvements Added client.experimental.job.list() and its Effect equivalent for listing background shell, subagent, and image jobs, with session, descendant, kind, and status filters. ( #60698 ) Server embedders can provide a custom fetch implementation for OpenCode HTTP, model, web, and remote MCP traffic. ( #61582 ) Extensions Improvements Added CodeBlock and CodeBlockAction GUI registries for custom fenced-code rendering and actions. ( #61533 ) GUI plugins can contribute themes through the Theme registry. ( #61485 ) Added ctx.ui.Select , settings layout components, and menu-row components for native-looking plugin interfaces. ( #61527 ) GUI plugin side panels can set, read, and persist their preferred width. ( #61509 ) Bug fixes Isolated plugin dialogs, Markdown renderers, terminal views, lazy chunks, and artifact viewers so failures do not take down their host surface. ( #62110 , #62123 , #61993 )

相關報導

OpenCode releases● 精選AI 評分61

opencode v2.2.5 新增 worktree 與 shell 模式快捷鍵

opencode 發布 v2.2.5,桌面端新增快捷鍵:macOS 按 ⌘⌥O 選 worktree、⌘⌥B 選基線分支,⌘⇧X 切換 shell 模式(Windows/Linux 對應 Ctrl+Alt+O、Ctrl+Alt+B、Ctrl+Shift+X)。配置項 compaction.buffer 現在也可寫百分比(如 20%),按各模型上下文視窗留出餘量,token 數值寫法仍可用。引用彈窗中按住 ⌘/Ctrl 或按 ⌘Enter 可只傳送這條引用與評論。

OpenCode releases● 精選AI 評分71

OpenCode v2.2.4:桌面終端可跨重啟保留,還能發布 HTML 工件

OpenCode v2.2.4 發布,桌面終端歸屬於會話,伺服器重啟後終端與滾動緩衝仍在,並與 TUI 及其他視窗保持同步,重新命名也會保留。在 opencode.json 啟用 experimental.artifacts 後,agent 可發布、更新並通過內建本地 provider 或外掛儲存提供 HTML 與靜態工件。

Hacker News front page● 精選AI 評分83

OpenCode 2.0 發布:MCP 預設啟用 Code Mode,新增後臺子代理

OpenCode 2.0 是一次大規模重構,核心新功能是 Code Mode:用 @opencode/codemode 包內建的極簡 JavaScript 直譯器,把 MCP 伺服器與 OpenAPI 端點轉成代理可呼叫的函式,2.0 中所有 MCP 伺服器預設啟用 Code Mode,一次指令碼就能串起多個工具呼叫,減少往返。服務端也改為在本地自動以單一後臺程序執行,TUI、Web 與桌面端共用同一程序,並推出 @opencode/client 客戶端包與從頭重寫的 API。

OpenCode releases● 精選AI 評分72

OpenCode 2.2.0 發布:桌面端支援外掛,新增 GPT-6.1 Terra

OpenCode 發布 2.2.0 版,桌面端可建立、安裝和共享外掛(實驗性),桌面應用介面也做了重新設計。Sign in with ChatGPT 新增 GPT-6.1 Terra 與 GPT-6.1 Terra Fast 兩個模型,外掛側新增實驗性影像與決策生成 API。破壞性變更包括:@opencode/ai 包根匯出改為 Promise API,Effect API 移至 @opencode/ai/effect;OpenCode GitHub Action 不再發布;

OpenCode releasesAI 評分47

OpenCode v1.19.1 停止會話分享功能

OpenCode 發布 v1.19.1,最重要的改動是停止會話分享:已有分享連結與會話分享命令不再可用,從分享 URL 匯入會話也不再支援,該項列在 Core 的 Bugfixes 下。發布者為 opencode-agent,日期為 2026 年 10 月 15 日,相對上一版本沒有新增提交(0 commits),除會話分享外未提及新模型或其他功能變化。該版本被標記為不可變發布(Immutable),僅標題與說明可修改。