Single source of truth for agent model IDs (fixes #31) #32

Merged
ffaerber merged 1 commits from ai/issue-31 into main 2026-07-04 09:43:28 +02:00
Owner

Summary

Make the agent→model registry and the ollama-cloud provider model list share a single source of truth so they can no longer drift (issue #31). The registry now lives in .gitea/workflows/scripts/agents.json; route.sh reads it for routing and install-opencode.sh derives its ollama-cloud models: map from it.

Changes

  • New agents.json — single source of truth (agent → model/vision/mode/skills/desc), content identical to the previous inline registry.
  • route.sh — replaced the inline heredoc with a copy of agents.json (resolved via $SCRIPTS, with a $(dirname "$0") fallback for local runs).
  • install-opencode.sh — replaced the hardcoded ollama-cloud models: map with a jq-derived one built from agents.json.

Validation (by reviewer)

  • Derived provider map is set-identical to the prior hardcoded map — no behavior change.
  • agents.json registry content byte-identical to the old inline heredoc.
  • bash -n passes on both scripts.

Note: authored by @senior on issue #31. The automation did not open this PR because that run failed at a later step — the agent deleted the runtime .agents-workflow checkout (which is $SCRIPTS), breaking build-activity-log.sh/publish.sh. Opened manually. See separate infra follow-up.

## Summary Make the agent→model registry and the ollama-cloud provider model list share a single source of truth so they can no longer drift (issue #31). The registry now lives in `.gitea/workflows/scripts/agents.json`; `route.sh` reads it for routing and `install-opencode.sh` **derives** its `ollama-cloud` `models:` map from it. ## Changes - New `agents.json` — single source of truth (agent → model/vision/mode/skills/desc), content identical to the previous inline registry. - `route.sh` — replaced the inline heredoc with a copy of `agents.json` (resolved via `$SCRIPTS`, with a `$(dirname "$0")` fallback for local runs). - `install-opencode.sh` — replaced the hardcoded ollama-cloud `models:` map with a jq-derived one built from `agents.json`. ## Validation (by reviewer) - Derived provider map is **set-identical** to the prior hardcoded map — no behavior change. - `agents.json` registry content **byte-identical** to the old inline heredoc. - `bash -n` passes on both scripts. _Note: authored by @senior on issue #31. The automation did not open this PR because that run failed at a later step — the agent deleted the runtime `.agents-workflow` checkout (which is `$SCRIPTS`), breaking `build-activity-log.sh`/`publish.sh`. Opened manually. See separate infra follow-up._
ffaerber added 1 commit 2026-07-04 09:25:01 +02:00
Extract the agent registry to a shared agents.json and have both
route.sh (agent → model) and install-opencode.sh (ollama-cloud provider
models map) derive from it, so the two lists can no longer drift.

route.sh now copies agents.json to /tmp/agents.json instead of an inline
heredoc. install-opencode.sh builds the ollama-cloud  map by
collecting every registry model with the  prefix and
stripping it — non-ollama-cloud models (e.g. @lead's anthropic/claude-opus,
the local ornith:35b) are excluded by construction.

Resolves #31.
ffaerber merged commit 13148ea68c into main 2026-07-04 09:43:28 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/agents#32