@senior: issue #29 — derive Ollama Cloud provider models from the agent registry

The agent→model registry in route.sh is now the single source of truth for
Ollama Cloud model IDs. route.sh publishes the full registry as a step
output (agents=...), and install-opencode.sh derives the ollama-cloud
provider models: map from it (unprefixed IDs), instead of hardcoding a
second copy. The two files can no longer drift silently — adding/changing
a cloud model in the registry automatically updates the provider config.

- route.sh: emit agents=$(jq -c '.' /tmp/agents.json) to GITHUB_OUTPUT
- agent.yml: pass steps.prep.outputs.agents as AGENTS env to install-opencode.sh
- install-opencode.sh: derive CMODELS from $AGENTS; // {} keeps it valid
  when no agent uses an ollama-cloud model (non-ollama repos)
This commit is contained in:
2026-07-04 07:12:15 +00:00
parent b3deee7412
commit 8c17aed1fc
3 changed files with 14 additions and 4 deletions
+3
View File
@@ -43,6 +43,9 @@ mode=$(jq -r --arg a "$name" '.[$a].mode' /tmp/agents.json)
skills=$(jq -c --arg a "$name" '.[$a].skills // []' /tmp/agents.json)
echo "Routing to @$name (model=$model vision=$vision mode=$mode skills=$skills)"
{ echo "name=$name"; echo "model=$model"; echo "vision=$vision"; echo "mode=$mode"; echo "skills=$skills"; } >> "$GITHUB_OUTPUT"
# Publish the full agent registry so install-opencode.sh can derive the provider `models:` map
# from it — single source of truth for Ollama Cloud model IDs, so the two files can't drift.
echo "agents=$(jq -c '.' /tmp/agents.json)" >> "$GITHUB_OUTPUT"
# Act as the agent's own Gitea user when its token is set; else the built-in bot.
case "$name" in