Skip to content

fix(provisioner/terraform): hasExternalAgentResources has same count=0 false-positive as hasAITaskResources #1536

@35C4n0r

Description

@35C4n0r

Description

hasExternalAgentResources in provisioner/terraform/resources.go scans Terraform graph DOT output for coder_external_agent node labels, returning true regardless of count. This is the same class of bug fixed for hasAITaskResources in coder/coder#25197.

A template with coder_external_agent at count = 0 will incorrectly report HasExternalAgents = true, which:

  • Blocks the chat tool from creating workspaces from that template
  • Disables workspace actions in the UI
  • Affects template search filtering via has_external_agent:true

Fix

Replace the graph-based hasExternalAgentResources() with instance-based detection, matching the approach used for HasAITasks in coder/coder#25197.

References

Generated with Coder Agents

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions