Commit 593d7d9
committed
app-server: Replay pending item requests on
Replay pending client requests after `thread/resume` and emit resolved notifications when those requests clear so approval/input UI state stays in sync after reconnects and across subscribed clients.
Affected RPCs:
- `item/commandExecution/requestApproval`
- `item/fileChange/requestApproval`
- `item/tool/requestUserInput`
- `skill/requestApproval`
Motivation:
- Resumed clients need to see pending approval/input requests that were already outstanding before the reconnect.
- Clients also need an explicit signal when a pending request resolves or is cleared so stale UI can be removed on turn start, completion, or interruption.
Implementation notes:
- Track pending client requests in `ThreadState` and replay them after `thread/resume` attaches the connection.
- Reuse the original JSON-RPC request id for replays and resend prerequisite notifications like `item/started` for pending file change approvals.
- Emit `item/commandExecution/approvalResolved`, `item/fileChange/approvalResolved`, `item/tool/requestUserInputResolved`, and `skill/approvalResolved` when pending requests are answered or cleared by lifecycle cleanup.
- Update the app-server protocol schema, generated TypeScript bindings, and README docs for the replay/resolution flow.
High-level test plan:
- Added automated coverage for replaying pending command execution, file change, and skill approval requests on `thread/resume`.
- Added automated coverage for resolved notifications in command approval, file change approval, request_user_input, skill approval, turn start, and turn interrupt flows.
- Verified schema/docs updates in the relevant protocol and app-server tests.
Manual testing:
- Not run.thread/resume
1 parent f86087e commit 593d7d9
File tree
24 files changed
+2095
-206
lines changed- codex-rs
- app-server-protocol
- schema
- json
- v2
- typescript
- v2
- src/protocol
- app-server
- src
- tests/suite/v2
24 files changed
+2095
-206
lines changedLines changed: 151 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
656 | 671 | | |
657 | 672 | | |
658 | 673 | | |
| |||
853 | 868 | | |
854 | 869 | | |
855 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
856 | 886 | | |
857 | 887 | | |
858 | 888 | | |
| |||
1422 | 1452 | | |
1423 | 1453 | | |
1424 | 1454 | | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1425 | 1466 | | |
1426 | 1467 | | |
1427 | 1468 | | |
| |||
1449 | 1490 | | |
1450 | 1491 | | |
1451 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1452 | 1508 | | |
1453 | 1509 | | |
1454 | 1510 | | |
| |||
2592 | 2648 | | |
2593 | 2649 | | |
2594 | 2650 | | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
2595 | 2666 | | |
2596 | 2667 | | |
2597 | 2668 | | |
| |||
3402 | 3473 | | |
3403 | 3474 | | |
3404 | 3475 | | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
3405 | 3496 | | |
3406 | 3497 | | |
3407 | 3498 | | |
| |||
3422 | 3513 | | |
3423 | 3514 | | |
3424 | 3515 | | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
3425 | 3576 | | |
3426 | 3577 | | |
3427 | 3578 | | |
| |||
0 commit comments