fix(delegate-task): validate description parameter and handle undefined in notifications
OpenCode's fromPlugin wrapper skips Zod validation for plugin tools, so LLMs can omit required args like description without getting an error. When Atlas orchestrates and the model omits description, it flows through as undefined to manager.launch() and background task notifications show 'undefined' for all completed tasks. Two fixes: - Add runtime validation for description in delegate-task tool (matches existing run_in_background and load_skills validation pattern) - Defensive fallback in notification template: use task ID when description is missing instead of rendering 'undefined'
This commit is contained in:
@@ -122,6 +122,9 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini
|
||||
title: args.description,
|
||||
})
|
||||
|
||||
if (!args.description || typeof args.description !== "string") {
|
||||
throw new Error(`Invalid arguments: 'description' parameter is REQUIRED. Provide a short (3-5 words) task description.`)
|
||||
}
|
||||
if (args.run_in_background === undefined) {
|
||||
throw new Error(`Invalid arguments: 'run_in_background' parameter is REQUIRED. Specify run_in_background=false for task delegation, or run_in_background=true for parallel exploration.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user