Skip to content

Research the Coder agent injection into devcontainers #17301

@bartekgatzcoder

Description

@bartekgatzcoder

In our current attempt to rework the support for the devcontainers we have stumbled upon a limitation related to the existing approach preventing us from seeing and forwarding all the open ports. The goal of this ticket is to perform a research of an alternative option, where Coder agents (or parts of it) are injected into devcontainers.

As a result of this ticket we need to understand:

  1. technical feasibility of the alternative approach
  2. associated cost of development (additional effort)
  3. associated risks and caveats
  4. whether the current approach and the alternative approach can live together and be toggled between upon user request

It's probably best if the results were added to the existing RFC.

Additional Background

The current implementation of detecting and forwarding ports from the devcontainers assumes we are doing this from "outside" of the devcontainer and without injecting an agent to it. This has two implications:

  • The devcontainers are lighter because no agent is injected into them
  • We can only forwards the ports which are openly declared in the devtcontainer.json file

Unfortunately this means that all the dynamically created ports within the devcontainer remain invisible to us at the moment, and we cannot forward them.

This is theoretically supported by the devcontainer standard, stating that all the forwarded ports should be declared up front. The reality, though, is that we cannot honestly expect this to happen. Even today the IDEs like VSCode can also detect all the dynamic ports and expose them through VSCode to the local machine. Those ports will not be seen in Coder UI tho.

The proper (user transparent) solution which we can take here is to inject all the devcontainers with our agent so that all the ports are detected, forwarded and exposed via Coder UI.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions