applyPauseEvent advances a session's pause indicator in response to runtime events. The runtime emits a PausedEvent when the loop reaches an iteration boundary and blocks, which flips a pending "Pausing…" state to "Paused". A stream that stops while still "Pausing…" (e.g. the agent happened to finis
(ss *service.SessionState, msg tea.Msg)
| 1244 | // resolved to "Paused", since /pause stays armed for the next run. The arm/ |
| 1245 | // disarm transitions themselves are driven by handleTogglePause. |
| 1246 | func (m *appModel) applyPauseEvent(ss *service.SessionState, msg tea.Msg) { |
| 1247 | if ss == nil { |
| 1248 | return |
| 1249 | } |
| 1250 | switch msg.(type) { |
| 1251 | case *runtime.PausedEvent: |
| 1252 | if ss.PauseState() != service.PauseNone { |
| 1253 | ss.SetPauseState(service.PausePaused) |
| 1254 | } |
| 1255 | case *runtime.StreamStoppedEvent: |
| 1256 | if ss.PauseState() == service.PausePausing { |
| 1257 | ss.SetPauseState(service.PausePaused) |
| 1258 | } |
| 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | // handleWorkingStateChanged updates the editor working indicator and resize handle spinner. |
| 1263 | func (m *appModel) handleWorkingStateChanged(msg messages.WorkingStateChangedMsg) (tea.Model, tea.Cmd) { |
no test coverage detected