OpenCode Not Working in Windows 11: CLI + Desktop Both Fail on ConfigInvalidError — Cause and Fix

OpenCode Not Working in Windows 11: CLI + Desktop Both Fail on ConfigInvalidError — Cause and Fix

●2 ●12 ●26
calendar_today • schedule4 min read

Environment: Windows 11 Pro Insider Preview (build 10.0.26300), OpenCode CLI v1.18.23, OpenCode Desktop v1.18.25, Node.js v26.7.0.

Symptom: OpenCode Not Working — both the CLI and the separately-installed Desktop app fail to start a session, immediately, on every launch attempt.

OpenCode not working in Windows 11 — technical diagram of CLI and Desktop both failing on ConfigInvalidError

Reproduction

$ opencode --version
1.18.23
$ opencode
Configuration is invalid at C:\Users\istiqur\.config\opencode\agents\blog-writer.md
↳ Expected object | undefined, got ["Read","Write","Edit","Grep","Glob"] tools

The CLI's validator names the exact file and field. Compare against the Desktop app's renderer.log:

[error]  Failed to load sessions Error: ConfigInvalidError
[error]  Failed to load sessions Error: ConfigInvalidError
[error]  Failed to finish bootstrap instance Error: ConfigInvalidError

No file path, no field name — same failure class, far less actionable output.

Root Cause

Five custom subagent .md files under ~/.config/opencode/agents/ declared tools: as a YAML sequence:

tools:
  - Read
  - Write
  - Edit

OpenCode's config schema requires tools as a mapping (tool name → boolean):

tools:
  read: true
  write: true
  edit: true

Both shapes are valid YAML in isolation — per the YAML 1.2.2 spec, a sequence and a mapping are distinct node types, so the file parses fine and only fails when a stricter schema inspects the field. All five files carried the identical defect (list format, apparently ported from a different AI coding assistant's subagent convention), confirming a batch-import mismatch rather than an isolated typo.

Affected files:

File Declared tools
blog-writer.md Read, Write, Edit, Grep, Glob
blog-seo.md Read, Grep, Glob
blog-reviewer.md Read, Grep, Glob
blog-researcher.md WebSearch, WebFetch, Read, Grep, Glob
blog-translator.md Read, Write, Edit, Glob, Grep

OpenCode not working fix — converting a YAML list tools field to the YAML map format required by OpenCode's schema

Why It Broke Both Applications

OpenCode CLI and OpenCode Desktop are separate installers (AppData\Roaming\npm\opencode vs AppData\Local\Programs\@opencode-aidesktop\OpenCode.exe) with independent version numbers and log directories. They share the same config root, ~/.config/opencode/, and both boot the same local sidecar server at startup:

[info]  spawning sidecar { url: 'http://127.0.0.1:11956' }
[info]  server ready { url: 'http://127.0.0.1:11956' }

The sidecar itself starts cleanly in both cases (main.log shows no errors) — the failure occurs specifically when the app asks the running server to enumerate the agents directory and receives the validation error back. Config errors introduced through either surface (CLI, direct file edit, another tool) will therefore surface identically on both — they are not independent configuration domains.

Watch the full breakdown on video

Fix

Frontmatter-only change, one line per file:

 tools:
-  - Read
-  - Write
-  - Edit
+  Read: true
+  Write: true
+  Edit: true

Apply to all five affected files, preserving tool names and case. No reinstall, no cache invalidation, no plugin reset required.

Verification

$ opencode
# TUI launches cleanly, 0 matches for "invalid"/"error" in captured output

For Desktop: confirm no stale opencode-named process is running, force-relaunch, and check the newest log session — not the first one alphabetically or chronologically listed. The pre-fix log session will still show the old errors and can easily be mistaken for a failed fix if you don't check its own start timestamp against the fix's file-mtime.

Check Before After
CLI startup Fatal ConfigInvalidError Clean launch
Desktop renderer.log 6 error entries 0
Desktop main.log No errors (sidecar itself was fine) No errors
Bootstrap Failed Succeeded

Before and after bar chart showing OpenCode not working errors dropping from six to zero once the tools field was fixed

opencode.json was found to store MCP service API keys in plaintext. Unrelated to this failure, but worth an audit pass on any OpenCode install — keep such config files out of version control, source keys from environment variables where possible.

Takeaways for Anyone Running Multiple AI Coding Assistants

  • Subagent/plugin config schemas are not interchangeable between vendors, even with near-identical file conventions (Markdown + YAML frontmatter, tools: field present in both).
  • Eager, whole-config, fail-closed validation means a single malformed file can abort every entry point, not just the misconfigured agent.
  • A CLI and a GUI application sharing one config root will share failure modes, regardless of separate installers/versions.
  • Reproduce GUI failures at the CLI first when a CLI equivalent exists — error verbosity is often not consistent across surfaces of the same product.
  • Timestamp-check any log before trusting its contents during verification.

Three lessons learned from OpenCode not working, covering subagent format mismatches, blast radius, and stale log timestamps

Full writeup (complete diffs, appendix, environment fingerprint): https://istiquritconsultant.com/workflow-optimization-blogs/opencode-not-working-windows-11/ — more postmortems: https://istiquritconsultant.com/workflow-optimization-blogs/

This topic was picked by newsletter vote (69% vs. 13% and 18% for two other incidents). Suggestions for future postmortems welcome — comment below or join the newsletter.

Find Me Elsewhere

Want more #ai-agents & #opencode deep dives?

Join 6,051+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

4 Comments

1 vote
1
2 votes
2

More Posts

FluidCloud's CEO on Why NSX Firewall Rules, Not Disk Copies, Stall VMware Exits

Tom Smithverified - Nov 17

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

Migrando 177 sessões do OpenCode para o AI Memory: passo a passo com comandos

Marcos Vilela - Oct 13

Do histórico perdido ao contexto reutilizável: migrando sessões do OpenCode para o AI Memory

Marcos Vilela - Oct 13

AI Memory no Debian: como integrar memória persistente ao OpenCode com mise, MCP e systemd

Marcos Vilela - Oct 13
chevron_left
442 Points • 40 Badges
8Posts
9Comments
8Connections
I am a Remote SEO Consultant for SaaS and Ecommerce, specialized in leading your team to implement a... Show more

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!