Opencode will not launch if you set Agent permissions as True/False instead of Allow/Deny #4748

Open
opened 2026-02-16 17:45:15 -05:00 by yindo · 3 comments
Owner

Originally created by @RealLukeManning on GitHub (Jan 11, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Started using opencode for the first time. Tried migrating some agents I had in Claude Code. Didn't read the documentation properly and set permissions as boolean true/false instead of allow/deny like the documentation states. Once I did that and saved my agent file, opencode just straight up refused to launch, but gave zero indication as to why.

Plugins

None

OpenCode version

1.1.13

Steps to reproduce

You can reproduce with this markdown:

---
description: Test agent
mode: subagent
tools:
  read: true
permission:
  write: false
---

# Test Agent

This is a minimal test agent to debug the loading issue.

Save this to .opencode/agent/testing.md then try to launch opencode in your project directory.

Launching opencode just hangs here forever:

luke@wsl-desktop:~/projects/myproject$ opencode --print-logs --log-level DEBUG
INFO  2026-01-11T15:28:46 +361ms service=default version=1.1.13 args=["--print-logs","--log-level","DEBUG"] opencode
INFO  2026-01-11T15:28:46 +2ms service=config path=/home/luke/.config/opencode/config.json loading
INFO  2026-01-11T15:28:46 +1ms service=config path=/home/luke/.config/opencode/opencode.json loading
INFO  2026-01-11T15:28:46 +3ms service=config path=/home/luke/.config/opencode/opencode.jsonc loading

Logging unfortunately gave me nothing of note other than this one line:

ERROR 2026-01-11T15:28:47 +11ms service=default e=ConfigInvalidError exception

Screenshot and/or share link

N/A

Operating System

Ubuntu 22.04.5 (Windows WSL2)

Terminal

Windows Terminal


My Ask

I've figured this out - so I'm good for now. However I really wish there was a clearer indication of the problem here so I wasn't scratching my head and going off down rabbit holes trying to figure this out.

Originally created by @RealLukeManning on GitHub (Jan 11, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Started using **opencode** for the first time. Tried migrating some agents I had in Claude Code. Didn't read the documentation properly and set permissions as boolean true/false instead of allow/deny like the documentation states. Once I did that and saved my agent file, `opencode` just straight up refused to launch, but gave _zero_ indication as to why. ### Plugins None ### OpenCode version 1.1.13 ### Steps to reproduce You can reproduce with this markdown: ```markdown --- description: Test agent mode: subagent tools: read: true permission: write: false --- # Test Agent This is a minimal test agent to debug the loading issue. ``` Save this to `.opencode/agent/testing.md` then try to launch `opencode` in your project directory. Launching `opencode` just hangs here forever: ``` luke@wsl-desktop:~/projects/myproject$ opencode --print-logs --log-level DEBUG INFO 2026-01-11T15:28:46 +361ms service=default version=1.1.13 args=["--print-logs","--log-level","DEBUG"] opencode INFO 2026-01-11T15:28:46 +2ms service=config path=/home/luke/.config/opencode/config.json loading INFO 2026-01-11T15:28:46 +1ms service=config path=/home/luke/.config/opencode/opencode.json loading INFO 2026-01-11T15:28:46 +3ms service=config path=/home/luke/.config/opencode/opencode.jsonc loading ``` Logging unfortunately gave me nothing of note other than this one line: ``` ERROR 2026-01-11T15:28:47 +11ms service=default e=ConfigInvalidError exception ``` ### Screenshot and/or share link N/A ### Operating System Ubuntu 22.04.5 (Windows WSL2) ### Terminal Windows Terminal ----- ## My Ask I've figured this out - so I'm good for now. However I really wish there was a clearer indication of the problem here so I wasn't scratching my head and going off down rabbit holes trying to figure this out.
yindo added the windowsbug labels 2026-02-16 17:45:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 11, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7483: ConfigInvalidError on Windows due to unrecognized keys - Similar config validation error preventing launch
  • #7791: Schema.ref 'QuestionInfo' validation error in v1.1.x - Related schema validation issue causing startup failures

Both issues describe ConfigInvalidError exceptions that prevent OpenCode from launching due to invalid configuration. Your issue involves invalid permission format (true/false instead of allow/deny), which appears to be a schema validation problem similar to these reported cases.

Feel free to ignore if your issue involves a distinctly different aspect or if these don't match your specific error.

@github-actions[bot] commented on GitHub (Jan 11, 2026): This issue might be a duplicate of existing issues. Please check: - #7483: ConfigInvalidError on Windows due to unrecognized keys - Similar config validation error preventing launch - #7791: Schema.ref 'QuestionInfo' validation error in v1.1.x - Related schema validation issue causing startup failures Both issues describe ConfigInvalidError exceptions that prevent OpenCode from launching due to invalid configuration. Your issue involves invalid permission format (true/false instead of allow/deny), which appears to be a schema validation problem similar to these reported cases. Feel free to ignore if your issue involves a distinctly different aspect or if these don't match your specific error.
Author
Owner

@itstrivial commented on GitHub (Jan 11, 2026):

My PR fixes the crash for true/false, but error messages for other invalid config values still don't display clearly.

One potential solution would be to enhance the worker thread error handlers in packages/opencode/src/cli/cmd/tui/worker.ts to format errors using FormatError() and display them via console.error():

process.on("unhandledRejection", (e) => {
  const formatted = FormatError(e)
  Log.Default.error("rejection", {
    e: e instanceof Error ? e.name : e,
    formatted,
  })
  if (formatted) console.error(formatted)
})

process.on("uncaughtException", (e) => {
  const formatted = FormatError(e)
  Log.Default.error("exception", {
    e: e instanceof Error ? e.name : e,
    formatted,
  })
  if (formatted) console.error(formatted)
})

However, I'm not sure if maintainers would prefer this approach, so I did not implement it.

@itstrivial commented on GitHub (Jan 11, 2026): My PR fixes the crash for `true`/`false`, but error messages for other invalid config values still don't display clearly. One potential solution would be to enhance the worker thread error handlers in `packages/opencode/src/cli/cmd/tui/worker.ts` to format errors using `FormatError()` and display them via `console.error()`: ``` process.on("unhandledRejection", (e) => { const formatted = FormatError(e) Log.Default.error("rejection", { e: e instanceof Error ? e.name : e, formatted, }) if (formatted) console.error(formatted) }) process.on("uncaughtException", (e) => { const formatted = FormatError(e) Log.Default.error("exception", { e: e instanceof Error ? e.name : e, formatted, }) if (formatted) console.error(formatted) }) ``` However, I'm not sure if maintainers would prefer this approach, so I did not implement it.
Author
Owner

@RealLukeManning commented on GitHub (Jan 11, 2026):

I am personally fine with either:

  1. Your Fix
  2. Better outputs to help diagnosis

If we can get both, great. If we can get your PR fix, great.

@RealLukeManning commented on GitHub (Jan 11, 2026): I am personally fine with either: 1. Your Fix 2. Better outputs to help diagnosis If we can get both, great. If we can get your PR fix, great.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4748