Commit 5ca63ba
committed
Centralize model-change TUI notification in the main loop
Add a change-detection mechanism (lastEmittedModelID + emitModelInfo
closure) in RunStream that automatically emits AgentInfo only when the
effective model actually changes. This is checked before and after each
LLM call, covering per-tool overrides, fallback, model picker, cooldowns,
and any future model-switching feature — without each one having to
remember to notify the TUI.
- loop.go: replace 3 scattered manual AgentInfo emissions with
emitModelInfo calls driven by the closure
- model_picker.go: remove AgentInfo emission from the tool handler;
rename setModelAndEmitInfo to setCurrentAgentModel (no longer emits)
- agent_delegation.go: use getEffectiveModelID instead of getAgentModelID
so agent-switch events reflect active fallback cooldowns
Assisted-By: docker-agent1 parent 8bf7424 commit 5ca63ba
3 files changed
Lines changed: 34 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | | - | |
102 | | - | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
247 | 259 | | |
248 | 260 | | |
249 | 261 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
254 | 265 | | |
255 | 266 | | |
256 | 267 | | |
| |||
325 | 336 | | |
326 | 337 | | |
327 | 338 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
332 | 343 | | |
333 | 344 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 345 | + | |
338 | 346 | | |
| 347 | + | |
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 74 | | |
80 | 75 | | |
81 | 76 | | |
| |||
0 commit comments