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

Function backgroundTask

apps/kimi-code/test/tui/message-replay.test.ts:261–289  ·  view source on GitHub ↗
(
  taskId: string,
  description: string,
  status: BackgroundTaskInfo['status'] = 'running',
)

Source from the content-addressed store, hash-verified

259}
260
261function backgroundTask(
262 taskId: string,
263 description: string,
264 status: BackgroundTaskInfo['status'] = 'running',
265): BackgroundTaskInfo {
266 if (taskId.startsWith('agent-')) {
267 return {
268 taskId,
269 kind: 'agent',
270 agentId: taskId,
271 subagentType: 'coder',
272 description,
273 status,
274 startedAt: 1,
275 endedAt: status === 'running' ? null : 2,
276 };
277 }
278 return {
279 taskId,
280 kind: 'process',
281 command: `[agent] ${description}`,
282 description,
283 status,
284 pid: 0,
285 exitCode: status === 'completed' ? 0 : null,
286 startedAt: 1,
287 endedAt: status === 'running' ? null : 2,
288 };
289}
290
291describe('KimiTUI resume message replay', () => {
292 it('does not render legacy goal completion context reminders as transcript messages', async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected