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

Function mapStatus

packages/agent-core/src/services/task/task.ts:63–81  ·  view source on GitHub ↗
(s: BackgroundTaskInfo['status'])

Source from the content-addressed store, hash-verified

61}
62
63function mapStatus(s: BackgroundTaskInfo['status']): BackgroundTaskStatus {
64 switch (s) {
65 case 'running':
66 return 'running';
67 case 'completed':
68 return 'completed';
69 case 'failed':
70 return 'failed';
71 case 'timed_out':
72 // SCHEMAS §7 has no 'timed_out' literal; collapse to 'failed'. The
73 // optional `stop_reason`/`last_error` surface would carry the hint
74 // once SCHEMAS adds the field (deferred).
75 return 'failed';
76 case 'killed':
77 return 'cancelled';
78 case 'lost':
79 return 'failed';
80 }
81}
82
83const TERMINAL_WIRE_STATUSES: ReadonlySet<BackgroundTaskStatus> = new Set([
84 'completed',

Callers 1

toProtocolTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected