Skip to content

fix(agent/agentcontainers): discover devcontainer configs in .devcontainer subfolders#26365

Draft
schnell3526 wants to merge 1 commit into
coder:mainfrom
schnell3526:fix/devcontainer-subfolder-discovery-2
Draft

fix(agent/agentcontainers): discover devcontainer configs in .devcontainer subfolders#26365
schnell3526 wants to merge 1 commit into
coder:mainfrom
schnell3526:fix/devcontainer-subfolder-discovery-2

Conversation

@schnell3526

Copy link
Copy Markdown

Project discovery only matched the .devcontainer/devcontainer.json and .devcontainer.json path suffixes, so configurations in sub-folders (.devcontainer/<folder>/devcontainer.json), which both the dev container spec and Coder's documentation list as a supported location for monorepos, were never discovered and never appeared as dev container cards in the dashboard.

Extend the matching in discoverDevcontainersInProject to also accept configurations one level deep inside the .devcontainer directory. Since knownDevcontainers is keyed by workspace folder and can only represent one configuration per project, configurations are now collected during the walk and the highest precedence one wins: .devcontainer/devcontainer.json, then .devcontainer.json, then sub-folder configurations (ties broken by walk order). A warning is logged when a configuration is ignored. This also makes the choice between the two conventional locations deterministic and spec-aligned; previously it depended on lexical walk order, which preferred .devcontainer.json.

Properly representing multiple configurations per project (multiple cards per repo, distinct sub-agent names) requires reworking the workspace folder keying and is left as a follow-up, see the discussion in the issue.

Closes #26363

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev container project discovery does not find .devcontainer/<folder>/devcontainer.json configurations

1 participant