Prevent agent model-ID drift between route.sh and install-opencode.sh #31

Closed
opened 2026-07-04 09:15:35 +02:00 by ffaerber · 5 comments
Owner

The set of Ollama Cloud model IDs is declared in two places that must stay in sync:

  • the agent → model registry in .gitea/workflows/scripts/route.sh (each agent's model)
  • the provider models: map in .gitea/workflows/scripts/install-opencode.sh

Nothing keeps them aligned. If an agent in the registry uses a model that is not declared in the provider config, routing to that agent breaks at runtime. They match today, but a future edit to one file can silently break an agent.

Make this robust so the two lists cannot drift — for example a single source of truth, or a check that fails fast with a clear message when they disagree.

The set of Ollama Cloud model IDs is declared in two places that must stay in sync: - the agent → model registry in `.gitea/workflows/scripts/route.sh` (each agent's `model`) - the provider `models:` map in `.gitea/workflows/scripts/install-opencode.sh` Nothing keeps them aligned. If an agent in the registry uses a model that is not declared in the provider config, routing to that agent breaks at runtime. They match today, but a future edit to one file can silently break an agent. Make this robust so the two lists cannot drift — for example a single source of truth, or a check that fails fast with a clear message when they disagree.

🤖 @pm

To ensure the agent-to-model mapping and the provider model list stay synchronized, I will investigate the best way to unify these declarations.

Analysis:
Currently, .gitea/workflows/scripts/route.sh and .gitea/workflows/scripts/install-opencode.sh both maintain lists of model IDs. Since these are shell scripts, the most robust approach is either:

  1. Moving the model definitions to a shared configuration file (e.g., a JSON or simple key-value file) that both scripts source.
  2. Implementing a validation check in the workflow that compares both lists and fails the build if they drift.

Plan:

  1. Research: Analyze the exact structure of the registry in route.sh and the map in install-opencode.sh to determine the simplest shared format.
  2. Implementation: Move the model IDs to a single source of truth and update both scripts to reference this source.
  3. Verification: Ensure the routing and installation logic remains functional.

Given this involves modifying core workflow scripts and potentially introducing a new configuration pattern, I'll assign this to @senior.

@ffaerber ready to start building? reply yes to proceed.

🤖 **@pm** To ensure the agent-to-model mapping and the provider model list stay synchronized, I will investigate the best way to unify these declarations. **Analysis:** Currently, `.gitea/workflows/scripts/route.sh` and `.gitea/workflows/scripts/install-opencode.sh` both maintain lists of model IDs. Since these are shell scripts, the most robust approach is either: 1. Moving the model definitions to a shared configuration file (e.g., a JSON or simple key-value file) that both scripts source. 2. Implementing a validation check in the workflow that compares both lists and fails the build if they drift. **Plan:** 1. **Research:** Analyze the exact structure of the registry in `route.sh` and the map in `install-opencode.sh` to determine the simplest shared format. 2. **Implementation:** Move the model IDs to a single source of truth and update both scripts to reference this source. 3. **Verification:** Ensure the routing and installation logic remains functional. Given this involves modifying core workflow scripts and potentially introducing a new configuration pattern, I'll assign this to **@senior**. @ffaerber ready to start building? reply yes to proceed.
Author
Owner

@pm yes, proceed.

@pm yes, proceed.

🤖 @pm

Handing off to @senior.

🤖 **@pm** Handing off to @senior.
Author
Owner

@senior please proceed with issue #31 per the plan above (delegated by pm).

@senior please proceed with issue #31 per the plan above (delegated by pm).

🔨 @senior is on it — building on branch ai/issue-31. I'll open a PR when it's ready.

🔨 **@senior** is on it — building on branch [`ai/issue-31`](https://git.ffaerber.duckdns.org/ffaerber/agents/src/branch/ai/issue-31). I'll open a PR when it's ready.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/agents#31