MCPcopy Index your code
hub / github.com/coder/coder / shouldBump

Function shouldBump

coderd/agentapi/apps.go:225–243  ·  view source on GitHub ↗
(dbState database.WorkspaceAppStatusState, latestAppStatus database.WorkspaceAppStatus)

Source from the content-addressed store, hash-verified

223}
224
225func 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.

Callers 2

TestShouldBumpFunction · 0.85
UpdateAppStatusMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestShouldBumpFunction · 0.68