Repository navigation
Commit dadbbfc
fix(server): report session exits when a provider instance is torn down
Removing or replacing a provider instance (any `providerInstances` settings
edit) closed the instance scope while threads were mid-turn, and the
orchestrator never heard about it: those threads stayed "running" forever.
- CodexSessionRuntime.close emitted `session/closed` and then immediately
`Queue.shutdown` the events queue, which clears buffered messages, so the
exit was dropped before the adapter forwarder took it. End the queue
instead so the consumer drains it.
- CodexAdapter.stopSessionInternal closed the session scope (interrupting
the forwarder) right after `close`; wait for the forwarder to drain first.
Both adapters now end their runtime event queue on release instead of
shutting it down, so already-emitted exits stay readable.
- ProviderInstanceRegistry.reconcile now calls `adapter.stopAll()` before
closing a removed/replaced instance's scope. Adapter finalizers stop
sessions silently on purpose (server shutdown keeps threads resumable);
a settings edit is not a shutdown.
Co-Authored-By: Claude Fable 5.1 <[email protected]>1 parent 9ea9c3d commit dadbbfc
8 files changed
Lines changed: 14412 additions & 14247 deletions
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
0 commit comments