Commit 7310091
Register sessions before RPC to prevent dropped events
Register sessions in the client's sessions map before issuing the
session.create and session.resume RPC calls, so that events emitted
by the CLI during the RPC (e.g. session.start, permission requests,
tool calls) are not dropped. Previously, sessions were registered
only after the RPC completed, creating a window where notifications
for the session had no target.
The session ID is now generated client-side (via UUID) rather than
extracted from the server response. On RPC failure, the session is
cleaned up from the map.
Changes across all four SDKs (Node.js, Python, Go, .NET):
- Generate sessionId client-side before the RPC
- Create and register the session in the sessions map before the RPC
- Set workspacePath from the RPC response after it completes
- Remove the session from the map if the RPC fails
Includes unit tests for Node.js, Python, and Go that verify:
- Session is in the map when session.create RPC is called
- Session is in the map when session.resume RPC is called
- Session is cleaned up from map on RPC failure (create and resume)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 427205f commit 7310091
File tree
74 files changed
+873
-196
lines changed- dotnet/src
- go
- internal/e2e
- nodejs
- src
- test
- python
- copilot
- test/scenarios
- auth
- byok-anthropic/go
- byok-azure/go
- byok-ollama/go
- byok-openai/go
- gh-app/go
- bundling
- app-backend-to-server/go
- app-direct-server/go
- container-proxy/go
- fully-bundled/go
- callbacks
- hooks/go
- permissions/go
- user-input/go
- modes
- default/go
- minimal/go
- prompts
- attachments/go
- reasoning-effort/go
- system-message/go
- sessions
- concurrent-sessions/go
- infinite-sessions/go
- session-resume/go
- streaming/go
- tools
- custom-agents/go
- mcp-servers/go
- no-tools/go
- skills/go
- tool-filtering/go
- tool-overrides/go
- virtual-filesystem/go
- transport
- reconnect/go
- stdio/go
- tcp/go
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
74 files changed
+873
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
411 | 389 | | |
412 | 390 | | |
413 | 391 | | |
| |||
418 | 396 | | |
419 | 397 | | |
420 | 398 | | |
| 399 | + | |
421 | 400 | | |
422 | | - | |
| 401 | + | |
423 | 402 | | |
424 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
| |||
472 | 482 | | |
473 | 483 | | |
474 | 484 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
503 | 488 | | |
504 | 489 | | |
505 | 490 | | |
| |||
510 | 495 | | |
511 | 496 | | |
512 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
513 | 536 | | |
514 | | - | |
515 | | - | |
516 | 537 | | |
517 | 538 | | |
518 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
487 | | - | |
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| |||
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
528 | 524 | | |
| 525 | + | |
529 | 526 | | |
530 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
531 | 530 | | |
532 | 531 | | |
533 | 532 | | |
| |||
539 | 538 | | |
540 | 539 | | |
541 | 540 | | |
542 | | - | |
| 541 | + | |
543 | 542 | | |
544 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
545 | 562 | | |
546 | 563 | | |
547 | 564 | | |
| |||
616 | 633 | | |
617 | 634 | | |
618 | 635 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
628 | 639 | | |
629 | | - | |
630 | 640 | | |
631 | 641 | | |
632 | 642 | | |
| |||
637 | 647 | | |
638 | 648 | | |
639 | 649 | | |
640 | | - | |
| 650 | + | |
641 | 651 | | |
642 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
643 | 671 | | |
644 | 672 | | |
645 | 673 | | |
| |||
0 commit comments