Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f056da

Browse files
feat: add hiddenCODER_AGENT_IS_SUB_AGENT flag tocoder agent (#17783)
Closescoder/internal#620Adds a new, hidden, flag `CODER_AGENT_IS_SUB_AGENT` to the `coder agent`command.
1 parent0b5f27f commit7f056da

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

‎agent/agent.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type Options struct {
8989
ServiceBannerRefreshInterval time.Duration
9090
BlockFileTransferbool
9191
Execer agentexec.Execer
92+
SubAgentbool
9293

9394
ExperimentalDevcontainersEnabledbool
9495
ContainerAPIOptions []agentcontainers.Option// Enable ExperimentalDevcontainersEnabled for these to be effective.
@@ -190,6 +191,8 @@ func New(options Options) Agent {
190191
metrics:newAgentMetrics(prometheusRegistry),
191192
execer:options.Execer,
192193

194+
subAgent:options.SubAgent,
195+
193196
experimentalDevcontainersEnabled:options.ExperimentalDevcontainersEnabled,
194197
containerAPIOptions:options.ContainerAPIOptions,
195198
}
@@ -272,6 +275,8 @@ type agent struct {
272275
metrics*agentMetrics
273276
execer agentexec.Execer
274277

278+
subAgentbool
279+
275280
experimentalDevcontainersEnabledbool
276281
containerAPIOptions []agentcontainers.Option
277282
containerAPI atomic.Pointer[agentcontainers.API]// Set by apiHandler.

‎cli/agent.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
5353
blockFileTransferbool
5454
agentHeaderCommandstring
5555
agentHeader []string
56+
subAgentbool
5657

5758
experimentalDevcontainersEnabledbool
5859
)
@@ -350,6 +351,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
350351
PrometheusRegistry:prometheusRegistry,
351352
BlockFileTransfer:blockFileTransfer,
352353
Execer:execer,
354+
SubAgent:subAgent,
353355

354356
ExperimentalDevcontainersEnabled:experimentalDevcontainersEnabled,
355357
})
@@ -481,6 +483,17 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
481483
Description:"Allow the agent to automatically detect running devcontainers.",
482484
Value:serpent.BoolOf(&experimentalDevcontainersEnabled),
483485
},
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+
},
484497
}
485498

486499
returncmd

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp