Skip to content

feat(workspace): log workspace and agent state changes - #1075

Open
aqandrew wants to merge 1 commit into
aqandrew/devex-661-session-id-requestsfrom
aqandrew/devex-661-connection-state-logs
Open

feat(workspace): log workspace and agent state changes#1075
aqandrew wants to merge 1 commit into
aqandrew/devex-661-session-id-requestsfrom
aqandrew/devex-661-connection-state-logs

Conversation

@aqandrew

@aqandrew aqandrew commented Aug 11, 2026

Copy link
Copy Markdown

closes DEVEX-666

What

Add info-level logging of workspace, agent, and lifecycle status transitions so
connection debugging has a record of state changes — correlated by the session
ID from #1073.

This is Phase 3 of 3 for
DEVEX-661 (RFC req 7). It builds
on #1074.

Changes

  • Add WorkspaceStateLogger (src/workspace/workspaceStateLogger.ts), which
    logs at info when a workspace's status, an agent's status, or an agent's
    lifecycle state changes, including the workspace name and old → new values.
    State is tracked per agent (keyed by agent ID) since a workspace can have
    several.
  • Wire it into WorkspaceMonitor.update(), alongside the existing telemetry
    observer, so transitions observed while tracking a workspace are recorded.

Testing

  • pnpm typecheck, targeted pnpm lint, full pnpm test:extension (2108
    passing).
  • New unit tests: logs the initial state, logs transitions, stays silent when
    nothing changes, handles the no-agent case, and tracks agents independently.

🤖 Generated by Coder Agents.

@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

DEVEX-661

DEVEX-666

@aqandrew
aqandrew force-pushed the aqandrew/devex-661-connection-state-logs branch from a1a27aa to 163a89b Compare August 12, 2026 22:00
@aqandrew
aqandrew requested review from EhabY and code-asher August 12, 2026 22:35
@aqandrew
aqandrew force-pushed the aqandrew/devex-661-connection-state-logs branch from 163a89b to 082b4bb Compare August 13, 2026 00:40
* several. Construct one per workspace; `WorkspaceMonitor` is the sole call
* site.
*/
export class WorkspaceStateLogger {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are lots of similarities between this and WorkspaceStateTelemetry, I suppose one is tracking the workspace states and one is tracking the agent states?

Comment on lines +63 to +65
previous?.workspaceStatus === next.workspaceStatus &&
previous?.agentStatus === next.agentStatus &&
previous?.lifecycleState === next.lifecycleState

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO I think we should log once for each workspace state change (basically what the workspace telemetry does) and independently track the agent state since they could be independent

@aqandrew
aqandrew force-pushed the aqandrew/devex-661-connection-state-logs branch from 082b4bb to 163a89b Compare August 13, 2026 18:46
Add WorkspaceStateLogger, which logs workspace, agent, and lifecycle
status transitions at info level with the old and new values. Wire it
into WorkspaceMonitor so state changes observed while tracking a
workspace are recorded (tagged with the session ID) for connection
debugging.
@aqandrew
aqandrew force-pushed the aqandrew/devex-661-connection-state-logs branch from 163a89b to d29fcbd Compare August 13, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants