(dbState database.WorkspaceAppStatusState, latestAppStatus database.WorkspaceAppStatus)
| 223 | } |
| 224 | |
| 225 | func shouldBump(dbState database.WorkspaceAppStatusState, latestAppStatus database.WorkspaceAppStatus) bool { |
| 226 | // Bump deadline when agent reports working or transitions away from working. |
| 227 | // This prevents auto-pause during active work and gives users time to interact |
| 228 | // after work completes. |
| 229 | |
| 230 | // Bump if reporting working state. |
| 231 | if dbState == database.WorkspaceAppStatusStateWorking { |
| 232 | return true |
| 233 | } |
| 234 | |
| 235 | // Bump if transitioning away from working state. |
| 236 | if latestAppStatus.ID != uuid.Nil { |
| 237 | prevState := latestAppStatus.State |
| 238 | if prevState == database.WorkspaceAppStatusStateWorking { |
| 239 | return true |
| 240 | } |
| 241 | } |
| 242 | return false |
| 243 | } |
| 244 | |
| 245 | // enqueueAITaskStateNotification enqueues a notification when an AI task's app |
| 246 | // transitions to Working or Idle. |
no outgoing calls