Skip to content

Agent: watch devcontainer files, keep track of if devcontainer files changed #16424

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

Open
johnstcn opened this issue Feb 4, 2025 · 2 comments
Assignees

Comments

@johnstcn
Copy link
Member

johnstcn commented Feb 4, 2025

Depends on https://github.com/orgs/coder/projects/41/views/1?pane=issue&itemId=94820346

When a devcontainer is specified, the agent should watch for changes to those files and publish an event on the workspace updates channel (e.g. agt_devcontainer_files_updated) to notify consumers that the files relating to the devcontainer were modified.

Only notify the files were modified since the devcontainer was started.
We should debounce these notifications as well.

For now, only support this on agents running on Linux platforms.

@johnstcn
Copy link
Member Author

Ideas:

  • Decouple devcontainer autostart from devcontainer file watching.
  • Source of truth for watching files should be the set of running container labels (for now, devcontainer.config_file=<file path>).
  • Agent will, given a list of running containers, need to determine the set of file watchers that should be present based on the labels of those containers (specifically, devcontainer.config_file).
  • For now, we will only watch changes to the devcontainer.json and not other files referenced by the devcontainer.json (e.g. Dockerfile or docker-compose.yaml). This may be a future enhancement.
  • For now, we will only notify that the files changed. Support for recreating the container will be a separate issue.
  • As there is no reason for the coder agent to watch devcontainer files apart from prompting to recreate the container, and VSCode + other editors have their own capability to watch devcontainer files, this issue should be blocked on adding support for recreating a container.

@johnstcn johnstcn changed the title Agent: watch devcontainer files, publish event when devcontainer files changed Agent: watch devcontainer files, keep track of if devcontainer files changed Mar 12, 2025
@johnstcn
Copy link
Member Author

johnstcn commented Mar 12, 2025

Depends on coder/internal#481 and coder/internal#482

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

No branches or pull requests

2 participants