Commit a73424e
committed
fix: decouple elicitation channel from ToolsApproved flag
The elicitation events channel was guarded by ToolsApproved, which meant
sessions with ToolsApproved=true (serve mcp, serve a2a, background agents,
delegated sub-sessions) could never handle elicitation requests, always
failing with 'no events channel available for elicitation'.
Replace the set/clear pattern with a save/restore pattern: every RunStream
call now unconditionally sets its events channel as the elicitation target,
saving the previous one. On teardown it restores the previous channel
instead of clearing to nil. This correctly handles nested RunStream calls
(sub-sessions, background agents) without losing the parent's channel.
Assisted-By: docker-agent1 parent ebd216e commit a73424e
2 files changed
Lines changed: 22 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
80 | 77 | | |
81 | 78 | | |
82 | 79 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
91 | 85 | | |
92 | 86 | | |
93 | 87 | | |
| |||
120 | 114 | | |
121 | 115 | | |
122 | 116 | | |
123 | | - | |
| 117 | + | |
124 | 118 | | |
125 | 119 | | |
126 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
998 | 998 | | |
999 | 999 | | |
1000 | 1000 | | |
1001 | | - | |
1002 | | - | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
1003 | 1006 | | |
1004 | 1007 | | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
1013 | 1011 | | |
1014 | 1012 | | |
1015 | 1013 | | |
| |||
1018 | 1016 | | |
1019 | 1017 | | |
1020 | 1018 | | |
1021 | | - | |
| 1019 | + | |
1022 | 1020 | | |
1023 | 1021 | | |
1024 | 1022 | | |
| |||
0 commit comments