Skip to content

Can't create an agent with opencode agent create command #4916

Closed

Description

@ppasieka

Description

I want to create an agent with the opencode command, but it fails.

opencode agent create --log-level DEBUG --print-logs
INFO  2025-11-30T07:38:34 +323ms service=default version=1.0.122 args=["agent","create","--log-level","DEBUG","--print-logs"] opencode
INFO  2025-11-30T07:38:34 +1ms service=default directory=/Users/piotrp/.config/opencode creating instance
INFO  2025-11-30T07:38:34 +0ms service=project directory=/Users/piotrp/.config/opencode fromDirectory

┌  Create agent
│
◇  Description
│  Flutter/Dart coding expert. Writes idiomatic, pragmagic, and modern Dart code
│
INFO  2025-11-30T07:38:38 +4701ms service=config path=/Users/piotrp/.config/opencode/config.json loading
INFO  2025-11-30T07:38:38 +1ms service=config path=/Users/piotrp/.config/opencode/opencode.json loading
INFO  2025-11-30T07:38:38 +0ms service=config path=/Users/piotrp/.config/opencode/opencode.jsonc loading
INFO  2025-11-30T07:38:38 +3ms service=bun cmd=["/Users/piotrp/.nvm/versions/node/v23.7.0/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@1.0.122","--exact"] cwd=/Users/piotrp/.config/opencode running
INFO  2025-11-30T07:38:38 +28ms service=bun code=0 stdout=bun add v1.3.3 (274e01c7)

installed @opencode-ai/plugin@1.0.122

[15.00ms] done
 stderr=Saved lockfile
 done
INFO  2025-11-30T07:38:38 +4ms service=provider status=started state
INFO  2025-11-30T07:38:38 +2ms service=models.dev file={} refreshing
INFO  2025-11-30T07:38:38 +4ms service=provider init
INFO  2025-11-30T07:38:38 +1ms service=plugin path=opencode-copilot-auth@0.0.7 loading plugin
INFO  2025-11-30T07:38:38 +11ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
◒  Generating agent configurationINFO  2025-11-30T07:38:39 +28ms service=provider providerID=github-copilot npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=deepseek npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=github-models npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=openrouter npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=anthropic npm=@ai-sdk/anthropic found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=github-copilot-enterprise npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=opencode npm=@ai-sdk/openai-compatible found
INFO  2025-11-30T07:38:39 +0ms service=provider status=completed duration=46 state
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=github-copilot modelID=gemini-3-pro-preview getModel
INFO  2025-11-30T07:38:39 +1ms service=provider status=started providerID=github-copilot getSDK
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=github-copilot pkg=@ai-sdk/openai-compatible using bundled provider
INFO  2025-11-30T07:38:39 +0ms service=provider status=completed duration=0 providerID=github-copilot getSDK
INFO  2025-11-30T07:38:39 +0ms service=provider providerID=github-copilot modelID=gemini-3-pro-preview found
■  LLM failed to generate agent: Bad Request
ERROR 2025-11-30T07:38:39 +394ms service=default name=UICancelledError message=UICancelledError stack=UICancelledError: UICancelledError
    at <anonymous> (src/cli/cmd/agent.ts:55:17)
    at processTicksAndRejections (native:7:39) fatal

I have opencode provider configured.

OpenCode version

1.0.122

Steps to reproduce

  1. call opencode agent create
  2. Specifiy description
  3. Attempt to go further fails

Screenshot and/or share link

No response

Operating System

MacOs

Terminal

