MCPcopy
hub / github.com/openai/codex-plugin-cc / describeCompletedItem

Function describeCompletedItem

plugins/codex/scripts/lib/codex.mjs:271–300  ·  view source on GitHub ↗
(state, item)

Source from the content-addressed store, hash-verified

269}
270
271function describeCompletedItem(state, item) {
272 switch (item.type) {
273 case "commandExecution": {
274 const exitCode = item.exitCode ?? "?";
275 const statusLabel = item.status === "completed" ? "completed" : item.status;
276 return {
277 message: `Command ${statusLabel}: ${shorten(item.command, 96)} (exit ${exitCode})`,
278 phase: looksLikeVerificationCommand(item.command) ? "verifying" : "running"
279 };
280 }
281 case "fileChange":
282 return { message: `File changes ${item.status}.`, phase: "editing" };
283 case "mcpToolCall":
284 return { message: `Tool ${item.server}/${item.tool} ${item.status}.`, phase: "investigating" };
285 case "dynamicToolCall":
286 return { message: `Tool ${item.tool} ${item.status}.`, phase: "investigating" };
287 case "collabAgentToolCall": {
288 const subagents = (item.receiverThreadIds ?? []).map((threadId) => labelForThread(state, threadId) ?? threadId);
289 const summary =
290 subagents.length > 0
291 ? `Subagent ${subagents.join(", ")} ${item.status}.`
292 : `Collaboration tool ${item.tool} ${item.status}.`;
293 return { message: summary, phase: "investigating" };
294 }
295 case "exitedReviewMode":
296 return { message: "Reviewer finished.", phase: "finalizing" };
297 default:
298 return null;
299 }
300}
301
302/** @returns {TurnCaptureState} */
303function createTurnCaptureState(threadId, options = {}) {

Callers 1

applyTurnNotificationFunction · 0.85

Calls 3

labelForThreadFunction · 0.85
shortenFunction · 0.70

Tested by

no test coverage detected