Commit 468cc62
committed
fix: sub-session thinking state derived from child agent, not parent session
When transferring a task to a sub-agent, the child session's thinking
flag was inherited from the parent session via SubSessionConfig.Thinking.
This caused agents without thinking_budget (e.g. haiku) to have thinking
enabled when called from an agent with thinking_budget (e.g. opus).
The thinking state also leaked back to the parent via back-propagation
in runSubSessionForwarding.
Fix this by removing the Thinking field from SubSessionConfig entirely
and deriving it inside newSubSession from childAgent.ThinkingConfigured().
This makes the correct behavior the default and eliminates the
error-prone pattern where every caller had to pass the right source.
For skill sub-agents (which run as the same agent and should respect
the user's /think toggle), the thinking state is set as an explicit
override after newSubSession returns.
Also simplify handleTaskTransfer by removing a redundant agent lookup,
a redundant variable alias, and unnecessary error-swallowing guards.
Assisted-By: docker-agent1 parent 2efd1bb commit 468cc62
3 files changed
Lines changed: 49 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | | - | |
| 111 | + | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
| |||
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | | - | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
| |||
216 | 213 | | |
217 | 214 | | |
218 | 215 | | |
219 | | - | |
220 | 216 | | |
221 | 217 | | |
222 | 218 | | |
| |||
252 | 248 | | |
253 | 249 | | |
254 | 250 | | |
255 | | - | |
256 | | - | |
257 | 251 | | |
258 | | - | |
| 252 | + | |
259 | 253 | | |
260 | 254 | | |
261 | 255 | | |
262 | | - | |
| 256 | + | |
263 | 257 | | |
264 | 258 | | |
265 | | - | |
| 259 | + | |
266 | 260 | | |
267 | 261 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 262 | + | |
271 | 263 | | |
272 | 264 | | |
273 | 265 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | 266 | | |
281 | 267 | | |
282 | 268 | | |
283 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
284 | 273 | | |
285 | 274 | | |
286 | 275 | | |
287 | 276 | | |
288 | 277 | | |
289 | 278 | | |
290 | 279 | | |
291 | | - | |
292 | 280 | | |
293 | 281 | | |
294 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
| 83 | + | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
165 | 198 | | |
166 | 199 | | |
167 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
0 commit comments