MCPcopy Index your code
hub / github.com/codeaashu/claude-code / completeAgentTask

Function completeAgentTask

src/tasks/LocalAgentTask/LocalAgentTask.tsx:412–432  ·  view source on GitHub ↗
(result: AgentToolResult, setAppState: SetAppState)

Source from the content-addressed store, hash-verified

410 * Complete an agent task with result.
411 */
412export function completeAgentTask(result: AgentToolResult, setAppState: SetAppState): void {
413 const taskId = result.agentId;
414 updateTaskState<LocalAgentTaskState>(taskId, setAppState, task => {
415 if (task.status !== 'running') {
416 return task;
417 }
418 task.unregisterCleanup?.();
419 return {
420 ...task,
421 status: 'completed',
422 result,
423 endTime: Date.now(),
424 evictAfter: task.retain ? undefined : Date.now() + PANEL_GRACE_MS,
425 abortController: undefined,
426 unregisterCleanup: undefined,
427 selectedAgent: undefined
428 };
429 });
430 void evictTaskOutput(taskId);
431 // Note: Notification is sent by AgentTool via enqueueAgentNotification
432}
433
434/**
435 * Fail an agent task with error.

Callers

nothing calls this directly

Calls 2

evictTaskOutputFunction · 0.85
updateTaskStateFunction · 0.50

Tested by

no test coverage detected