Skip to content

App buttons are clickable during agent 'connecting' state #21954

@han-steve

Description

@han-steve

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

During workspace startup, app buttons (VS Code, Cursor, Terminal, custom apps) appear clickable while the agent is still in "connecting" state, such as when the k8s pod is still spinning up. Clicking them fails because the agent hasn't established its connection yet. This creates a confusing UX.

Relevant Log Output

Expected Behavior

Before the agent connects, the Terminal/VS Code buttons should be disabled.

AgentRow.tsx (lines 67-69)

const shouldDisplayAgentApps =    (agent.status === "connected" && hasAppsToDisplay) ||
    (agent.status === "connecting" && !isExternalAgent); 

AppLink.tsx
canClick defaults to true and only checks agent.lifecycle_state but NOT agent.status. These are different:
status: connecting | connected | disconnected | timeout (connection state)
lifecycle_state: created | starting | ready | etc. (startup script state)

Steps to Reproduce

  1. Create a k8s template following https://registry.coder.com/templates/coder/kubernetes
  2. Create a workspace with a large container image (takes several minutes to pull)
  3. App buttons (Cursor, VS Code, Terminal, etc.) appear clickable
  4. Click any button - connection fails
  5. Wait for agent to connect - buttons turn grey momentarily
  6. Wait for startup script to complete - buttons become clickable again and they work now

Environment

  • Host OS: Ubuntu 24.04
  • Coder version: v2.29.3

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue that require triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions