| ... | @@ -350,94 +350,3 @@ describe("thread checkpoint control", () => { | ... | @@ -350,94 +350,3 @@ describe("thread checkpoint control", () => { |
| 350 | }); | 350 | }); |
| 351 | }); | 351 | }); |
| 352 | }); | 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 | }); | | |