{
  "$schema": "https://opencode.ai/config.json",
  "model": "yabanin/glm-5.3-flash",
  "instructions": ["examples/opencode-yabanin.md"],
  "provider": {
    "yabanin": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Yabanin",
      "options": {
        "baseURL": "https://yabanin.ai/gw/v1"
      },
      "models": {
        "glm-5.3-flash": {
          "name": "Yabanin · GLM-5.3 Flash (Z.AI Coding Plan)",
          "limit": {
            "context": 128000,
            "output": 32768
          }
        },
        "glm-5.3": {
          "name": "Yabanin · GLM-5.3 (Z.AI Coding Plan)",
          "limit": {
            "context": 128000,
            "output": 32768
          }
        }
      }
    }
  },
  "_note": "Preferred topology matches `make opencode-remote-wire` (scripts/stand-opencode/gen_opencode.py --remote): the public yabanin.ai stand, yabanin/glm-5.3-flash everywhere, grok-4.6 added only with YABANIN_STAND_XAI_KEY. The MCP server runs from a locally built yabanin binary (make build). The local dev stand (make stand-opencode) was retired 2026-10-12.",
  "agent": {
    "yabanin": {
      "description": "Yabanin control plane: Z.AI / local models via gateway, Codex/Cursor via tr_delegate.",
      "mode": "primary",
      "model": "yabanin/glm-5.3-flash",
      "prompt": "Follow examples/opencode-yabanin.md (model routing policy, tr_delegate rules, credentials handling). Use native OpenCode tools for ordinary work. Call MCP tool tr_delegate only for hard coding tasks (analyze or implement). Prefer provider=auto.",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    },
    "luna": {
      "description": "Release-program executor (Luna role). Execute exactly one leased card in the current worktree: follow the accepted contract scope, run the focused gates it names, stop at handoff. Never merges master, never widens write scope, never edits shared files without a transferred lease.",
      "mode": "primary",
      "model": "yabanin/glm-5.3-flash",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    },
    "sol-review": {
      "description": "Independent reviewer (Sol review session). Review exactly one delivered diff against its card and evidence in a fresh session; author self-reports are not review. Read-only on author lanes; verdict and handoff notes only.",
      "mode": "primary",
      "model": "yabanin/glm-5.3-flash",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    },
    "reason": {
      "description": "Deep analysis, architecture, trade-offs, research synthesis. Read-only by intent.",
      "mode": "subagent",
      "model": "yabanin/glm-5.3-flash",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    },
    "code": {
      "description": "Clear, well-specified code edits: templates, tests, docs, refactor by instruction.",
      "mode": "subagent",
      "model": "yabanin/glm-5.3-flash",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    },
    "complex-code": {
      "description": "Heavy algorithmic code generation and complex multi-file implementation. Prefer yabanin/glm-5.3-flash; use yabanin/grok-4.6 for heavy algorithmic codegen when flash struggles (grok-4.6 is configured only with YABANIN_STAND_XAI_KEY).",
      "mode": "subagent",
      "model": "yabanin/glm-5.3-flash",
      "permission": {
        "*": "allow",
        "question": "deny",
        "doom_loop": "allow"
      }
    }
  },
  "mcp": {
    "yabanin": {
      "type": "local",
      "command": [
        "yabanin",
        "mcp"
      ],
      "enabled": true,
      "timeout": 600000,
      "environment": {
        "YABANIN_GATEWAY_URL": "https://yabanin.ai/gw",
        "YABANIN_PARTNER_API_KEY": "{env:YABANIN_PARTNER_API_KEY}",
        "YABANIN_DELEGATION_ENABLED": "true",
        "YABANIN_DELEGATION_BRIDGE_URL": "http://127.0.0.1:18091"
      }
    }
  }
}
