feat(coderd): return log snapshot for paused tasks by mafredri · Pull Request #21771 · coder/coder

@mafredri

Previously the task logs endpoint only worked when the workspace was
running, leaving users unable to view task history after pausing.

This change adds snapshot retrieval with state-based branching: active
tasks fetch live logs from AgentAPI, paused/initializing/pending tasks
return stored snapshots (providing continuity during pause/resume), and
error/unknown states return HTTP 409 Conflict.

The response includes snapshot metadata (snapshot, snapshot_at) to
indicate whether logs are live or historical.

Closes coder/internal#1254

@mafredri mafredri marked this pull request as ready for review

January 30, 2026 08:53

johnstcn

johnstcn

@mafredri

@mafredri mafredri deleted the mafredri/feat-coderd-return-log-snapshot-for-paused-task branch

January 30, 2026 14:09