Skip to content

Conversation

@itstrivial
Copy link

Fixes #7810

What does this PR do?

Users may now use boolean true/false instead of "allow"/"deny" for permissions.
This adds a preprocess step to convert booleans automatically, consistent with how tools config already handles this.

How did you verify your code works?

I created .opencode/agent/testing.md with the following permissions:

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

I then launched OpenCode in my project directory. It now launches successfully and does not hang like before.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@itstrivial
Copy link
Author

itstrivial commented Jan 11, 2026

The original issue #7810 also mentions poor error visibility.

This 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant