MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / agentTask

Function agentTask

packages/agent-core/test/agent/background/helpers.ts:70–92  ·  view source on GitHub ↗
(
  completion: Promise<{ result: string }>,
  description: string,
  options: {
    readonly agentId?: string;
    readonly subagentType?: string;
    readonly subagentHost?: Pick<SessionSubagentHost, 'markActiveChildDetached'>;
    readonly abortController?: AbortController;
  } = {},
)

Source from the content-addressed store, hash-verified

68}
69
70export function agentTask(
71 completion: Promise<{ result: string }>,
72 description: string,
73 options: {
74 readonly agentId?: string;
75 readonly subagentType?: string;
76 readonly subagentHost?: Pick<SessionSubagentHost, 'markActiveChildDetached'>;
77 readonly abortController?: AbortController;
78 } = {},
79): AgentBackgroundTask {
80 const handle: SubagentHandle = {
81 agentId: options.agentId ?? 'agent-child',
82 profileName: options.subagentType ?? 'coder',
83 resumed: false,
84 completion,
85 };
86 return new AgentBackgroundTask(
87 handle,
88 description,
89 options.subagentHost ?? { markActiveChildDetached: vi.fn() },
90 options.abortController ?? new AbortController(),
91 );
92}
93
94export async function waitForTerminal(
95 manager: BackgroundManager,

Callers 8

agent.test.tsFile · 0.90
task-tools.test.tsFile · 0.90
rpc-events.test.tsFile · 0.90
manager.test.tsFile · 0.90
ids.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected