feat(categories): add disable field to CategoryConfigSchema

Allow individual categories to be disabled via `disable: true` in
config. Introduce shared `mergeCategories()` utility to centralize
category merging and disabled filtering across all 7 consumption sites.
This commit is contained in:
YeonGyu-Kim
2026-02-11 13:52:06 +09:00
parent 67b4665c28
commit bfe1730e9f
11 changed files with 131 additions and 29 deletions
+4 -9
View File
@@ -1,19 +1,14 @@
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder"
import type { OhMyOpenCodeConfig } from "../config"
import {
CATEGORY_DESCRIPTIONS,
DEFAULT_CATEGORIES,
} from "../tools/delegate-task/constants"
import { CATEGORY_DESCRIPTIONS } from "../tools/delegate-task/constants"
import { mergeCategories } from "../shared/merge-categories"
export function createAvailableCategories(
pluginConfig: OhMyOpenCodeConfig,
): AvailableCategory[] {
const mergedCategories = pluginConfig.categories
? { ...DEFAULT_CATEGORIES, ...pluginConfig.categories }
: DEFAULT_CATEGORIES
const categories = mergeCategories(pluginConfig.categories)
return Object.entries(mergedCategories).map(([name, categoryConfig]) => {
return Object.entries(categories).map(([name, categoryConfig]) => {
const model =
typeof categoryConfig.model === "string" ? categoryConfig.model : undefined