Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: suppress codex commentary output in ACP wrapper

Lyric 09343342 e33e74a2

+36
+29
wrappers/acp/codex/src/lib.mjs
··· 169 169 }; 170 170 } 171 171 172 + export function shouldEmitAgentMessagePhase(phase) { 173 + const normalized = normalizeString(phase).toLowerCase(); 174 + if (normalized === "commentary") { 175 + return false; 176 + } 177 + return true; 178 + } 179 + 172 180 export class CodexAppServerClient { 173 181 constructor(options = {}) { 174 182 this.command = ··· 467 475 cwd, 468 476 options, 469 477 pendingTurn: null, 478 + itemPhases: new Map(), 470 479 }); 471 480 472 481 return { ··· 560 569 } 561 570 562 571 if (method === "item/agentMessage/delta") { 572 + const phase = session.itemPhases.get(normalizeString(params.itemId)); 573 + if (!shouldEmitAgentMessagePhase(phase)) { 574 + return; 575 + } 563 576 const delta = normalizeString(params.delta); 564 577 if (delta !== "") { 565 578 this.#notifySessionUpdate(session.sessionId, { ··· 571 584 } 572 585 573 586 if (method === "item/started") { 587 + this.#rememberItemPhase(session, params.item); 574 588 const update = buildToolStartUpdate(params.item); 575 589 if (update) { 576 590 this.#notifySessionUpdate(session.sessionId, update); ··· 591 605 } 592 606 593 607 if (method === "item/completed") { 608 + this.#rememberItemPhase(session, params.item); 594 609 const update = buildToolDoneUpdate(params.item); 595 610 if (update) { 596 611 this.#notifySessionUpdate(session.sessionId, update); ··· 664 679 update, 665 680 }, 666 681 }); 682 + } 683 + 684 + #rememberItemPhase(session, item) { 685 + if (!session || !isRecord(item)) { 686 + return; 687 + } 688 + if (normalizeString(item.type) !== "agentMessage") { 689 + return; 690 + } 691 + const itemID = normalizeString(item.id); 692 + if (itemID === "") { 693 + return; 694 + } 695 + session.itemPhases.set(itemID, normalizeString(item.phase)); 667 696 } 668 697 669 698 #getSession(sessionId) {
+7
wrappers/acp/codex/test/lib.test.mjs
··· 8 8 collectACPText, 9 9 mapTurnOutcome, 10 10 normalizeSessionOptions, 11 + shouldEmitAgentMessagePhase, 11 12 } from "../src/lib.mjs"; 12 13 13 14 test("normalizeSessionOptions supports snake_case keys and defaults", () => { ··· 83 84 assert.equal(done.sessionUpdate, "tool_call_update"); 84 85 assert.equal(done.status, "completed"); 85 86 }); 87 + 88 + test("shouldEmitAgentMessagePhase suppresses commentary", () => { 89 + assert.equal(shouldEmitAgentMessagePhase("commentary"), false); 90 + assert.equal(shouldEmitAgentMessagePhase("final_answer"), true); 91 + assert.equal(shouldEmitAgentMessagePhase(""), true); 92 + });