Repository navigation
Description
Description
After auto-upgrade to opencode 1.14.49, then 1.14.50, every opencode run <message> invocation and every TUI message submit terminates with Object.entries on null inside ToolRegistry.state. The TUI swallows the error: it accepts /-slash commands or plain prompts but Enter produces no visible response; the session crashes server-side without surfacing the error. Non-interactive opencode run exits 0 but prints the stack below when --print-logs is enabled.
ERROR service=server error=Object.entries requires that input parameter not be null or undefined cause=TypeError: Object.entries requires that input parameter not be null or undefined
at entries (unknown)
at T (/$bunfs/root/chunk-pdgzgk33.js:1799:849)
at <anonymous> (/$bunfs/root/chunk-pdgzgk33.js:1799:2033)
at ToolRegistry.state (/$bunfs/root/chunk-004r6c01.js:675:17293)
at ToolRegistry.state (definition) (/$bunfs/root/chunk-pdgzgk33.js:1799:766)
at ToolRegistry.all (/$bunfs/root/chunk-pdgzgk33.js:1802:63)
at ToolRegistry.all (definition) (/$bunfs/root/chunk-pdgzgk33.js:1799:2832)
at ToolRegistry.tools (/$bunfs/root/chunk-pdgzgk33.js:1884:897)
at ToolRegistry.tools (definition) (/$bunfs/root/chunk-pdgzgk33.js:1802:12)
at SessionPrompt.resolveTools (/$bunfs/root/chunk-pdgzgk33.js:1890:3277)
at SessionPrompt.resolveTools (definition) (/$bunfs/root/chunk-pdgzgk33.js:1884:79)
at SessionPrompt.run (/$bunfs/root/chunk-pdgzgk33.js:1891:1368)
at SessionPrompt.run (definition) (/$bunfs/root/chunk-pdgzgk33.js:1890:928) failed
Error: {
"name": "UnknownError",
"data": { "message": "Unexpected server error. Check server logs for details." }
}
The crash is specific to projects that ship .opencode/agent/*.md files with a tools: YAML map block. Bisect narrowed the trigger to the combination of: agent file at <project>/.opencode/agent/<name>.md, frontmatter containing tools: in object form (tools:\n Read: true\n Write: true), a non-trivial description text, and a specific combination of name + variant + maxTurns values. None of the elements crash in isolation: renaming name to a different value flips the crash to a plain inference hang; shortening the description flips it the same way; removing the tools: block flips it the same way. Only the full real combination crashes.
What I verified during bisect:
- Reproduces in a fresh
mktemp -dworkspace (no project files other than.opencode/agent/). - Reproduces with the global
oh-my-openagentplugin removed from~/.config/opencode/opencode.json. - Reproduces with the project's local plugin file deleted entirely.
- Reproduces with all five active MCP servers (chrome-devtools, tavily, context7, websearch, grep_app) disabled.
- Reproduces on git revisions of the project plugin from days before today's binary upgrade — confirming the regression is in the binary, not in the project plugin.
- Does not reproduce when every file under
.opencode/agent/is removed:opencode run "ping"returns a normal reply.
Workaround: Downgrade to opencode 1.14.48 per #27435 (another user reports identical "after 1.14.49 messages don't go through, rollback to 1.14.48 fixes it"). Auto-upgrade re-installs 1.14.49 / 1.14.50 after a few hours, so the rollback needs to be paired with disabling auto-upgrade (mechanism not obvious from opencode --help).
Possibly related (all open, all filed today after the 1.14.49/1.14.50 push): #27435 (same rollback-fixes), #27429 (oh-my-opencode plugin: only first message works), #27434 (TUI worker terminated on subagent click with oh-my-openagent), #27447 (No renderer found on 1.14.50 plugin TUI). Adjacent older crash with the same resolveTools call site: closed #12336 (Zod TypeError when loading custom tools from .opencode/, workaround "Remove or rename .opencode directory" — same shape as this one).
Plugins
oh-my-openagent@latest (global), plus a project-local TS plugin that attaches tool.execute.before/after, chat.message, experimental.chat.messages.transform, experimental.session.compacting, event hooks (registers no custom tools)
OpenCode version
1.14.50 (regression first seen on 1.14.49 earlier the same day)
Steps to reproduce
-
Start in a fresh empty directory so no ancestor
.opencode/shadows the test:TEST_DIR=$(mktemp -d) && cd "$TEST_DIR"
-
Drop a project that ships
.opencode/agent/<name>.mdwith the frontmatter shape below. Minimal reproducer (thedescriptiontext mirrors real-world agent docs in length and punctuation — slashes, em-dash, parens, inline-code backticks — which is part of the trigger):mkdir -p "$TEST_DIR/project/.opencode/agent" cat > "$TEST_DIR/project/.opencode/agent/agent-a.md" <<'EOF' --- name: agent-a description: Coordinates parallel sub-tasks a / b / c / d and writes the four final artifacts (`out-a`, `out-b`, `out-c`, `out-d`) from prior-stage inputs. The fifth artifact `out-e` is produced by a deterministic helper rather than an LLM call — see helper notes. Enforces 13 output-safety patterns before writes. model: anthropic/claude-sonnet-4-5 variant: xhigh maxTurns: 35 tools: Read: true Write: true Bash: true Grep: true Glob: true --- You are agent-a. EOF ln -sfn project/.opencode "$TEST_DIR/.opencode" cd "$TEST_DIR"
-
Use per-project XDG dirs so opencode's global SQLite state doesn't mask the bug:
HASH=$(echo -n "$TEST_DIR" | sha256sum | cut -c1-8) ISO_DIR="$HOME/.local/share/opencode-isolated/$(basename $TEST_DIR)_$HASH" mkdir -p "$ISO_DIR/opencode" "$ISO_DIR/state/opencode" export XDG_DATA_HOME="$ISO_DIR" export XDG_STATE_HOME="$ISO_DIR/state"
-
Run any message — expect the stack trace from Description, exit 0, no reply:
opencode run "ping" --print-logs --log-level WARN -
Confirm the crash is agent-loading-side: remove the agent file and re-run. The same command now succeeds and the model replies.
rm "$TEST_DIR/project/.opencode/agent/agent-a.md" opencode run "ping"
Shortening the name value (e.g. name: a) in step 2 — everything else identical — replaces the crash with a plain inference hang (no model response within 18s, no error). Replacing the description with a short plain string does the same. Neither single change restores a working response; only fully removing the agent file does.
Screenshot and/or share link
No response
Operating System
Debian GNU/Linux 12 (bookworm)
Terminal
xterm-256color (also reproduced via non-interactive opencode run from bash 5.2.15)
Activity
[-]● opencode 1.14.49/1.14.50: `opencode run` and TUI submit crash with `Object.entries on null` in `ToolRegistry.state` when project has `.opencode/agent/*.md` with `tools:` map[/-][+]1.14.50: opencode run crashes if project agents present[/+]