From 5a15e5b79b53912ff91195d40ac54719cdfd3b9e Mon Sep 17 00:00:00 2001 From: nunziati Date: Fri, 10 Apr 2026 11:51:53 +0000 Subject: [PATCH] Modify generic name for model tiers Co-Authored-By: win0na refactor: neutral model vocabulary (low/mid/high) in source agents feat(claude-code): cc_model_to_native() maps low/mid/high to haiku/sonnet/opus Co-Authored-By: Claude Sonnet 4.6 feat(opencode): update oc_model_to_provider() for low/mid/high vocabulary Co-Authored-By: Claude Sonnet 4.6 --- adapters/claude-code/adapter.sh | 13 +++++++++++++ adapters/lib.sh | 3 +++ adapters/opencode/adapter.sh | 12 ++++++------ agents/architect.md | 2 +- agents/connector.md | 2 +- agents/librarian.md | 2 +- agents/postman.md | 2 +- agents/scribe.md | 2 +- agents/seeker.md | 2 +- agents/sorter.md | 2 +- agents/transcriber.md | 2 +- tests/adapters/claude-code/adapter.test.sh | 13 +++++++++++-- tests/adapters/opencode/adapter.test.sh | 10 +++++----- 13 files changed, 46 insertions(+), 21 deletions(-) diff --git a/adapters/claude-code/adapter.sh b/adapters/claude-code/adapter.sh index 91140fe..12be5a3 100755 --- a/adapters/claude-code/adapter.sh +++ b/adapters/claude-code/adapter.sh @@ -132,6 +132,18 @@ cc_match_tool_to_matcher() { echo "$matcher" } +# Neutral model tier → Claude Code model name. +cc_model_to_native() { + local model="$1" + case "$model" in + */*) echo "$model" ;; # already qualified — passthrough + low) echo "haiku" ;; + mid) echo "sonnet" ;; + high) echo "opus" ;; + *) echo "$model" ;; # unknown — passthrough + esac +} + # adapter_translate_hooks adapter_translate_hooks() { local src="$1" dst="$2" @@ -208,6 +220,7 @@ adapter_translate_agents() { should_include "$agent" "$CC_PLATFORM" || continue local name; name="$(parse_frontmatter "$agent" name)" local model; model="$(parse_frontmatter "$agent" model)" + model="$(cc_model_to_native "$model")" local caps; caps="$(parse_capabilities "$agent")" # Build tools allowlist by expanding each capability. diff --git a/adapters/lib.sh b/adapters/lib.sh index ebe7f73..fa7441f 100755 --- a/adapters/lib.sh +++ b/adapters/lib.sh @@ -15,6 +15,9 @@ CAPABILITY_VOCAB="read write edit bash webfetch websearch notebook task todo" # The closed set of hook event names the source .hook.yaml may declare. EVENT_VOCAB="before-tool-use after-tool-use on-notification on-session-start on-prompt-submit" +# The closed set of model names the source agents may declare. +MODEL_VOCAB="low mid high" + # ── Path rewriting ─────────────────────────────────────────────────────────── # rewrite_framework_paths diff --git a/adapters/opencode/adapter.sh b/adapters/opencode/adapter.sh index 9b34e1f..83c9ae4 100755 --- a/adapters/opencode/adapter.sh +++ b/adapters/opencode/adapter.sh @@ -54,17 +54,17 @@ oc_event_to_native() { esac } -# CC-style short model name → opencode provider/model id. Conservative mapping: +# Neutral model tier → opencode provider/model id. Conservative mapping: # if the source model is already provider-prefixed (contains "/"), pass through # unchanged. Otherwise look up in the table and fall back to the raw value. oc_model_to_provider() { local model="$1" case "$model" in - */*) echo "$model" ;; # already qualified - sonnet) echo "anthropic/claude-sonnet-4-5" ;; - opus) echo "anthropic/claude-opus-4-5" ;; - haiku) echo "anthropic/claude-haiku-4-5" ;; - *) echo "$model" ;; # unknown — pass through + */*) echo "$model" ;; # already qualified + low) echo "anthropic/claude-haiku-4-5" ;; + mid) echo "anthropic/claude-sonnet-4-5" ;; + high) echo "anthropic/claude-opus-4-5" ;; + *) echo "$model" ;; # unknown — passthrough esac } diff --git a/agents/architect.md b/agents/architect.md index 39455c5..ef961bc 100755 --- a/agents/architect.md +++ b/agents/architect.md @@ -19,7 +19,7 @@ description: > another agent reports a missing structure. mode: subagent capabilities: [read, write, edit, bash] -model: opus +model: high --- # Architect — Vault Structure, Governance & Onboarding Agent diff --git a/agents/connector.md b/agents/connector.md index fc87a61..7847492 100755 --- a/agents/connector.md +++ b/agents/connector.md @@ -16,7 +16,7 @@ description: > or after a large batch of notes has been filed and needs cross-linking. mode: subagent capabilities: [read, edit] -model: sonnet +model: mid --- # Connector — Knowledge Graph Intelligence Agent diff --git a/agents/librarian.md b/agents/librarian.md index 8c22280..2f00757 100755 --- a/agents/librarian.md +++ b/agents/librarian.md @@ -17,7 +17,7 @@ description: > or when the user suspects broken links, misplaced files, or structural problems. mode: subagent capabilities: [read, write, edit, bash] -model: opus +model: high --- # Librarian — Vault Health & Quality Guardian diff --git a/agents/postman.md b/agents/postman.md index b0df2fc..84cfe73 100755 --- a/agents/postman.md +++ b/agents/postman.md @@ -27,7 +27,7 @@ description: > "preparar a reunião", "agenda semanal", "rascunho de resposta". mode: subagent capabilities: [read, write, edit, bash] -model: sonnet +model: mid --- # Postman — Email & Calendar Intelligence Hub diff --git a/agents/scribe.md b/agents/scribe.md index da487aa..bcdb08c 100755 --- a/agents/scribe.md +++ b/agents/scribe.md @@ -14,7 +14,7 @@ description: > of related thoughts that need to be turned into proper notes. mode: subagent capabilities: [read, write, edit] -model: sonnet +model: mid --- # Scribe — Intelligent Text Capture & Refinement Agent diff --git a/agents/seeker.md b/agents/seeker.md index 3d1e3d7..201a586 100755 --- a/agents/seeker.md +++ b/agents/seeker.md @@ -16,7 +16,7 @@ description: > or any question that requires looking up existing vault content. mode: subagent capabilities: [read] -model: sonnet +model: mid --- # Seeker — Vault Intelligence & Knowledge Retrieval Agent diff --git a/agents/sorter.md b/agents/sorter.md index 3aebec4..337e828 100755 --- a/agents/sorter.md +++ b/agents/sorter.md @@ -12,7 +12,7 @@ description: > or when the Inbox has accumulated notes that need filing. mode: subagent capabilities: [read, write, edit, bash] -model: sonnet +model: mid --- # Sorter — Intelligent Inbox Triage & Filing Agent diff --git a/agents/transcriber.md b/agents/transcriber.md index cfa5a61..43b92f4 100755 --- a/agents/transcriber.md +++ b/agents/transcriber.md @@ -19,7 +19,7 @@ description: > Also triggers when the user uploads an audio file (mp3, m4a, wav) or pastes a raw transcript. mode: subagent capabilities: [read, write] -model: sonnet +model: mid --- # Transcriber — Audio & Meeting Intelligence diff --git a/tests/adapters/claude-code/adapter.test.sh b/tests/adapters/claude-code/adapter.test.sh index 2f83cc0..dfdf857 100755 --- a/tests/adapters/claude-code/adapter.test.sh +++ b/tests/adapters/claude-code/adapter.test.sh @@ -71,7 +71,7 @@ test_translate_agents_basic() { --- name: scribe description: Test scribe -model: sonnet +model: mid mode: subagent capabilities: [read, write, edit] --- @@ -98,7 +98,7 @@ test_translate_agents_bash_capability() { --- name: architect description: Test -model: opus +model: high capabilities: [read, write, edit, bash] --- @@ -183,3 +183,12 @@ EOF rm -rf "$src" "$dst" return $result } + +test_cc_model_to_native_maps_tiers() { + local result=0 + [[ "$(cc_model_to_native "low")" == "haiku" ]] || { echo "low→haiku failed"; result=1; } + [[ "$(cc_model_to_native "mid")" == "sonnet" ]] || { echo "mid→sonnet failed"; result=1; } + [[ "$(cc_model_to_native "high")" == "opus" ]] || { echo "high→opus failed"; result=1; } + [[ "$(cc_model_to_native "anthropic/custom")" == "anthropic/custom" ]] || { echo "passthrough failed"; result=1; } + return $result +} diff --git a/tests/adapters/opencode/adapter.test.sh b/tests/adapters/opencode/adapter.test.sh index ea8c766..d48dc5f 100755 --- a/tests/adapters/opencode/adapter.test.sh +++ b/tests/adapters/opencode/adapter.test.sh @@ -126,7 +126,7 @@ test_oc_translate_agents_basic() { --- name: scribe description: Test scribe -model: sonnet +model: mid mode: subagent capabilities: [read, write, edit] --- @@ -182,7 +182,7 @@ test_oc_translate_agents_bash_capability() { --- name: architect description: Test arch -model: opus +model: high capabilities: [read, write, edit, bash] --- @@ -206,7 +206,7 @@ test_oc_translate_agents_read_only_emits_empty_permission() { --- name: seeker description: Search only -model: sonnet +model: mid capabilities: [read] --- @@ -229,7 +229,7 @@ test_oc_translate_agents_dedupes_edit() { --- name: scribe description: Dedupe test -model: sonnet +model: mid capabilities: [read, write, edit] --- @@ -360,7 +360,7 @@ test_oc_adapter_build_end_to_end() { --- name: scribe description: Test scribe -model: sonnet +model: mid capabilities: [read, write, edit] ---