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

feat(agent/agentcontainers): support apps for dev container agents#18346

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 16 commits intomainfromdm-sub-agent-apps-configuration-2
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
eb8a469
feat(agent/agentcontainers): support apps for dev container agents
DanielleMaywoodJun 12, 2025
0dc5bb2
chore: copilot feedback
DanielleMaywoodJun 12, 2025
bcd6689
chore: more changes
DanielleMaywoodJun 13, 2025
91fd4e7
chore: pass env variables + remove accidental commit
DanielleMaywoodJun 13, 2025
c273b23
chore: fix some tests
DanielleMaywoodJun 13, 2025
8698100
chore: fix issues
DanielleMaywoodJun 17, 2025
8ec61b6
chore: fix and update test
DanielleMaywoodJun 17, 2025
ab2e82e
chore: fix oopsie
DanielleMaywoodJun 18, 2025
4db77af
test: add organization sharing level
DanielleMaywoodJun 18, 2025
d3a2583
chore: CODER_DEPLOYMENT_URL -> CODER_URL
DanielleMaywoodJun 18, 2025
20e832a
chore: remove all the pointers
DanielleMaywoodJun 18, 2025
336997b
chore: handle in CloneConfig as well
DanielleMaywoodJun 18, 2025
0ae2616
chore: rename WithUserName and WithWorkspaceName to WithManifestInfo
DanielleMaywoodJun 18, 2025
e17b228
chore: just use PATH
DanielleMaywoodJun 18, 2025
d1da3a1
chore: app deduplication
DanielleMaywoodJun 18, 2025
c6652a1
chore: appease linter
DanielleMaywoodJun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
chore: pass env variables + remove accidental commit
  • Loading branch information
@DanielleMaywood
DanielleMaywood committedJun 18, 2025
commit91fd4e71b21c93b6d6d771822cfd4557ab0f7d97
14 changes: 8 additions & 6 deletionsagent/agentcontainers/api.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1146,12 +1146,14 @@ func (api *API) maybeInjectSubAgentIntoContainerLocked(ctx context.Context, dc c

var apps []SubAgentApp

if config, err := api.dccli.ReadConfig(ctx, dc.WorkspaceFolder, dc.ConfigPath, []string{
fmt.Sprintf("CODER_AGENT_NAME=%s", dc.Name),
fmt.Sprintf("CODER_USER_NAME=%s", api.userName),
fmt.Sprintf("CODER_WORKSPACE_NAME=%s", api.workspaceName),
fmt.Sprintf("CODER_DEPLOYMENT_URL=%s", api.subAgentURL),
}); err != nil {
if config, err := api.dccli.ReadConfig(ctx, dc.WorkspaceFolder, dc.ConfigPath,
[]string{
fmt.Sprintf("CODER_WORKSPACE_AGENT_NAME=%s", dc.Name),
fmt.Sprintf("CODER_WORKSPACE_OWNER_NAME=%s", api.userName),
fmt.Sprintf("CODER_WORKSPACE_NAME=%s", api.workspaceName),
fmt.Sprintf("CODER_DEPLOYMENT_URL=%s", api.subAgentURL),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
fmt.Sprintf("CODER_DEPLOYMENT_URL=%s",api.subAgentURL),
fmt.Sprintf("CODER_AGENT_URL=%s",api.subAgentURL),

The naming is slightly unfortunate but we currently have bothCODER_URL andCODER_AGENT_URL in the product, and a third one seems like too much.

IMOCODER_URL would be more appropriate, however, it would be nice if these environment variables werealso set on the parent workspace/agent (withCODER_AGENT_URL we're at 3/4). The reason is that if a user runsdevcontainer up manually, these values are then serializable into the docker container label.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've replaced it withCODER_URL. If you'd ratherCODER_AGENT_URL I'm happy to update it again.

I don't think we can rely on anything serialized at the point ofdevcontainer up, as theCODER_WORKSPACE_AGENT_NAME will be the parents agent name, not the child. So I'm not sure there is too much benefit there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, that's a good point about the conflicting env. Let's go withCODER_URL for now 👍🏻

},
); err != nil {
api.logger.Error(ctx, "unable to read devcontainer config", slog.Error(err))
} else {
coderCustomization := config.MergedConfiguration.Customizations.Coder
Expand Down
3 changes: 2 additions & 1 deletionagent/agentcontainers/devcontainercli.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ import (
"encoding/json"
"errors"
"io"
"os"

"golang.org/x/xerrors"

Expand DownExpand Up@@ -264,7 +265,7 @@ func (d *devcontainerCLI) ReadConfig(ctx context.Context, workspaceFolder, confi
}

c := d.execer.CommandContext(ctx, "devcontainer", args...)
//c.Env = append(c.Env, env...)
c.Env = append(os.Environ(), env...)

var stdoutBuf bytes.Buffer
stdoutWriters := []io.Writer{&stdoutBuf, &devcontainerCLILogWriter{ctx: ctx, logger: logger.With(slog.F("stdout", true))}}
Expand Down
2 changes: 0 additions & 2 deletionssite/src/pages/WorkspacePage/Workspace.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -99,8 +99,6 @@ export const Workspace: FC<WorkspaceProps> = ({
const shouldShowProvisionerAlert =
workspacePending && !haveBuildLogs && !provisionersHealthy && !isRestarting;

console.log(selectedResource?.agents);

return (
<div
css={{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp