feat: add hidden CODER_AGENT_IS_SUB_AGENT flag to coder agent (#17783)

Closes https://github.com/coder/internal/issues/620

Adds a new, hidden, flag `CODER_AGENT_IS_SUB_AGENT` to the `coder agent`
command.
This commit is contained in:
Danielle Maywood
2025-05-13 10:57:50 +01:00
committed by GitHub
parent 0b5f27f566
commit 7f056da088
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -89,6 +89,7 @@ type Options struct {
ServiceBannerRefreshInterval time.Duration
BlockFileTransfer bool
Execer agentexec.Execer
SubAgent bool
ExperimentalDevcontainersEnabled bool
ContainerAPIOptions []agentcontainers.Option // Enable ExperimentalDevcontainersEnabled for these to be effective.
@@ -190,6 +191,8 @@ func New(options Options) Agent {
metrics: newAgentMetrics(prometheusRegistry),
execer: options.Execer,
subAgent: options.SubAgent,
experimentalDevcontainersEnabled: options.ExperimentalDevcontainersEnabled,
containerAPIOptions: options.ContainerAPIOptions,
}
@@ -272,6 +275,8 @@ type agent struct {
metrics *agentMetrics
execer agentexec.Execer
subAgent bool
experimentalDevcontainersEnabled bool
containerAPIOptions []agentcontainers.Option
containerAPI atomic.Pointer[agentcontainers.API] // Set by apiHandler.