Skip to content

Tasks: AI agent activity bumps workspace deadline #1251

Closed
coder/coder
#21584

Description

@mafredri

Repo: coder/coder

Scope: When an AI agent reports certain status changes, extend the workspace deadline to prevent auto-stop during active work.

Note: This implements AI agent activity bump for all workspaces (including task workspaces). Task workspaces use the template's regular default_ttl and activity_bump settings. Task-specific TTL columns may be added post-GA if customer feedback indicates a need for different timeout behavior between regular workspaces and task workspaces.

App status states (from codersdk/workspaceapps.go):

  • working - AI agent actively processing
  • idle - AI agent waiting for input
  • complete - task finished successfully
  • failure - task encountered an error

Changes:

  • Modify patchWorkspaceAgentAppStatus in coderd/workspaceagents.go
  • Call ActivityBumpWorkspace based on previous and new state:
    • complete → idle|complete: NO bump (task already done)
    • failure → idle|failure: NO bump (task already failed)
    • All other transitions: bump (includes working, and transitions from working)

Files:

  • coderd/workspaceagents.go
  • coderd/workspaceagents_test.go

Acceptance criteria:

  • working status triggers deadline bump
  • Transition from working to other states triggers deadline bump
  • complete → idle or complete → complete does NOT trigger bump
  • failure → idle or failure → failure does NOT trigger bump
  • Tests verify bump is called at correct times
  • Existing activity bump behavior (SSH, IDE) unchanged

Dependencies: None

References:

Activity

  1. added theissue type on Jan 15, 2026
  2. self-assigned this
    on Jan 19, 2026
  3. added a commit that references this issue on Jan 20, 2026
    fea2d05
  4. added a commit that references this issue on Jan 22, 2026
    4c7844a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions