<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged microsoft-windows</title>
<link>https://coderlegion.com/tag/microsoft-windows</link>
<description>Powered by Question2Answer</description>
<item>
<title>OpenCode Not Working in Windows 11: CLI + Desktop Both Fail on ConfigInvalidError — Cause and Fix</title>
<link>https://coderlegion.com/27644/opencode-not-working-in-windows-11-cli-desktop-both-fail-configinvaliderror-cause-and-fix</link>
<description>&lt;p&gt;&lt;strong&gt;Environment:&lt;/strong&gt; Windows 11 Pro Insider Preview (build 10.0.26300), OpenCode CLI v1.18.23, OpenCode Desktop v1.18.25, Node.js v26.7.0.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; OpenCode Not Working — both the CLI and the separately-installed Desktop app fail to start a session, immediately, on every launch attempt.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=9148392891076243846&quot; alt=&quot;OpenCode not working in Windows 11 — technical diagram of CLI and Desktop both failing on ConfigInvalidError&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;reproduction&quot;&gt;Reproduction&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;$ opencode --version
1.18.23
$ opencode
Configuration is invalid at C:\Users\istiqur\.config\opencode\agents\blog-writer.md
↳ Expected object | undefined, got [&quot;Read&quot;,&quot;Write&quot;,&quot;Edit&quot;,&quot;Grep&quot;,&quot;Glob&quot;] tools
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The CLI's validator names the exact file and field. Compare against the Desktop app's &lt;code&gt;renderer.log&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[error]  Failed to load sessions Error: ConfigInvalidError
[error]  Failed to load sessions Error: ConfigInvalidError
[error]  Failed to finish bootstrap instance Error: ConfigInvalidError
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No file path, no field name — same failure class, far less actionable output.&lt;/p&gt;
&lt;h3 id=&quot;root-cause&quot;&gt;Root Cause&lt;/h3&gt;
&lt;p&gt;Five custom subagent &lt;code&gt;.md&lt;/code&gt; files under &lt;code&gt;~/.config/opencode/agents/&lt;/code&gt; declared &lt;code&gt;tools:&lt;/code&gt; as a YAML sequence:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;tools:
  - Read
  - Write
  - Edit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://opencode.ai/docs/config/&quot;&gt;OpenCode's config schema&lt;/a&gt; requires &lt;code&gt;tools&lt;/code&gt; as a mapping (tool name → boolean):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;tools:
  read: true
  write: true
  edit: true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both shapes are valid YAML in isolation — &lt;a rel=&quot;nofollow&quot; href=&quot;https://yaml.org/spec/1.2.2/&quot;&gt;per the YAML 1.2.2 spec&lt;/a&gt;, 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.&lt;/p&gt;
