fix: hardcode claude-sonnet-4.6 model with explicit models declaration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
5c15e0ba5e
commit
3b4eb6abc3
1 changed files with 7 additions and 9 deletions
|
|
@ -81,12 +81,8 @@ def fetch_role_secrets(bao_token: str, role: str) -> dict:
|
||||||
timeout=10,
|
timeout=10,
|
||||||
)
|
)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
data = resp.json()["data"]["data"]
|
secrets["litellm-key"] = resp.json()["data"]["data"]["key"]
|
||||||
secrets["litellm-key"] = data["key"]
|
log.info("Fetched litellm-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"])
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning("Could not fetch litellm-key: %s", e)
|
log.warning("Could not fetch litellm-key: %s", e)
|
||||||
return secrets
|
return secrets
|
||||||
|
|
@ -97,7 +93,6 @@ def write_opencode_config(secrets: dict, role: str) -> None:
|
||||||
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
|
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
litellm_key = secrets.get("litellm-key", "")
|
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
|
# Set the LiteLLM API key as env var — opencode reads OPENAI_API_KEY for
|
||||||
# openai-compatible providers
|
# openai-compatible providers
|
||||||
|
|
@ -105,14 +100,17 @@ def write_opencode_config(secrets: dict, role: str) -> None:
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"$schema": "https://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"model": litellm_model,
|
"model": "litellm/copilot/claude-sonnet-4.6",
|
||||||
"provider": {
|
"provider": {
|
||||||
"litellm": {
|
"litellm": {
|
||||||
"npm": "@ai-sdk/openai-compatible",
|
"npm": "@ai-sdk/openai-compatible",
|
||||||
"name": "LiteLLM",
|
"name": "LiteLLM",
|
||||||
"options": {
|
"options": {
|
||||||
"baseURL": f"{LITELLM_BASE_URL}/v1",
|
"baseURL": f"{LITELLM_BASE_URL}/v1",
|
||||||
}
|
},
|
||||||
|
"models": {
|
||||||
|
"copilot/claude-sonnet-4.6": {"name": "copilot/claude-sonnet-4.6"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mcp": {
|
"mcp": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue