fix(delegate-task): align metadata with opencode core task tool

Match opencode core 'task' tool behavior for metadata consistency:

1. Model fallback: When categoryModel/task.model/resumeModel is undefined,

   fall back to parentContext.model so subagent metadata always includes

   model info. Thread parentContext into executeSyncContinuation for parity.

2. Task ID consistency: unstable-agent-task was missing taskId and

   backgroundTaskId in metadata. background_output used inconsistent

   snake_case 'task_id' vs camelCase 'taskId' elsewhere. Standardize on

   camelCase: taskId = sessionID (resume id), backgroundTaskId = bg task id.

Update text output blocks to use buildTaskMetadataBlock helper.

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-04-17 14:42:38 +09:00
parent 3a656136b6
commit 2892ca4adf
11 changed files with 445 additions and 30 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini
if (runInBackground) {
return executeBackgroundContinuation(args, ctx, options, parentContext)
}
return executeSyncContinuation(args, ctx, options)
return executeSyncContinuation(args, ctx, options, parentContext)
}
if (!args.category && !args.subagent_type) {