Skip to content

Is this correct way to define subagents with my gemini api key? #4230

@vrijmetse

Description

@vrijmetse

Question

So I have executed opencode auth login then I chose Google and provided the API Key. I can see the model shows up when I launch opencode.

However when I tried to define subagents through opencode.json I got error when during launch.

Error: undefined is not an object (evaluating x3.data.providers).

Heres my current opencode.json which I put in the project root folder.

{
  "$schema": "https://opencode.ai/config.json",
  "agent": {
    "build": {
      "description": "Primary orchestrator that coordinates all sub-agents to build a full-stack Next.js + Supabase app",
      "mode": "primary",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.3,
      "prompt": "{file:./prompts/build.txt}",
      "tools": {
        "write": true,
        "edit": true,
        "bash": true
      }
    },
    "plan": {
      "description": "Primary orchestrator that coordinates all sub-agents to build a full-stack Next.js + Supabase app",
      "mode": "primary",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.3,
      "tools": {
        "write": false,
        "edit": false,
        "bash": false
      }
    },
    "architect": {
      "description": "Designs architecture, database schema, and API contracts for the application",
      "mode": "subagent",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.2,
      "prompt": "{file:./prompts/architect.txt}",
      "tools": {
        "write": true,
        "edit": true
      }
    },
    "frontend": {
      "description": "Builds UI with Next.js, Tailwind, and Supabase integration",
      "mode": "subagent",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.3,
      "prompt": "{file:./prompts/frontend.txt}",
      "tools": {
        "write": true,
        "edit": true
      }
    },
    "backend": {
      "description": "Implements Supabase backend logic, APIs, and security policies",
      "mode": "subagent",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.2,
      "prompt": "{file:./prompts/backend.txt}",
      "tools": {
        "write": true,
        "edit": true
      }
    },
    "devops": {
      "description": "Configures environment variables, deployment, and CI/CD pipelines",
      "mode": "subagent",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.1,
      "prompt": "{file:./prompts/devops.txt}",
      "tools": {
        "write": true,
        "bash": true
      }
    },
    "qa": {
      "description": "Reviews and tests for code quality, performance, and security",
      "mode": "subagent",
      "model": "google/gemini-2.5-pro",
      "temperature": 0.1,
      "prompt": "{file:./prompts/qa.txt}",
      "tools": {
        "write": false,
        "edit": false
      }
    }
  }
}


Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions