File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ type Options struct {
89
89
ServiceBannerRefreshInterval time.Duration
90
90
BlockFileTransfer bool
91
91
Execer agentexec.Execer
92
+ SubAgent bool
92
93
93
94
ExperimentalDevcontainersEnabled bool
94
95
ContainerAPIOptions []agentcontainers.Option // Enable ExperimentalDevcontainersEnabled for these to be effective.
@@ -190,6 +191,8 @@ func New(options Options) Agent {
190
191
metrics : newAgentMetrics (prometheusRegistry ),
191
192
execer : options .Execer ,
192
193
194
+ subAgent : options .SubAgent ,
195
+
193
196
experimentalDevcontainersEnabled : options .ExperimentalDevcontainersEnabled ,
194
197
containerAPIOptions : options .ContainerAPIOptions ,
195
198
}
@@ -272,6 +275,8 @@ type agent struct {
272
275
metrics * agentMetrics
273
276
execer agentexec.Execer
274
277
278
+ subAgent bool
279
+
275
280
experimentalDevcontainersEnabled bool
276
281
containerAPIOptions []agentcontainers.Option
277
282
containerAPI atomic.Pointer [agentcontainers.API ] // Set by apiHandler.
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
53
53
blockFileTransfer bool
54
54
agentHeaderCommand string
55
55
agentHeader []string
56
+ subAgent bool
56
57
57
58
experimentalDevcontainersEnabled bool
58
59
)
@@ -350,6 +351,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
350
351
PrometheusRegistry : prometheusRegistry ,
351
352
BlockFileTransfer : blockFileTransfer ,
352
353
Execer : execer ,
354
+ SubAgent : subAgent ,
353
355
354
356
ExperimentalDevcontainersEnabled : experimentalDevcontainersEnabled ,
355
357
})
@@ -481,6 +483,17 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
481
483
Description : "Allow the agent to automatically detect running devcontainers." ,
482
484
Value : serpent .BoolOf (& experimentalDevcontainersEnabled ),
483
485
},
486
+ {
487
+ Flag : "is-sub-agent" ,
488
+ Default : "false" ,
489
+ Env : "CODER_AGENT_IS_SUB_AGENT" ,
490
+ Description : "Specify whether this is a sub agent or not." ,
491
+ Value : serpent .BoolOf (& subAgent ),
492
+ // As `coderd` handles the creation of sub-agents, it does not make
493
+ // sense for this to be exposed. We do not want people setting an
494
+ // agent as a sub-agent if it is not.
495
+ Hidden : true ,
496
+ },
484
497
}
485
498
486
499
return cmd
You can’t perform that action at this time.
0 commit comments