Ghostty

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 30, 2025
  2. github-actions commented on Nov 30, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if this doesn't address your specific case.

  3. github-actions commented on Nov 30, 2025

    @github-actions
    Contributor

    DISREGARD - Removing incorrect duplicate suggestion

  4. rwese commented on Nov 30, 2025

    @rwese
    Contributor

    i fail to reproduce the issue, with a new opencode installation.

    Maybe check if you have a project or global configuration which has the wrong default model set.

    You also can specify the model to use with the command.

    ❯ opencode agent create --log-level DEBUG --print-logs
    
    
    
    INFO  2025-11-30T08:32:51 +354ms service=default version=1.0.122 args=["agent","create","--log-level","DEBUG","--print-logs"] opencode
    INFO  2025-11-30T08:32:51 +1ms service=default directory=/volume1/homes/wese/sandpit creating instance
    INFO  2025-11-30T08:32:51 +0ms service=project directory=/volume1/homes/wese/sandpit fromDirectory
    INFO  2025-11-30T08:32:51 +4ms service=project status=started git.rev-parse
    INFO  2025-11-30T08:32:51 +9ms service=project status=completed duration=9 git.rev-parse
    
    ┌  Create agent
    │
    ◇  Description
    │  be happy
    │
    INFO  2025-11-30T08:32:55 +3896ms service=config path=/var/services/homes/wese/.config/opencode/config.json loading
    INFO  2025-11-30T08:32:55 +1ms service=config path=/var/services/homes/wese/.config/opencode/opencode.json loading
    INFO  2025-11-30T08:32:55 +0ms service=config path=/var/services/homes/wese/.config/opencode/opencode.jsonc loading
    INFO  2025-11-30T08:32:55 +3ms service=bun cmd=["/volume1/homes/wese/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.122","--exact"] cwd=/var/services/homes/wese/.config/opencode running
    DEBUG 2025-11-30T08:32:55 +3ms service=config loading config from /volume1/homes/wese/.opencode/opencode.jsonc
    INFO  2025-11-30T08:32:55 +0ms service=config path=/volume1/homes/wese/.opencode/opencode.jsonc loading
    DEBUG 2025-11-30T08:32:55 +1ms service=config loading config from /volume1/homes/wese/.opencode/opencode.json
    INFO  2025-11-30T08:32:55 +0ms service=config path=/volume1/homes/wese/.opencode/opencode.json loading
    INFO  2025-11-30T08:32:55 +0ms service=bun cmd=["/volume1/homes/wese/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.122","--exact"] cwd=/volume1/homes/wese/.opencode running
    INFO  2025-11-30T08:32:55 +2ms service=bun code=0 stdout=bun add v1.3.3 (274e01c7)
    
    installed @opencode-ai/plugin@1.0.122
    
    [2.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-30T08:32:55 +3ms service=bun code=0 stdout=bun add v1.3.3 (274e01c7)
    
    installed @opencode-ai/plugin@1.0.122
    
    [1.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-30T08:32:55 +6ms service=provider status=started state
    INFO  2025-11-30T08:32:55 +2ms service=models.dev file={} refreshing
    INFO  2025-11-30T08:32:55 +7ms service=provider init
    INFO  2025-11-30T08:32:55 +4ms service=plugin path=opencode-copilot-auth@0.0.7 loading plugin
    INFO  2025-11-30T08:32:55 +2ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO  2025-11-30T08:32:55 +33ms service=provider providerID=opencode npm=@ai-sdk/openai-compatible found
    INFO  2025-11-30T08:32:55 +0ms service=provider status=completed duration=48 state
    INFO  2025-11-30T08:32:55 +1ms service=provider providerID=opencode modelID=big-pickle getModel
    INFO  2025-11-30T08:32:55 +0ms service=provider status=started providerID=opencode getSDK
    INFO  2025-11-30T08:32:55 +0ms service=provider providerID=opencode pkg=@ai-sdk/openai-compatible using bundled provider
    INFO  2025-11-30T08:32:55 +1ms service=provider status=completed duration=1 providerID=opencode getSDK
    INFO  2025-11-30T08:32:55 +1ms service=provider providerID=opencode modelID=big-pickle found
    ◇  Agent happiness-boost generated
    │
    ◇  Select tools to enable
    │  bash, read, write, edit, list, glob, grep, webfetch, task, todowrite, todoread
    │
    ◇  Agent mode
    │  All
    │
    ◆  Agent created: /var/services/homes/wese/.config/opencode/agent/happiness-boost.md
    │
    └  Done
    ˋˋˋ
    
    
    
  5. ppasieka commented on Nov 30, 2025

    @ppasieka
    Author

    Thank you @rwese I didn't have the default model set in the config. This ticket can be closed.

    Maybe only the error message could be improved :)

  6. dipping5115 commented on Nov 30, 2025

    @dipping5115

    Hello, I want to confirm if my understanding is correct, that is, after I execute

    opencode
    /models
    /exit

    then the model I just selected will be applied to opencode agent create to generate prompts?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions