Skip to content

opencode agent create fails due to OpenAI provider #7995

Closed

Description

@timnew

Description

Agent create subcommand fails when OpenAI provider exists

Log:

INFO  2026-01-12T12:29:50 +244ms service=default version=1.1.14 args=["agent","create","--log-level","DEBUG","--description","review conversations"] opencode
INFO  2026-01-12T12:29:50 +1ms service=default directory=/Users/timnew/workspace/sales-agent/bruno creating instance
INFO  2026-01-12T12:29:50 +0ms service=project directory=/Users/timnew/workspace/sales-agent/bruno fromDirectory
INFO  2026-01-12T12:29:51 +962ms service=config path=/Users/timnew/.config/opencode/config.json loading
INFO  2026-01-12T12:29:51 +0ms service=config path=/Users/timnew/.config/opencode/opencode.json loading
INFO  2026-01-12T12:29:51 +9ms service=config path=/Users/timnew/.config/opencode/opencode.jsonc loading
INFO  2026-01-12T12:29:51 +2ms service=bun cmd=["/Users/timnew/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/Users/timnew/.config/opencode running
INFO  2026-01-12T12:29:51 +5ms service=provider status=started state
INFO  2026-01-12T12:29:51 +2ms service=models.dev file={} refreshing
INFO  2026-01-12T12:29:51 +7ms service=provider init
INFO  2026-01-12T12:29:51 +0ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)

installed @opencode-ai/[email protected]

[6.00ms] done
 stderr=Saved lockfile
 done
INFO  2026-01-12T12:29:51 +0ms service=bun cmd=["/Users/timnew/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","install"] cwd=/Users/timnew/.config/opencode running
INFO  2026-01-12T12:29:51 +1ms service=plugin name=CodexAuthPlugin loading internal plugin
INFO  2026-01-12T12:29:51 +0ms service=plugin path=oh-my-opencode loading plugin
INFO  2026-01-12T12:29:51 +1ms service=bun pkg=oh-my-opencode version=latest installing package using Bun's default registry resolution
INFO  2026-01-12T12:29:51 +0ms service=bun cmd=["/Users/timnew/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","add","--force","--exact","--cwd","/Users/timnew/.cache/opencode","oh-my-opencode@latest"] cwd=/Users/timnew/.cache/opencode running
INFO  2026-01-12T12:29:51 +4ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)

Checked 3 installs across 4 packages (no changes) [1.00ms]
 stderr= done
INFO  2026-01-12T12:29:51 +674ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)

+ [email protected]
+ [email protected]
+ [email protected]

installed [email protected] with binaries:
 - oh-my-opencode

130 packages installed [673.00ms]
 stderr=Resolving dependencies
Resolved, downloaded and extracted [1]
Saved lockfile
 done
INFO  2026-01-12T12:29:52 +474ms service=plugin [email protected] loading plugin
INFO  2026-01-12T12:29:52 +46ms service=plugin [email protected] loading plugin
INFO  2026-01-12T12:29:52 +2ms service=plugin [email protected] loading plugin
INFO  2026-01-12T12:29:52 +11ms service=server status=started method=POST path=/log request
DEBUG 2026-01-12T12:29:52 +1ms service=antigravity.refresh-queue checkIntervalSeconds=300 bufferSeconds=1800 Started proactive refresh queue
INFO  2026-01-12T12:29:52 +1ms service=provider providerID=openrouter found
INFO  2026-01-12T12:29:52 +0ms service=provider providerID=openai found
INFO  2026-01-12T12:29:52 +0ms service=provider providerID=google found
INFO  2026-01-12T12:29:52 +0ms service=provider providerID=opencode found
INFO  2026-01-12T12:29:52 +0ms service=provider status=completed duration=1224 state
INFO  2026-01-12T12:29:52 +1ms service=provider status=started providerID=openai getSDK
INFO  2026-01-12T12:29:52 +0ms service=provider providerID=openai pkg=@ai-sdk/openai using bundled provider
INFO  2026-01-12T12:29:52 +0ms service=provider status=completed duration=0 providerID=openai getSDK
ERROR 2026-01-12T12:29:52 +222ms service=default name=UICancelledError message=UICancelledError stack=UICancelledError: UICancelledError
    at <anonymous> (src/cli/cmd/agent.ts:127:17)
    at processTicksAndRejections (native:7:39) fatal

Plugins

[ "oh-my-opencode", "[email protected]", "opencode-openai-codex-auth" ]

OpenCode version

1.1.14

Steps to reproduce

  1. opencode auth login Login OpenAI via OAuth
  2. opencode agent create fails with error
┌  Create agent
│
◇  Location
│  Current project
│
■  LLM failed to generate agent: Bad Request
  1. opencode auth logout remove OAI provider, everything back to normal.

Screenshot and/or share link

No response

Operating System

macOS 15.7.2 (24G325)

Terminal

Warp v0.2025.12.17.17.17.stable_02

Activity

  1. github-actions commented on Jan 12, 2026

    @github-actions
    Contributor

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

    These issues appear to involve agent creation failures potentially related to provider configuration. Feel free to ignore if your specific case with OpenAI OAuth provider is different from these issues.

  2. kijewskimateusz commented on Jan 20, 2026

    @kijewskimateusz

    Issue persists when I have GitHub Copilot authenticated as well.

    ❯ opencode auth login
    
    ┌  Add credential
    │
    ◇  Select provider
    │  GitHub Copilot
    │
    ◇  Select GitHub deployment type
    │  GitHub.com
    │
    ●  Go to: https://github.com/login/device
    │
    ●  Enter code: 746D-7D68
    │
    ◇  Login successful
    │
    └  Done
    
    cdpt-platform on  main [!?] took 29s 
    ❯ opencode agent create --log-level DEBUG --print-logs
    INFO  2026-01-20T09:20:11 +331ms service=default version=1.1.19 args=["agent","create","--log-level","DEBUG","--print-logs"] opencode
    INFO  2026-01-20T09:20:11 +0ms service=default directory=/Users/mateuszkijewski/work/sita/central-data-platform/cdpt-platform creating instance
    INFO  2026-01-20T09:20:11 +0ms service=project directory=/Users/mateuszkijewski/work/sita/central-data-platform/cdpt-platform fromDirectory
    
    ┌  Create agent
    │
    ◇  Location
    │  Current project
    │
    ◇  Description
    │  Flutter/Dart coding expert. Writes idiomatic, pragmagic, and modern Dart code
    │
    INFO  2026-01-20T09:20:21 +9598ms service=config path=/Users/mateuszkijewski/.config/opencode/config.json loading
    INFO  2026-01-20T09:20:21 +0ms service=config path=/Users/mateuszkijewski/.config/opencode/opencode.json loading
    INFO  2026-01-20T09:20:21 +10ms service=config path=/Users/mateuszkijewski/.config/opencode/opencode.jsonc loading
    INFO  2026-01-20T09:20:21 +3ms service=bun cmd=["/opt/homebrew/Cellar/opencode/1.1.19/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/Users/mateuszkijewski/.config/opencode running
    INFO  2026-01-20T09:20:21 +12ms service=provider status=started state
    INFO  2026-01-20T09:20:21 +3ms service=models.dev file={} refreshing
    INFO  2026-01-20T09:20:21 +0ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
    
    installed @opencode-ai/[email protected]
    
    [4.00ms] done
     stderr=Saved lockfile
     done
    INFO  2026-01-20T09:20:21 +0ms service=bun cmd=["/opt/homebrew/Cellar/opencode/1.1.19/bin/opencode","install"] cwd=/Users/mateuszkijewski/.config/opencode running
    INFO  2026-01-20T09:20:21 +7ms service=provider init
    INFO  2026-01-20T09:20:21 +3ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)
    
    Checked 3 installs across 4 packages (no changes) [1.00ms]
     stderr= done
    INFO  2026-01-20T09:20:21 +0ms service=plugin name=CodexAuthPlugin loading internal plugin
    INFO  2026-01-20T09:20:21 +0ms service=plugin [email protected] loading plugin
    INFO  2026-01-20T09:20:21 +3ms service=plugin [email protected] loading plugin
    INFO  2026-01-20T09:20:21 +22ms service=plugin path=@gitlab/[email protected] loading plugin
    ◒  Generating agent configurationINFO  2026-01-20T09:20:21 +51ms service=provider providerID=github-copilot found
    INFO  2026-01-20T09:20:21 +0ms service=provider providerID=opencode found
    INFO  2026-01-20T09:20:21 +0ms service=provider status=completed duration=89 state
    INFO  2026-01-20T09:20:21 +1ms service=provider status=started providerID=github-copilot getSDK
    INFO  2026-01-20T09:20:21 +0ms service=provider providerID=github-copilot pkg=@ai-sdk/github-copilot using bundled provider
    INFO  2026-01-20T09:20:21 +0ms service=provider status=completed duration=0 providerID=github-copilot getSDK
    ◑  Generating agent configurationINFO  2026-01-20T09:20:21 +591ms service=server method=PUT path=/auth/github-copilot request
    INFO  2026-01-20T09:20:21 +0ms service=server status=started method=PUT path=/auth/github-copilot request
    INFO  2026-01-20T09:20:21 +2ms service=server status=completed duration=2 method=PUT path=/auth/github-copilot request
    ■  LLM failed to generate agent: The requested model is not supported.
    ERROR 2026-01-20T09:20:22 +414ms service=default name=UICancelledError message=UICancelledError stack=UICancelledError: UICancelledError
        at <anonymous> (src/cli/cmd/agent.ts:127:17)
        at processTicksAndRejections (native:7:39) fatal
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions