Skip to content

Add multi-container devcontainer workspace support#25

Merged
aniongithub merged 1 commit into
mainfrom
multi-container-workspaces
May 27, 2026
Merged

Add multi-container devcontainer workspace support#25
aniongithub merged 1 commit into
mainfrom
multi-container-workspaces

Conversation

@aniongithub
Copy link
Copy Markdown
Owner

Support the VS Code multi-container pattern where a workspace has multiple .devcontainer//devcontainer.json files referencing shared services in a single docker-compose.yml.

Core changes:

  • New devcontainer_config module: discovers all configs in a workspace (root + .devcontainer/devcontainer.json + .devcontainer/*/devcontainer.json), parses them via jsonc-parser (handles comments + trailing commas per the devcontainer.json spec), and resolves abs paths + compose service

    • dockerComposeFile paths relative to each config's directory.
  • Reliable container lookup in docker.rs: matches compose configs via com.docker.compose.service + com.docker.compose.project.config_files rather than the devcontainer.local_folder label, which the CLI only stamps on the first container of a compose stack. The no-config path unions devcontainer.local_folder and com.docker.compose.project.working_dir matches so sibling containers are visible. Canonicalizes paths to survive macOS /private/var/... aliasing.

  • All devcontainer tools (up, exec, build, stop, remove, status, read_config, file_*) now accept an optional config parameter. Single- container workflows are unchanged.

  • exec passes the resolved container id to the CLI via --container-id, which lets it reach sibling compose containers that the CLI's own workspace-folder lookup can't see.

  • Ambiguity is surfaced as structured output: status returns {state:'Ambiguous',candidates:[...],hint:'...'} and lookup-style tools return errors listing every candidate so the agent can retry with the right config.

  • New devcontainer_list_configs MCP tool exposes the discovery output.

Drive-by: narrow the cfg gate on process_tree.rs signal_all, any_alive, and libc_signal from cfg(unix) to cfg(target_os = 'linux') to match their only call site (reap_linux). The cfg(not(unix)) stubs were unreachable and silenced spurious dead_code warnings on macOS.

README: new Multi-container workspaces section + tool count 45->46.

Support the VS Code multi-container pattern where a workspace has
multiple .devcontainer/<name>/devcontainer.json files referencing
shared services in a single docker-compose.yml.

Core changes:

- New devcontainer_config module: discovers all configs in a workspace
  (root + .devcontainer/devcontainer.json + .devcontainer/*/devcontainer.json),
  parses them via jsonc-parser (handles comments + trailing commas per
  the devcontainer.json spec), and resolves abs paths + compose service
  + dockerComposeFile paths relative to each config's directory.

- Reliable container lookup in docker.rs: matches compose configs via
  com.docker.compose.service + com.docker.compose.project.config_files
  rather than the devcontainer.local_folder label, which the CLI only
  stamps on the first container of a compose stack. The no-config path
  unions devcontainer.local_folder and com.docker.compose.project.working_dir
  matches so sibling containers are visible. Canonicalizes paths to
  survive macOS /private/var/... aliasing.

- All devcontainer tools (up, exec, build, stop, remove, status,
  read_config, file_*) now accept an optional config parameter. Single-
  container workflows are unchanged.

- exec passes the resolved container id to the CLI via --container-id,
  which lets it reach sibling compose containers that the CLI's own
  workspace-folder lookup can't see.

- Ambiguity is surfaced as structured output: status returns
  {state:'Ambiguous',candidates:[...],hint:'...'} and lookup-style
  tools return errors listing every candidate so the agent can retry
  with the right config.

- New devcontainer_list_configs MCP tool exposes the discovery output.

Drive-by: narrow the cfg gate on process_tree.rs signal_all,
any_alive, and libc_signal from cfg(unix) to cfg(target_os = 'linux')
to match their only call site (reap_linux). The cfg(not(unix)) stubs
were unreachable and silenced spurious dead_code warnings on macOS.

README: new Multi-container workspaces section + tool count 45->46.
@aniongithub aniongithub merged commit 9a89210 into main May 27, 2026
1 check passed
@aniongithub aniongithub deleted the multi-container-workspaces branch May 27, 2026 19:16
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.

1 participant