fix(delegate-task): reject stray backend-style categories

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-31 13:05:44 -07:00
parent 68ae9dca4b
commit 1d0135b230
6 changed files with 103 additions and 4 deletions
+16 -2
View File
@@ -45,12 +45,26 @@ export async function resolveCategoryExecution(
): Promise<CategoryResolutionResult> {
const { client, userCategories, sisyphusJuniorModel } = executorCtx
const availableModels = await getAvailableModelsForDelegateTask(client)
const categoryName = args.category!
const enabledCategories = mergeCategories(userCategories)
const categoryExists = enabledCategories[categoryName] !== undefined
if (!categoryExists) {
const allCategoryNames = Object.keys(enabledCategories).join(", ")
return {
agentToUse: "",
categoryModel: undefined,
categoryPromptAppend: undefined,
maxPromptTokens: undefined,
modelInfo: undefined,
actualModel: undefined,
isUnstableAgent: false,
error: `Unknown category: "${categoryName}". Available: ${allCategoryNames}`,
}
}
const availableModels = await getAvailableModelsForDelegateTask(client)
const resolved = resolveCategoryConfig(categoryName, {
userCategories,
inheritedModel,