fix: hardcode claude-sonnet-4.6 model with explicit models declaration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Zoë 2026-05-30 18:35:46 -07:00
parent 5c15e0ba5e
commit 3b4eb6abc3

View file

@ -81,12 +81,8 @@ def fetch_role_secrets(bao_token: str, role: str) -> dict:
timeout=10,
)
resp.raise_for_status()
data = resp.json()["data"]["data"]
secrets["litellm-key"] = data["key"]
# Use first allowed model; fall back to a sensible default
models = data.get("models", [])
secrets["litellm-model"] = models[0] if models else "copilot/claude-sonnet-4.5"
log.info("Fetched litellm-key; model=%s", secrets["litellm-model"])
secrets["litellm-key"] = resp.json()["data"]["data"]["key"]
log.info("Fetched litellm-key")
except Exception as e:
log.warning("Could not fetch litellm-key: %s", e)
return secrets
@ -97,7 +93,6 @@ def write_opencode_config(secrets: dict, role: str) -> None:
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
litellm_key = secrets.get("litellm-key", "")
litellm_model = f"litellm/{secrets.get('litellm-model', 'copilot/claude-sonnet-4.5')}"
# Set the LiteLLM API key as env var — opencode reads OPENAI_API_KEY for
# openai-compatible providers
@ -105,14 +100,17 @@ def write_opencode_config(secrets: dict, role: str) -> None:
config = {
"$schema": "https://opencode.ai/config.json",
"model": litellm_model,
"model": "litellm/copilot/claude-sonnet-4.6",
"provider": {
"litellm": {
"npm": "@ai-sdk/openai-compatible",
"name": "LiteLLM",
"options": {
"baseURL": f"{LITELLM_BASE_URL}/v1",
}
},
"models": {
"copilot/claude-sonnet-4.6": {"name": "copilot/claude-sonnet-4.6"},
},
}
},
"mcp": {