Skip to content

fix(agent/agentcontainers): always derive devcontainer name from workspace folder #18666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 30, 2025

Using the following Terraform I ran into an issue where devcontainers were named the same. The current strategy for naming devcontainers is overly complex and this change simplifies it by removing one source for them.

While at it, sort order of devcontainers is also made stable by sorting on devcontainer folder rather than name. The previous sorting resulted in devcontainers jumping around in the UI if their name changed.

resource "coder_devcontainer" "repositories" {
  for_each = local.repositories
  agent_id = coder_agent.dev.id
  workspace_folder = "/home/coder/${module.git-clone[each.key].folder_name}"
}

And this looks wrong in the UI:

image

And once the devcontainers come up, only one sub-agent can be created. The other will fail due to "name in use" because the implementation in the provisioner assumed this case is not possible.

image

@mafredri mafredri merged commit 9ccaf86 into main Jun 30, 2025
38 checks passed
@mafredri mafredri deleted the mafredri/fix-agen-agentcontainers-name-devcontainers-via-folder branch June 30, 2025 17:56
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants