feat: per-agent model override + live Ollama capability audit#9
Open
m-marinucci wants to merge 1 commit intodisler:mainfrom
Open
feat: per-agent model override + live Ollama capability audit#9m-marinucci wants to merge 1 commit intodisler:mainfrom
m-marinucci wants to merge 1 commit intodisler:mainfrom
Conversation
Add three features to agent-team.ts: 1. Per-agent model/thinking override via frontmatter fields: Agents can now declare `model: provider/model-id` and `thinking: level` in their .md definition. Falls back to the dispatcher's model when not set. 2. Live Ollama model capability audit: On team activation, queries Ollama /api/show for each agent using a local model. Checks the `capabilities` array for tool-calling support, warns on sub-30B parameter models, and compares local digests against registry.ollama.com for available updates. Three severity levels: - BLOCK: model lacks "tools" capability — dispatch is blocked - WARN: has tools but < 30B params — unreliable for agentic use - UPDATE: newer version available on ollama.com 3. Dispatch-time gate: Before spawning a sub-agent with a local model, checks the capability cache (or runs a live check if cache is cold). Blocks dispatch with a clear error if the model cannot do tool calling. New command: /agents-check — clears cache and re-audits. Security hardening from adversarial review: - Registry URL sanitized via SAFE_REGISTRY_NAME regex - Inverted to LOCAL_PROVIDERS allowlist (forward-compatible) - Failed Ollama checks not cached (transient failures don't poison) - dispatchAgent is now async for live capability checks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modelandthinkingfrontmatter fields to agent definitions — each agent can run on a different LLM provider/model/api/showfor thecapabilitiesarray and compares digests againstregistry.ollama.comfor updates/agents-checkcommand for manual re-auditWhy
When building agent teams with local Ollama models, it's easy to assign a model that doesn't support tool calling (e.g.,
deepseek-r1:8bhas["completion", "thinking"]but no"tools"). The agent silently fails. This feature catches that upfront.How it works
Three severity levels at team activation:
"tools"in Ollama capabilitiesollama pullPer-agent model override via frontmatter:
Agents without
modelinherit the dispatcher's model. Cloud providers are never checked.Security hardening (from adversarial review)
SAFE_REGISTRY_NAMEregex — rejects path traversalLOCAL_PROVIDERSallowlist (forward-compatible vs incomplete cloud list)dispatchAgentruns live capability check when cache is cold (no silent bypass)Test plan
/agents-checkqueries Ollama and reports findingsmodel: m3-ollama/deepseek-r1:8bto an agent — confirm dispatch is BLOCKEDmodel: m3-ollama/llama3.2:3b— confirm WARN (< 30B)model: m3-ollama/qwen3-coder:latest— confirm no warnings (30B+, has tools)modelfield inherit dispatcher model as before🤖 Generated with Claude Code