contribution/compass
anomalyco/opencode

OpenCode

602 signals · 626 observation events

Open repository ↗

The open source coding agent.

197.0K stars25.3K forksTypeScriptMITkeyword: OpenCode
PROJECT NEWS

Release, roadmap, and discussion

All news →
anomalyco/opencode

OpenCode

Coding-Agent Infrastructure
Latest stable

v1.18.18

v1.18.18
  • Core
  • Bugfixes
  • Select the Kimi system prompt correctly for official Moonshot and Kimi providers
  • Fix xhigh reasoning effort for xai models
Original release notes ↗

Publicly indicated next

  • No public prerelease or open milestone found.

Prereleases and milestones indicate public plans; they are not delivery commitments.

Observation trail

  1. discoveredinitial snapshot
  2. changedupdatedAt, metrics, assignees
  3. changedupdatedAt, metrics
  4. discoveredinitial snapshot
  5. discoveredinitial snapshot
  6. discoveredinitial snapshot
  7. discoveredinitial snapshot
  8. changedtext, updatedAt
  9. discoveredinitial snapshot
  10. discoveredinitial snapshot
  11. changedupdatedAt, metrics, state
  12. discoveredinitial snapshot
  13. changedupdatedAt
  14. discoveredinitial snapshot
  15. discoveredinitial snapshot
  16. changedtitle, text, updatedAt
  17. changedmetrics
  18. changedmetrics
  19. changedmetrics
  20. changedmetrics
  21. changedmetrics
  22. changedmetrics
  23. changedmetrics
  24. changedmetrics
  25. changedmetrics
  26. changedmetrics
  27. changedmetrics
  28. changedmetrics
  29. changedmetrics
  30. changedtext, updatedAt, state
50 shown
issue

service: restart leaves stale daemon and duplicated MCP servers running

## Summary `opencode2 service restart` starts a new `serve --service` daemon without terminating the old one; the stale daemon and its MCP server children keep running, duplicating MCP servers and leaking ~1.5 GB of RAM until manually killed. ## Environment - opencode version: 0.0.0-next-17403 (next channel, V2 beta) - OS: macOS 26.6.1 (Darwin 25.6.0, arm64)

importance 4@cioffiAIopen2.0Original evidence ↗
issue

service: idle background daemon holds ~700-800MB RSS

## Summary The `serve --service` background daemon stays resident 24/7 holding ~700-800 MB RSS with no active sessions and 0% CPU (97% of `sample` frames in `kevent64` wait), which shows up as a permanent memory/energy footprint in Activity Monitor on a 16 GB MacBook Air. ## Environment - opencode version: 0.0.0-next-17403 (next channel, V2 beta) - OS: macOS

importance 4@cioffiAIopen2.0Original evidence ↗
issue

TUI stuck when a message is queue and questions pop out

### Description TUI stuck when a message is queue and questions pop out. Inside a session ### Plugins no plugins ### OpenCode version 1.18.16 ### Steps to reproduce 1. openup a session 2. prompt something that makes ai work for a whle then should ask you a question 3. queue a message, in plan mode 4. now its stuck, you can type your answer but cant confirm y

importance 4@SamYue1openOriginal evidence ↗
issue

Config.update() writes runtime local config to ignored project-root config.json (re-open)

### Description Runtime local config updates made through `Config.update()` do not round-trip through instance disposal/reload correctly. `Config.update()` writes to project-root `config.json`, but fresh project config loading reads the normal `opencode.json` / `opencode.jsonc` paths and local `.opencode/opencode.json[c]` overlays instead. Because of that mi

importance 4@mdrkrgopenOriginal evidence ↗
issue

shell tool returns "(no output)" when a single line exceeds the byte limit

### Description When a command prints a single line larger than `tool_output.max_bytes` (default 50 KB) and the output ends with a newline, the shell tool hands the model a truncation banner followed by `(no output)` — the whole body is dropped. The same content without the trailing newline returns the expected 50 KB tail. Cause: `tail()` in `packages/openco

importance 4@codeAnqiang-maopenOriginal evidence ↗
issue

