Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/types/src/vscode-extension-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ export type ExtensionState = Pick<
openAiCodexIsAuthenticated?: boolean
debug?: boolean

/** Background tasks status for the UI panel */
backgroundTasks?: BackgroundTaskStatusInfo[]

/**
* Monotonically increasing sequence number for clineMessages state pushes.
* When present, the frontend should only apply clineMessages from a state push
Expand All @@ -346,6 +349,21 @@ export type ExtensionState = Pick<
clineMessagesSeq?: number
}

/**
* Status of a background task as exposed to the webview UI.
*/
export interface BackgroundTaskStatusInfo {
taskId: string
parentTaskId: string
status: "running" | "completed" | "cancelled" | "timed_out" | "error"
startedAt: number
completedAt?: number
/** Short summary of the result (from attempt_completion) */
resultSummary?: string
/** The mode slug the background task was running in */
mode?: string
}

export interface Command {
name: string
source: "global" | "project" | "built-in"
Expand Down Expand Up @@ -514,6 +532,8 @@ export interface WebviewMessage {
| "createWorktreeInclude"
| "checkoutBranch"
| "browseForWorktreePath"
// Background task messages
| "cancelBackgroundTask"
// Skills messages
| "requestSkills"
| "createSkill"
Expand Down
8 changes: 7 additions & 1 deletion src/core/prompts/tools/native-tools/new_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const MESSAGE_PARAMETER_DESCRIPTION = `Initial user instructions or context for

const TODOS_PARAMETER_DESCRIPTION = `Optional initial todo list written as a markdown checklist; required when the workspace mandates todos`

const BACKGROUND_PARAMETER_DESCRIPTION = `When set to "true", the task runs in the background concurrently with the current task. Background tasks are restricted to read-only tools only (read_file, list_files, search_files, codebase_search). Results are delivered asynchronously when the background task completes. Use for research, analysis, or documentation lookup while continuing other work.`

export default {
type: "function",
function: {
Expand All @@ -31,8 +33,12 @@ export default {
type: ["string", "null"],
description: TODOS_PARAMETER_DESCRIPTION,
},
background: {
type: ["string", "null"],
description: BACKGROUND_PARAMETER_DESCRIPTION,
},
},
required: ["mode", "message", "todos"],
required: ["mode", "message", "todos", "background"],
additionalProperties: false,
},
},
Expand Down
Loading
Loading