feat(agents): wire xAI provider, move @lead to xai/grok-4.5 (issue #12)
ci / lint (pull_request) Successful in 15s
ci / lint (pull_request) Successful in 15s
Add an xai provider (OpenAI-compatible, https://api.x.ai/v1) to install-opencode.sh, with its models map derived from agents.json exactly like the ollama providers. Pass XAI_API_KEY into both the Install-opencode and Run-agent steps of agent.yml. Switch @lead's model from anthropic/claude-opus-4-8 to xai/grok-4.5 (vision-capable, so @lead keeps image reading). All other agents unchanged; ANTHROPIC_API_KEY is retained for @ops and not removed.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
"desc": "Senior dev — complex, multi-file implementation (GLM-5.2 via Ollama Cloud, text-only)."
|
||||
},
|
||||
"lead": {
|
||||
"model": "anthropic/claude-opus-4-8",
|
||||
"model": "xai/grok-4.5",
|
||||
"vision": true,
|
||||
"mode": "pr",
|
||||
"skills": [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install opencode + provider config (+ Playwright MCP for browser agents).
|
||||
#
|
||||
# Required env (provided by the workflow step): OLLAMA_URL OLLAMA_CLOUD_API_KEY NAME SKILLS
|
||||
# GITHUB_PATH HOME
|
||||
# Required env (provided by the workflow step): OLLAMA_URL OLLAMA_CLOUD_API_KEY XAI_API_KEY
|
||||
# NAME SKILLS GITHUB_PATH HOME
|
||||
set -eu
|
||||
|
||||
# PIN the opencode version: an unpinned `latest` means a breaking release (CLI flags, or the
|
||||
@@ -42,15 +42,18 @@ PERM=$(jq -nc --argjson s "$SKILLS" '
|
||||
# The provider `models:` maps are DERIVED from agents.json (the single source of truth, shared with
|
||||
# route.sh) so every model an agent is routed to is always declared in the provider config.
|
||||
# `ollama-cloud/` prefix models go to the cloud provider; `ollama/` prefix models go to the local
|
||||
# provider. Built-in providers (e.g. `anthropic/claude-opus-4-8` for @lead) are not derived here.
|
||||
# provider. `xai/` prefix models go to the xAI provider (OpenAI-compatible, https://api.x.ai/v1).
|
||||
# Built-in providers (e.g. `anthropic/claude-opus-4-8` for @ops) are not derived here.
|
||||
# See issue #31.
|
||||
AGENTS_JSON="${SCRIPTS:-$(dirname -- "$0")}/agents.json"
|
||||
CLOUD_MODELS=$(jq -r '[.[] | .model | select(startswith("ollama-cloud/")) | sub("^ollama-cloud/";"")] | map({(.):{}}) | add // {}' "$AGENTS_JSON")
|
||||
LOCAL_MODELS=$(jq -r '[.[] | .model | select(startswith("ollama/")) | sub("^ollama/";"")] | map({(.):{}}) | add // {"ornith:35b":{}}' "$AGENTS_JSON")
|
||||
jq -n --argjson mcp "$MCP" --argjson perm "$PERM" --argjson cloud "$CLOUD_MODELS" --argjson local "$LOCAL_MODELS" --arg url "$OLLAMA_URL" --arg ckey "$OLLAMA_CLOUD_API_KEY" '{
|
||||
XAI_MODELS=$(jq -r '[.[] | .model | select(startswith("xai/")) | sub("^xai/";"")] | map({(.):{}}) | add // {}' "$AGENTS_JSON")
|
||||
jq -n --argjson mcp "$MCP" --argjson perm "$PERM" --argjson cloud "$CLOUD_MODELS" --argjson local "$LOCAL_MODELS" --argjson xai "$XAI_MODELS" --arg url "$OLLAMA_URL" --arg ckey "$OLLAMA_CLOUD_API_KEY" --arg xkey "$XAI_API_KEY" '{
|
||||
provider: {
|
||||
ollama: {npm:"@ai-sdk/openai-compatible", options:{baseURL:($url+"/v1")}, models:$local},
|
||||
"ollama-cloud": {npm:"@ai-sdk/openai-compatible", options:{baseURL:"https://ollama.com/v1", apiKey:$ckey}, models:$cloud}
|
||||
"ollama-cloud": {npm:"@ai-sdk/openai-compatible", options:{baseURL:"https://ollama.com/v1", apiKey:$ckey}, models:$cloud},
|
||||
xai: {npm:"@ai-sdk/openai-compatible", options:{baseURL:"https://api.x.ai/v1", apiKey:$xkey}, models:$xai}
|
||||
},
|
||||
permission: $perm,
|
||||
mcp: $mcp
|
||||
|
||||
Reference in New Issue
Block a user