Report: `deepseek-v4-pro` fails on OpenCode Go `/v1/responses` with 503 while `deepseek-v4-flash` works

### Description Report: `deepseek-v4-pro` fails on OpenCode Go `/v1/responses` with 503 while `deepseek-v4-flash` works ## Summary Using Codex (Codex++ / Codex Desktop, Windows 11) with OpenCode Go: - Base URL: `https://opencode.ai/zen/go/v1` - Wire API: `responses` - Model: `deepseek-v4-pro` `deepseek-v4-flash` works with the exact same setup. `deepseek-v4-

importance 4@KomorebiLabsclosedOriginal evidence ↗
issue

V2 external plugins silently fail to register agents/tools after startup

### Description External v2 plugins (configured via `plugin` in opencode.json, or scanned from config directories) are loaded by `ConfigExternalPlugin` in a forked fiber. That fiber inherits the ambient `State` batch from location startup, which runs inside `State.batch(...)` and drains its reload set as soon as the startup effect returns. By the time an asy

importance 4@To-TermopenOriginal evidence ↗
issue

Failed compaction silently drops pre-tail history from the model context

### Description When a compaction summary turn fails with a provider error, everything before the compaction boundary is dropped from the model context and no summary replaces it. The messages stay in the database, so the UI looks fine — the model just stops knowing about the earlier turns, and it repeats on every following turn because the marker is already

importance 4@codeAnqiang-maopenOriginal evidence ↗
issue

Opening a folder with the same name in different project directories navigates to the previously opened project

### Description When opening a folder with the same name from different project directories in the OpenCode desktop app, the app incorrectly navigates to the previously opened project instead of opening the newly selected folder. ### Plugins _No response_ ### OpenCode version v1.18.17 ### Steps to reproduce Create two projects with the same folder name struc

importance 4@ly12300openOriginal evidence ↗
issue

Abort leaves orphaned task calls pending

### Description If OpenCode loses the in-memory runner for a session while a `task` tool call is still persisted as `pending` or `running`, aborting the session only marks it idle. The parent assistant message and task part remain unfinished, so the transcript shows a task that never completed. The TUI startup path for `--continue --fork` can also briefly ro

importance 4@0xfedopenOriginal evidence ↗
issue

Session title silently empty when the title model is a reasoning model (returns only a `<think>` block)

### Description `ensureTitle()` generates the session title with the **small** model (`small: true`). When that model is a *reasoning* model (e.g. GLM-4.6 / Kimi K3 via OpenRouter), the completion is frequently reasoning-only: after the `<think>…</think>` strip in `ensureTitle`, the remaining text is empty. The function then hits `if (!cleaned) return` and t

importance 4@adaline-ankitopenOriginal evidence ↗
issue

[FEATURE]:对大模型的主动联网行为进行控制

### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request 有时候,在使用agent完成任务时,我们不希望大模型有联网行为,虽然联网行为会得到更多的信息,但是这些信息可能是错误的或者不必要的。希望可以添加对大模型主动联网行为的控制,包括联网搜索抓取信息、从网络下载软件等综合行为,api连接等软件必须行为除外。在桌面版本的opencode下,我建议在输入框下和大模型的选择排在一起,添加按钮,简洁方便。

importance 4@Qkk77openOriginal evidence ↗
issue

Auto-updater breaks global npm install: stub binary + missing shims, hung npm processes left behind

## Bug Report: Auto-updater can permanently break the global install (stub binary + missing shims), and hung `npm install` processes keep running **Environment:** Windows 11 (10.0.26200), node v24.15.0, npm 11.12.1, opencode installed via `npm install -g opencode-ai` ### Summary On every startup, opencode spawns a **background** `npm install -g opencode-ai@<

importance 4@hyp-typeopenOriginal evidence ↗
issue

[FEATURE]:Token Usage & Cache Hit Dashboard per Session

### Describe the enhancement you want to request Add a live token usage and cache analytics panel visible during an active OpenCode session. This would display: - Total tokens consumed in the current session (input + output separately) - Cache hit count and cache hit ratio as a percentage - Estimated cost for the current session based on the model being used

importance 4@GuixJoyopenOriginal evidence ↗
issue

[Bug] Desktop TUI: "Files changed" (last round) panel always empty on Windows, file/patch parts never persisted

**Environment** - OpenCode Desktop 1.18.18 (reproduced on 1.16.2 too) - Windows 11 - Workspace root `C:\LiteWorkSpace` is NOT a git repo (git repos live in subdirectories) **Symptom** The right-side panel has two sections: "Changes this round" and "Git changes". The Git section always renders correctly, but "Changes this round" has been empty forever, even a

importance 4@eytazy1haeopenOriginal evidence ↗
issue

serve: idle service burns 20-45% CPU in silent bursts from launch; memory creeps

## Summary A freshly launched, completely idle `serve` service (and its TUI client) burns 20–45% CPU in silent periodic bursts from launch onward, with no log output during the bursts and continuous SQLite WAL writes. RSS creeps upward (~2% of RAM in 6 minutes). Reproduces on every launch; not caused by autoupdate, sessions, activity, or terminal. ## Environ

importance 4@kahlosopen2.0Original evidence ↗
issue

TUI: main thread burns ~100% CPU continuously redrawing a spinner (~15fps writev to tty) with no active output

## Environment - opencode `1.18.18` (npm latest) - Linux x86_64, run in a terminal (`/dev/pts/*`) ## Observed (confirmed via strace + per-thread /proc sampling) - The TUI **main thread** holds ~1 full core (~94-100%) even when the user is not interacting. - `strace` shows the main thread repeatedly calling `writev(1, ...)` writing a ~106-byte spinner frame (

importance 4@pudyopenOriginal evidence ↗
issue

Config parse errors echo the substituted text, not the file as written

### Description Hit this while fixing a typo in my opencode.json. I had a syntax error (forgot the value after "model":) and the config uses {env:DEMO_KEY} for the API key. The error under "--- JSONC Input ---" printed my config back with the actual key value where {env:DEMO_KEY} was. I'd expect it to quote the file the way I wrote it. tui.json goes through

importance 4@codeAnqiang-maopenOriginal evidence ↗
issue

Same git remote URL produces identical project_id for different local clones → only one project visible in desktop sidebar

### Description # Title (EN) Same git remote URL produces identical project_id for different local clones → only one project visible in desktop sidebar # 标题 (中文) 相同的 git remote URL 导致不同本地 clone 生成相同的 project_id,桌面端侧边栏只能看到一个项目 --- ## English version ### Description When two local directories are clones of the **same git remote** (but on different branches / v

importance 4@gangbanbroopenOriginal evidence ↗
issue

Changed-files view shows changes from other sessions (no per-session filtering)

### Description The changed-files indicator in a conversation window lists files that were modified by *other* conversations or tools working in the same directory, not just the changes made by the current session. Observed case: in a session that created exactly one new file, the file-change panel reported 5 changed files. File timestamps show the other fil

importance 4@StarryJindaopenOriginal evidence ↗
issue

Multi-step tool calls overwrite token counts instead of accumulating (output, reasoning, cache.write lost)

## Bug In multi-step tool-call assistant messages, `processor.ts` overwrites `assistantMessage.tokens` on each `step-finish` event instead of accumulating additive fields. Only the last step's output, reasoning, and cache.write survive. ## Root cause `packages/opencode/src/session/processor.ts` step-finish handler: ```ts ctx.assistantMessage.cost += usage.co

importance 4@gold-beyondopenOriginal evidence ↗
issue

[Bug] Stream silently returns empty when calling Zhipu via Anthropic-compatible provider (`/api/anthropic`)

## Summary When configuring OpenCode to call **Zhipu GLM (智谱)** via the **Anthropic-compatible endpoint** (`https://open.bigmodel.cn/api/anthropic`) with `@ai-sdk/anthropic`, the LLM stream **silently returns empty**: - Stream starts (`message=stream ... agent=build mode=primary`) - Within ~200–300ms the loop exits with `step=1` → `exiting loop` - **No chunk

importance 4@spladc-creatoropenOriginal evidence ↗
issue

Version version update miss?

### Description Updated to 1.18.8 this morning, `opencode --version` shows "1.18.8" Ran `opencode web` and in the web UI clicked on `Settings`. Just happened to notice it shows "v1.18.17" <img width="128" height="61" alt="Image" src="https://github.com/user-attachments/assets/9c5ebf6f-6199-4445-80ca-51f2d884b9b5" /> ### Plugins _No response_ ### OpenCode ver

importance 4@c17ropenOriginal evidence ↗
issue

Caret jumps to end of prompt after inserting an @mention on the session page

### Description On the **session page** with the v2 prompt composer, typing an `@` mention mid-text and selecting a suggestion collapses the caret to the **end of the prompt** instead of keeping it right after the inserted mention. For example, with the prompt `please @src/index.ts fix the bug`, placing the caret after `please ` (offset 7), typing `@src`, an

importance 4@gold-beyondopenOriginal evidence ↗
issue

customize-opencode skill has missing global config location

### Description By using /customize-opencode skill, the AI agents always miss out on opencode.jsonc file for configuring opencode configurations such as MCPs, skills, etc. on both user and project folder level and agents just assume that config file is missing and proceed with creating a new one. ### Plugins _No response_ ### OpenCode version 1.18.18 ### Ste

importance 4@TechyAdityaclosedOriginal evidence ↗
issue

tui: slot render returning plain string crashes with "Orphan text error"; @opentui/* unimportable in plugins

## Summary TUI crashes with `Orphan text error: "<string>" must have a <text> as a parent` when a TUI plugin slot (`sidebar.content`) returns a plain string from `render()`. Plugins are effectively forced to return plain strings because importing `@opentui/*` inside a TUI plugin fails on `next-17403` with `OPENTUI_FORCE_WCWIDTH already registered with differ

importance 4@mirtalha1open2.0Original evidence ↗
issue

Forked parent session opens original child session, so Back returns to original parent

## Summary When a session with a task/subagent child is forked, the forked parent still points at the original child session. Entering that child from the fork and clicking "back to parent" returns to the original parent session instead of the forked parent. ## Reproduction 1. Start a parent session `S1`. 2. Have it call the `task` tool / a subagent, produci

importance 4@ton618toopenOriginal evidence ↗
issue

[Bug] OpenCode Go bills gpt-5.6-terra requests as gpt-5.6-luna (Codex Memories background jobs)

### Description Using the OpenCode Go plan as the provider for OpenAI Codex desktop (`model_provider = "opencode-go"`, `base_url = https://opencode.ai/zen/go/v1`, `wire_api = responses`, main model `deepseek-v4-flash`), Codex's built-in **Memories** feature runs background jobs (`memory_stage1`, `memory_consolidate_global`) after each session. Those jobs POS

importance 4@liangjie78openOriginal evidence ↗
issue

Desktop: option to minimize to tray / keep running when window is closed

### Summary On Windows, clicking the window close button (x) quits the OpenCode desktop app entirely. When the last window is closed, `window-all-closed` calls `app.quit()` (see `packages/desktop/src/main/index.ts`). I would like an option so that closing the window minimizes to the system tray / keeps the app running in the background instead of quitting, s

importance 4@DobeShadowopenOriginal evidence ↗
issue

Skills silently vanish on re-parse: gray-matter cache is poisoned when strict-YAML frontmatter parse throws

## Summary Project skills (and potentially agents/commands parsed via `ConfigMarkdown.parse`) **silently vanish** whenever the same markdown content is parsed more than once in a single server process **and** its frontmatter is not strict-YAML-valid (e.g. an unquoted `description:` containing `: `). Root cause: **gray-matter 4.0.3 registers its module-level

importance 4@craftsamoopenOriginal evidence ↗
issue

Response text leaks into tool call parameters — malformed API calls with prose as parameter values

### Description When using local models (tested: qwen3.6-27b-mtp), opencode incorrectly parses model response text as tool call parameters. The parser appears to detect a tool name in the output, then captures surrounding prose as parameter values instead of treating it as plain text. Observed behavior: Tool calls appear with libraryId or other parameters co

importance 4@RichardNHarrisopenOriginal evidence ↗
issue

[FEATURE]:me pagaron el open code go y me da error en todos los modelos

### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request me d el siguiente eror The latest version of this model is only available hosted in China and requires explicit opt in: https://opencode.ai/workspace/wrk_01KZW3YQT6623SMXV5WG7BXM4X/go

importance 4@dailothopenneeds:complianceOriginal evidence ↗
issue

DeepSeek compaction can get stuck replaying reasoning/tool history instead of producing a summary

### Description Description Automatic compaction can become stuck when using a DeepSeek reasoning model through an OpenAI-compatible provider. I reproduced this twice. Instead of producing a compaction summary, the model starts continuing patterns from the conversation history inside its reasoning, including sequences that look like prior tool calls and tool

importance 4@scalpe1openOriginal evidence ↗
issue

tui: subagent model not shown anywhere

## Summary In the TUI, the model used by a subagent is not displayed anywhere: neither in the subagent's block in the main thread, nor in the task/session list, nor in the subagent detail view. ## Environment - opencode version: 1.18.16 (`opencode --version`) - OS: macOS Darwin 25.6.0 (arm64) - Terminal: TERM=xterm-256color - Shell: /bin/zsh - Install/channe

importance 4@reisi007openOriginal evidence ↗
issue

tui: no live preview of running subagent's last message

## Summary In the TUI, while a subagent is running in the background, there is no live preview of the subagent's last message in the main agent thread — the step shows only its status/spinner. ## Environment - opencode version: 1.18.16 (`opencode --version`) - OS: macOS Darwin 25.6.0 (arm64) - Terminal: TERM=xterm-256color - Shell: /bin/zsh - Install/channel

importance 4@reisi007openOriginal evidence ↗
issue

tui: add right sidebar showing background activities (running subagents)

## Summary Feature request: show background activities (running/background subagents) in a **right sidebar** in the TUI — a live list with status, expandable to preview the subagent's last message and see its model. ## Environment - opencode version: 1.18.16 (`opencode --version`) - OS: macOS Darwin arm64 - Terminal: TERM=xterm-256color - Shell: /bin/zsh - I

importance 4@reisi007openneeds:complianceOriginal evidence ↗
issue

Changes don't discard when message is reverted

### Description Changes don't discard when message is reverted (in some projects) I use other agents too (for example: Antigravity), they successfully discard all changes from the reverted point, but in some project, open code doesn't do that ### Plugins Caveman, Magic Context ### OpenCode version 1.18.18 ### Steps to reproduce _No response_ ### Screenshot a

importance 4@AssabTigleGopenOriginal evidence ↗
issue

tui: /compact fails with "Compaction produced no summary" (deepseek flash)

## Summary Running `/compact` in the TUI consistently fails: the compaction step is marked as failed (red `x Compaction`) and reports **"Compaction produced no summary"**. No session summary is produced, so context compaction does not work. ## Environment - opencode version: 1.18.16 (`opencode --version`) - OS: macOS Darwin arm64 - Terminal: TERM=xterm-256co

importance 4@reisi007openOriginal evidence ↗
issue

Startup takes 10-30s, blocking network fetch of models.dev/api.json on every boot when cache is stale

### Description OpenCode blocks startup on a synchronous network fetch of the model registry (`https://models.dev/api.json`, ~3.6MB) whenever the local cache (`~/.cache/opencode/models.json`) is older than the 5-minute TTL. On connections where that host is slow/unstable, this adds **10-30 seconds** to every launch before the TUI appears. Measured on opencod

importance 4@Vedant9500openOriginal evidence ↗
issue

fix(tui): generalize contextual keybind precedence

## Problem Context-specific TUI actions can share a physical key with global or managed-textarea bindings. PR #42366 fixes the observed Shell-tab failure by giving the default `Ctrl+D` binding first refusal, but the mechanism is deliberately literal and local: ```ts if (event.name !== "d" || !event.ctrl) return if (!shortcuts.list("composer.shell.kill").incl

importance 4@kitlangtonopenOriginal evidence ↗
issue

File-mention resolver expands stray "@\" in prompt content to a C:\ drive-root attachment (Windows)

### Description On Windows, OpenCode's server-side prompt file-mention resolver (`SessionPrompt.resolvePromptParts`) scans the **entire** prompt text for `@` mentions and can resolve a stray `@\` byte sequence to the **drive root** `C:\`, then attaches the whole drive-root directory listing to the model context. The mention extractor uses: ```js FILE_REGEX =

importance 4@MaicololiverasopenOriginal evidence ↗
issue

slowless

mimo v2.5 free is so slow its making a readme on 10 hours.

importance 4@tomar753ozi-sketchopenneeds:complianceOriginal evidence ↗
pull request

docs: add opencode-sandbox to ecosystem plugins

### Issue for this PR Closes #42242 ### Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [x] Documentation ### What does this PR do? Adds [opencode-sandbox](https://github.com/isanchez31/opencode-sandbox-plugin) to the ecosystem list. The plugin provides OS-level sandboxing for agent-executed bash commands using seatbelt on

importance 4@isanchez31openOriginal evidence ↗
pull request

feat(tui): make file paths in read/grep/glob tool output clickable

### Issue for this PR Relates to #37891 (partial: TUI file-path click only, not desktop/web) ### Type of change - [x] New feature ### What does this PR do? Makes the summary line of `Read`, `Grep`, and `Glob` tool blocks in the TUI clickable. Clicking opens the referenced file (or search root for grep/glob) in `$VISUAL`/`$EDITOR`, falling back to `code`. I f

importance 4@albertofrzaraopenOriginal evidence ↗
pull request

fix(desktop): make file:// chat links clickable

### Issue for this PR Closes #37891 ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? In the desktop app, `file://` links and absolute paths in chat looked clickable but did nothing. Two causes: 1. DOMPurify dropped `file:` hrefs (default URI allowlist is web-only). 2. The deskt

importance 4@tauseefkhan-maxopenOriginal evidence ↗
pull request

fix: retry truncated provider streams

### Issue for this PR Closes #37852 ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? AI SDK synthesizes an `other` finish when a provider stream ends without a finish reason. OpenCode treated that as a completed `unknown` response, so a subagent could return an empty successful

importance 4@Davide95openOriginal evidence ↗
pull request

feat(tui): make permission mode keybind configurable

### Issue for this PR Closes #40331 ### Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? The TUI already supports toggling auto-approve permissions through the `permission.mode` command, but users cannot assign that command a key in `tui.json`. This change adds `app_toggle_auto_app

importance 4@CasualDeveloperopencontributorOriginal evidence ↗
pull request

fix(compaction): place summary instruction after conversation history

### Issue for this PR Closes #41801 Refs #41268 Refs #41358 Refs #36682 ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? `/compact` (and auto-compaction) sends the summarization request as one user message: summary instruction first, then the serialized conversation. The conver

importance 4@akenraclosedOriginal evidence ↗
pull request

Added recursive AGENTS.md loading from child dirs

## Summary I've successfully implemented recursive loading of AGENTS.md files from child folders. Here's what I did: ### Changes Made: 1. **Added `findDown` function** in `/home/runner/work/opencode/opencode/packages/opencode/src/util/filesystem.ts:69-84`: - Searches for files recursively in child directories using Bun's glob functionality - Includes a confi

importance 4@opencode-agent[bot]Original evidence ↗
pull request

fix(provider): do not place Bedrock cachePoint after reasoning blocks

### Issue for this PR Closes #36517 ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? On Amazon Bedrock (Anthropic Claude with extended thinking), opencode puts a prompt-cache breakpoint on the last couple of messages. The AI SDK emits message-level `bedrock.cachePoint` after ev

importance 3@giggling-gingerclosedautomated-pr-cleanupOriginal evidence ↗