@devries-cameron20 / t3code Mirror · read-only / commits / 2c9121553e
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 17:15 UTC

restore streaming notifications from codex app server

Theo Browne committed Feb 19, 2026 at 04:07 UTC 2c9121553eabb3078cc77e672ad20d3323c53aa5
2 files changed -108
apps/server/src/codexAppServerManager.test.ts
-91
@@ -350,94 +350,3 @@ describe("thread checkpoint control", () => {
350 });
351 });
352 });
353 -
354 -describe("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
584 context: CodexSessionContext,
585 notification: JsonRpcNotification,
586 ): void {
587 - if (this.shouldSuppressNotification(notification)) {
588 - return;
589 - }
590 -
587 const route = this.readRouteFields(notification.params);
588 const textDelta =
589 notification.method === "item/agentMessage/delta"
@@ -648,19 +644,6 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve
644 }
645 }
646
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 -
647 private handleServerRequest(context: CodexSessionContext, request: JsonRpcRequest): void {
648 const route = this.readRouteFields(request.params);
649 const requestKind = this.requestKindForMethod(request.method);