refactor(delegate-task): restructure category system for unbiased model selection

- Remove temperature from all categories
- Consolidate CATEGORY_MODEL_CATALOG into DEFAULT_CATEGORIES
- Replace 'general' and 'most-capable' with 'unspecified-low' and 'unspecified-high'
- Add Selection_Gate to unspecified categories to force deliberate selection
- Update quick category to use claude-haiku-4-5
- Update all references and tests across codebase
This commit is contained in:
justsisyphus
2026-01-20 16:22:53 +09:00
parent 2c3f1bfd80
commit 8cc995891e
9 changed files with 82 additions and 135 deletions
+8 -9
View File
@@ -325,7 +325,7 @@ describe("migrateAgentConfigToCategory", () => {
{ model: "anthropic/claude-sonnet-4-5" },
]
const expectedCategories = ["visual-engineering", "ultrabrain", "quick", "most-capable", "general"]
const expectedCategories = ["visual-engineering", "ultrabrain", "quick", "unspecified-high", "unspecified-low"]
// #when: Migrate each config
const results = configs.map(migrateAgentConfigToCategory)
@@ -385,10 +385,9 @@ describe("shouldDeleteAgentConfig", () => {
test("returns true when all fields match category defaults", () => {
// #given: Config with fields matching category defaults
// Note: DEFAULT_CATEGORIES only has temperature, not model
const config = {
category: "visual-engineering",
temperature: 0.7,
model: "google/gemini-3-pro-preview",
}
// #when: Check if config should be deleted
@@ -399,10 +398,10 @@ describe("shouldDeleteAgentConfig", () => {
})
test("returns false when fields differ from category defaults", () => {
// #given: Config with custom temperature override
// #given: Config with custom model override
const config = {
category: "visual-engineering",
temperature: 0.9, // Different from default (0.7)
model: "anthropic/claude-opus-4-5",
}
// #when: Check if config should be deleted
@@ -415,10 +414,10 @@ describe("shouldDeleteAgentConfig", () => {
test("handles different categories with their defaults", () => {
// #given: Configs for different categories
const configs = [
{ category: "ultrabrain", temperature: 0.1 },
{ category: "quick", temperature: 0.3 },
{ category: "most-capable", temperature: 0.1 },
{ category: "general", temperature: 0.3 },
{ category: "ultrabrain" },
{ category: "quick" },
{ category: "unspecified-high" },
{ category: "unspecified-low" },
]
// #when: Check each config
+3 -3
View File
@@ -52,7 +52,7 @@ export const HOOK_NAME_MAP: Record<string, string> = {
* from explicit model configs to category-based configs.
*
* DO NOT add new entries here. New agents should use:
* - Category-based config (preferred): { category: "most-capable" }
* - Category-based config (preferred): { category: "unspecified-high" }
* - Or inherit from OpenCode's config.model
*
* This map will be removed in a future major version once migration period ends.
@@ -61,8 +61,8 @@ export const MODEL_TO_CATEGORY_MAP: Record<string, string> = {
"google/gemini-3-pro-preview": "visual-engineering",
"openai/gpt-5.2": "ultrabrain",
"anthropic/claude-haiku-4-5": "quick",
"anthropic/claude-opus-4-5": "most-capable",
"anthropic/claude-sonnet-4-5": "general",
"anthropic/claude-opus-4-5": "unspecified-high",
"anthropic/claude-sonnet-4-5": "unspecified-low",
}
export function migrateAgentNames(agents: Record<string, unknown>): { migrated: Record<string, unknown>; changed: boolean } {