authorgravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-02-19 04:07:33-08:00
committergravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-02-19 04:07:33-08:00
log2c9121553eabb3078cc77e672ad20d3323c53aa5
tree9b352abedfc4b0e91e9edb4ad1d4f283c0b8ede5
parent48bf123d0c44707f328039954a03e93488b3a70e
signature Commit is signed but in an unrecognized format.

restore streaming notifications from codex app server


2 files changed, 0 insertions(+), 108 deletions(-)

apps/server/src/codexAppServerManager.test.ts-91
......@@ -350,94 +350,3 @@ describe("thread checkpoint control", () => {
350350 });
351351 });
352352});
353
354describe("notification forwarding", () => {
355 it("suppresses streamed assistant message notifications", () => {
356 const manager = new CodexAppServerManager();
357 const emittedMethods: string[] = [];
358 manager.on("event", (event) => {
359 emittedMethods.push(event.method);
360 });
361
362 const context = {
363 session: {
364 sessionId: "sess_1",
365 provider: "codex",
366 status: "running",
367 threadId: "thread_1",
368 createdAt: "2026-02-10T00:00:00.000Z",
369 updatedAt: "2026-02-10T00:00:00.000Z",
370 },
371 };
372
373 const handleServerNotification = (
374 manager as unknown as {
375 handleServerNotification: (
376 context: unknown,
377 notification: { method: string; params?: unknown },
378 ) => void;
379 }
380 ).handleServerNotification.bind(manager);
381
382 handleServerNotification(context, {
383 method: "item/agentMessage/delta",
384 params: {
385 itemId: "item_msg_1",
386 delta: "Partial text",
387 },
388 });
389 handleServerNotification(context, {
390 method: "item/started",
391 params: {
392 item: {
393 id: "item_msg_1",
394 type: "agentMessage",
395 text: "Working...",
396 },
397 },
398 });
399
400 expect(emittedMethods).toEqual([]);
401 });
402
403 it("keeps completed assistant message notifications", () => {
404 const manager = new CodexAppServerManager();
405 const emittedMethods: string[] = [];
406 manager.on("event", (event) => {
407 emittedMethods.push(event.method);
408 });
409
410 const context = {
411 session: {
412 sessionId: "sess_1",
413 provider: "codex",
414 status: "running",
415 threadId: "thread_1",
416 createdAt: "2026-02-10T00:00:00.000Z",
417 updatedAt: "2026-02-10T00:00:00.000Z",
418 },
419 };
420
421 const handleServerNotification = (
422 manager as unknown as {
423 handleServerNotification: (
424 context: unknown,
425 notification: { method: string; params?: unknown },
426 ) => void;
427 }
428 ).handleServerNotification.bind(manager);
429
430 handleServerNotification(context, {
431 method: "item/completed",
432 params: {
433 item: {
434 id: "item_msg_1",
435 type: "agentMessage",
436 text: "Final response",
437 },
438 },
439 });
440
441 expect(emittedMethods).toEqual(["item/completed"]);
442 });
443});
apps/server/src/codexAppServerManager.ts-17
......@@ -584,10 +584,6 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve
584584 context: CodexSessionContext,
585585 notification: JsonRpcNotification,
586586 ): void {
587 if (this.shouldSuppressNotification(notification)) {
588 return;
589 }
590
591587 const route = this.readRouteFields(notification.params);
592588 const textDelta =
593589 notification.method === "item/agentMessage/delta"
......@@ -648,19 +644,6 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve
648644 }
649645 }
650646
651 private shouldSuppressNotification(notification: JsonRpcNotification): boolean {
652 if (notification.method === "item/agentMessage/delta") {
653 return true;
654 }
655
656 if (notification.method !== "item/started") {
657 return false;
658 }
659
660 const itemType = this.readString(this.readObject(notification.params, "item"), "type");
661 return itemType === "agentMessage";
662 }
663
664647 private handleServerRequest(context: CodexSessionContext, request: JsonRpcRequest): void {
665648 const route = this.readRouteFields(request.params);
666649 const requestKind = this.requestKindForMethod(request.method);