&lt;p&gt;Affected files:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;File &lt;/th&gt;&lt;th&gt;Declared tools&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;blog-writer.md&lt;/code&gt; &lt;/td&gt;&lt;td&gt;Read, Write, Edit, Grep, Glob&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;blog-seo.md&lt;/code&gt; &lt;/td&gt;&lt;td&gt;Read, Grep, Glob&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;blog-reviewer.md&lt;/code&gt; &lt;/td&gt;&lt;td&gt;Read, Grep, Glob&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;blog-researcher.md&lt;/code&gt; &lt;/td&gt;&lt;td&gt;WebSearch, WebFetch, Read, Grep, Glob&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;blog-translator.md&lt;/code&gt; &lt;/td&gt;&lt;td&gt;Read, Write, Edit, Glob, Grep&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=3901805291713832268&quot; alt=&quot;OpenCode not working fix — converting a YAML list tools field to the YAML map format required by OpenCode's schema&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;why-it-broke-both-applications&quot;&gt;Why It Broke Both Applications&lt;/h3&gt;
&lt;p&gt;OpenCode CLI and OpenCode Desktop are separate installers (&lt;code&gt;AppData\Roaming\npm\opencode&lt;/code&gt; vs &lt;code&gt;AppData\Local\Programs\@opencode-aidesktop\OpenCode.exe&lt;/code&gt;) with independent version numbers and log directories. They share the same config root, &lt;code&gt;~/.config/opencode/&lt;/code&gt;, and both boot the same local sidecar server at startup:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[info]  spawning sidecar { url: 'http://127.0.0.1:11956' }
[info]  server ready { url: 'http://127.0.0.1:11956' }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The sidecar itself starts cleanly in both cases (&lt;code&gt;main.log&lt;/code&gt; 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.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=jZcRgkG01Gg&quot;&gt;Watch the full breakdown on video&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;fix&quot;&gt;Fix&lt;/h3&gt;
&lt;p&gt;Frontmatter-only change, one line per file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-diff&quot;&gt; tools:
-  - Read
-  - Write
-  - Edit
+  Read: true
+  Write: true
+  Edit: true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Apply to all five affected files, preserving tool names and case. No reinstall, no cache invalidation, no plugin reset required.&lt;/p&gt;
&lt;h3 id=&quot;verification&quot;&gt;Verification&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;$ opencode
# TUI launches cleanly, 0 matches for &quot;invalid&quot;/&quot;error&quot; in captured output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For Desktop: confirm no stale &lt;code&gt;opencode&lt;/code&gt;-named process is running, force-relaunch, and check the &lt;strong&gt;newest&lt;/strong&gt; 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.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Check &lt;/th&gt;&lt;th&gt;Before &lt;/th&gt;&lt;th&gt;After&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;CLI startup &lt;/td&gt;&lt;td&gt;Fatal &lt;code&gt;ConfigInvalidError&lt;/code&gt; &lt;/td&gt;&lt;td&gt;Clean launch&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Desktop &lt;code&gt;renderer.log&lt;/code&gt; &lt;/td&gt;&lt;td&gt;6 error entries &lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Desktop &lt;code&gt;main.log&lt;/code&gt; &lt;/td&gt;&lt;td&gt;No errors (sidecar itself was fine) &lt;/td&gt;&lt;td&gt;No errors&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bootstrap &lt;/td&gt;&lt;td&gt;Failed &lt;/td&gt;&lt;td&gt;Succeeded&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=3442009814371933697&quot; alt=&quot;Before and after bar chart showing OpenCode not working errors dropping from six to zero once the tools field was fixed&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;related-finding-not-the-root-cause-&quot;&gt;Related Finding (Not the Root Cause)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;opencode.json&lt;/code&gt; 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.&lt;/p&gt;
&lt;h3 id=&quot;takeaways-for-anyone-running-multiple-ai-coding-assistants&quot;&gt;Takeaways for Anyone Running Multiple AI Coding Assistants&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Subagent/plugin config schemas are not interchangeable between vendors, even with near-identical file conventions (Markdown + YAML frontmatter, &lt;code&gt;tools:&lt;/code&gt; field present in both).&lt;/li&gt;
&lt;li&gt;Eager, whole-config, fail-closed validation means a single malformed file can abort every entry point, not just the misconfigured agent.&lt;/li&gt;
&lt;li&gt;A CLI and a GUI application sharing one config root will share failure modes, regardless of separate installers/versions.&lt;/li&gt;
&lt;li&gt;Reproduce GUI failures at the CLI first when a CLI equivalent exists — error verbosity is often not consistent across surfaces of the same product.&lt;/li&gt;
&lt;li&gt;Timestamp-check any log before trusting its contents during verification.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=2117638333071478380&quot; alt=&quot;Three lessons learned from OpenCode not working, covering subagent format mismatches, blast radius, and stale log timestamps&quot;&gt;&lt;/p&gt;
&lt;p&gt;Full writeup (complete diffs, appendix, environment fingerprint): &lt;a rel=&quot;nofollow&quot; href=&quot;https://istiquritconsultant.com/workflow-optimization-blogs/opencode-not-working-windows-11/&quot;&gt;https://istiquritconsultant.com/workflow-optimization-blogs/opencode-not-working-windows-11/&lt;/a&gt; — more postmortems: &lt;a rel=&quot;nofollow&quot; href=&quot;https://istiquritconsultant.com/workflow-optimization-blogs/&quot;&gt;https://istiquritconsultant.com/workflow-optimization-blogs/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;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 &lt;a rel=&quot;nofollow&quot; href=&quot;https://istiquritconsultant.com/no-spam-tech-newsletter/&quot;&gt;newsletter&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;find-me-elsewhere&quot;&gt;Find Me Elsewhere&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/istiquritconsultant/blog-archive&quot;&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://remoteseoconsultant.blogspot.com/&quot;&gt;Blogger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://sites.google.com/view/remotegtmmanager/&quot;&gt;Google Sites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://istiqur-it-consultant.hashnode.dev/&quot;&gt;Hashnode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://remoteseoconsultant.medium.com/&quot;&gt;Medium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://dev.to/remoteseoconsultant&quot;&gt;Dev.to&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://istiquritconsultant.substack.com/&quot;&gt;Substack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://pastebin.com/u/remotegtmmanager&quot;&gt;Pastebin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.linkedin.com/in/md-istiqur-rahman-rabby/&quot;&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://x.com/mdistiqurrahman&quot;&gt;X (Twitter)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Tutorials</category>
<guid isPermaLink="true">https://coderlegion.com/27644/opencode-not-working-in-windows-11-cli-desktop-both-fail-configinvaliderror-cause-and-fix</guid>
<pubDate>Fri, 18 Sep 2026 14:09:54 +0000</pubDate>
</item>
</channel>
</rss>