refactor(delegate-task): improve session title format and add task_metadata block
- Change session title from 'Task: {desc}' to '{desc} (@{agent} subagent)'
- Move session_id to structured <task_metadata> block for better parsing
- Add category tracking to BackgroundTask type and LaunchInput
- Add tests for new title format and metadata block
This commit is contained in:
@@ -138,6 +138,7 @@ export class BackgroundManager {
|
||||
parentModel: input.parentModel,
|
||||
parentAgent: input.parentAgent,
|
||||
model: input.model,
|
||||
category: input.category,
|
||||
}
|
||||
|
||||
this.tasks.set(task.id, task)
|
||||
@@ -231,7 +232,7 @@ export class BackgroundManager {
|
||||
const createResult = await this.client.session.create({
|
||||
body: {
|
||||
parentID: input.parentSessionID,
|
||||
title: `Background: ${input.description}`,
|
||||
title: `${input.description} (@${input.agent} subagent)`,
|
||||
permission: [
|
||||
{ permission: "question", action: "deny" as const, pattern: "*" },
|
||||
],
|
||||
|
||||
@@ -38,6 +38,8 @@ export interface BackgroundTask {
|
||||
parentAgent?: string
|
||||
/** Marks if the task was launched from an unstable agent/category */
|
||||
isUnstableAgent?: boolean
|
||||
/** Category used for this task (e.g., 'quick', 'visual-engineering') */
|
||||
category?: string
|
||||
|
||||
/** Last message count for stability detection */
|
||||
lastMsgCount?: number
|
||||
@@ -57,6 +59,7 @@ export interface LaunchInput {
|
||||
isUnstableAgent?: boolean
|
||||
skills?: string[]
|
||||
skillContent?: string
|
||||
category?: string
|
||||
}
|
||||
|
||||
export interface ResumeInput {
|
||||
|
||||
Reference in New Issue
Block a user