create agent fails - ■ LLM failed to generate agent: Forbidden #2283

Closed
opened 2026-02-16 17:34:57 -05:00 by yindo · 6 comments
Owner

Originally created by @typicalfo on GitHub (Oct 25, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When running 'opencode create agent' the user is prompted for the description, then an error message is returned: "■ LLM failed to generate agent: Forbidden". Running the command again with sudo allows it to complete.

OpenCode version

0.15.16

Steps to reproduce

  1. opencode agent create
  2. enter description when prompted

Screenshot and/or share link

Image

Operating System

macOs 26.0.1

Terminal

Ghostty, iTerm2

Originally created by @typicalfo on GitHub (Oct 25, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When running 'opencode create agent' the user is prompted for the description, then an error message is returned: "■ LLM failed to generate agent: Forbidden". Running the command again with sudo allows it to complete. ### OpenCode version 0.15.16 ### Steps to reproduce 1. `opencode agent create` 2. enter description when prompted ### Screenshot and/or share link <img width="360" height="159" alt="Image" src="https://github.com/user-attachments/assets/5b22736e-f048-4b92-bda8-777a391419f6" /> ### Operating System macOs 26.0.1 ### Terminal Ghostty, iTerm2
yindo added the bug label 2026-02-16 17:34:57 -05:00
yindo closed this issue 2026-02-16 17:34:57 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 25, 2025):

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

  • #2040: Error AI_NoObjectGeneratedError response did not match schema for opencode create agent - Similar agent creation failure with schema validation errors
  • #3212: Agent runs "sudo" and freezes UI when analyzing system configs - Related to sudo permission issues, though different context
  • #652: App becomes unresponsive when executing commands requiring sudo password - Also related to sudo command handling issues

The permission/sudo aspect is similar to #3212 and #652, while the agent creation failure is similar to #2040, though with different error messages.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 25, 2025): This issue might be a duplicate of existing issues. Please check: - #2040: Error AI_NoObjectGeneratedError response did not match schema for opencode create agent - Similar agent creation failure with schema validation errors - #3212: Agent runs "sudo" and freezes UI when analyzing system configs - Related to sudo permission issues, though different context - #652: App becomes unresponsive when executing commands requiring sudo password - Also related to sudo command handling issues The permission/sudo aspect is similar to #3212 and #652, while the agent creation failure is similar to #2040, though with different error messages. Feel free to ignore if none of these address your specific case.
Author
Owner

@typicalfo commented on GitHub (Oct 25, 2025):

I read these other issues previously and believe this to be different.

@typicalfo commented on GitHub (Oct 25, 2025): I read these other issues previously and believe this to be different.
Author
Owner

@rekram1-node commented on GitHub (Oct 25, 2025):

looks like opencode doesnt have access to whatever file you wanted to save the agent to? Was this a global or “local” agent?

It may be an issue with permissions for the executable on your machine

@rekram1-node commented on GitHub (Oct 25, 2025): looks like opencode doesnt have access to whatever file you wanted to save the agent to? Was this a global or “local” agent? It may be an issue with permissions for the executable on your machine
Author
Owner

@typicalfo commented on GitHub (Oct 27, 2025):

It was to create a new agent, so there was no file yet.

Thats definitely possible re: perms. I'm able to use opencode otherwise without issue. And of course this isn't a huge deal, but thought it could be another symptom of something deeper. I'll reinstall when I get a chance and close if that fixes it.

@typicalfo commented on GitHub (Oct 27, 2025): It was to create a new agent, so there was no file yet. Thats definitely possible re: perms. I'm able to use opencode otherwise without issue. And of course this isn't a huge deal, but thought it could be another symptom of something deeper. I'll reinstall when I get a chance and close if that fixes it.
Author
Owner

@rekram1-node commented on GitHub (Oct 28, 2025):

Could also be permissions maybe you need to chown -R $USER ~/.config/opencode or something

@rekram1-node commented on GitHub (Oct 28, 2025): Could also be permissions maybe you need to chown -R $USER ~/.config/opencode or something
Author
Owner

@clowa commented on GitHub (Jan 29, 2026):

Just came along this thread to share how I solved this error when running opencode agent create.

My config was simply incorrect: I've figured it out by running some other opencode commands and opencode models openai gave me:

$ opencode models openai
INFO  2026-01-29T21:49:59 +28ms service=models.dev file={} refreshing
Error: Configuration is invalid at /Users/clowa/.config/opencode/agents/my-agent.md
↳ Invalid input: expected boolean, received object tools.bash

Checking the docs helped my solving the mistake in my-agent.md

@clowa commented on GitHub (Jan 29, 2026): Just came along this thread to share how I solved this error when running `opencode agent create`. My config was simply incorrect: I've figured it out by running some other opencode commands and `opencode models openai` gave me: ``` $ opencode models openai INFO 2026-01-29T21:49:59 +28ms service=models.dev file={} refreshing Error: Configuration is invalid at /Users/clowa/.config/opencode/agents/my-agent.md ↳ Invalid input: expected boolean, received object tools.bash ``` Checking the [docs](https://opencode.ai/docs) helped my solving the mistake in `my-agent.md`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2283