Skip to content

[FEATURE]: OpenCode GitHub Actions can't work with disabled default agents #4578

@AdiKsOnDev

Description

@AdiKsOnDev

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Context

There is a way to disable the primary agents that OpenCode ships with originally by adding the following lines to the config:

{
  "agent": {
    "plan": {
      "disable": true
    },
    "build": {
      "disable": true
    }
  },
}

This is very useful when making custom primary agents that have the same purpose but with prompts that better suit one's needs. And I personally place them in my repositories to enforce these agents on my team members.

The issue

When working with the OpenCode agent, it also uses this config file. And if the default agents are disabled, OpenCode workflow fails with an error:

 opencode
undefined is not an object (evaluating 'agent.name')

There is an obvious work-around that I am currently using, which is to (surprise) turn on the default agents. But personally, it's very annoying because it forces me to toggle between ~7 agents every time I start up opencode

Proposal

It'd be great to add the ability to specify the agent you want OpenCode to use when prompting it through CLI, then add support for that feature in GitHub actions:

opencode --agent [name-of-primary-agent] <prompt>

Then in GitHub when prompting, add a possibility to pass the agent name as an option

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions