From 98ad5b1987bb32554e64456e50845bcbe2495bfa Mon Sep 17 00:00:00 2001 From: Samuel K Date: Wed, 8 Jul 2026 08:07:39 -0500 Subject: [PATCH 1/4] refactor(agent): simplify host-vs-container detection to a runtime probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IsHostAgentInvocation decides per-workspace state layout: host (WorkspaceDir/agent, delete-stable) vs container (FindAgentHomeFolder glob). The layout must follow where the agent physically runs, which the orchestrator cannot know — a machine provider's exec command is an opaque template that may docker-exec into a container or ssh into bare metal. Only the running agent can tell, via container filesystem markers. The old predicate combined that runtime probe (isLikelyContainer) with an inline DEVSY_AGENT_IN_CONTAINER=1 env prefix set by every remote agent command builder. The env var was redundant: it was only ever set on commands that also run in a container (probe already true), and on a bare SSH machine it resolved to host via the probe regardless. So host = NOT(envPrefix AND isLikelyContainer) is equivalent, for every real caller, to host = NOT(isLikelyContainer) Drop the env var, the ContainerAgentEnvPrefix / AgentCommandEnvPrefix helpers, and their inline prefixes across all builders; keep the runtime probe and the explicit --agent-dir override. This also removes the misleading "env set but no container indicator" debug line, which was a legitimate, expected state on a bare SSH machine. Verified on the ws3-ssh provider: up and re-up behave identically to main (host layout preserved). Note: workspace logs on a bare SSH machine remains broken the same way it is on main (the agent runs on the host, which the logs guard rejects) — a pre-existing issue, unchanged by this refactor. --- cmd/internal/logs_daemon.go | 4 +- cmd/workspace/logs.go | 3 +- cmd/workspace/up/agent.go | 3 +- pkg/agent/workspace.go | 81 +++++-------------- pkg/agent/workspace_test.go | 72 +++-------------- .../clientimplementation/workspace_client.go | 12 +-- pkg/tunnel/container.go | 6 +- pkg/tunnel/services.go | 4 +- 8 files changed, 40 insertions(+), 145 deletions(-) diff --git a/cmd/internal/logs_daemon.go b/cmd/internal/logs_daemon.go index 3b5e6eafe..d03ad3efe 100644 --- a/cmd/internal/logs_daemon.go +++ b/cmd/internal/logs_daemon.go @@ -6,7 +6,6 @@ import ( "os" "github.com/devsy-org/devsy/cmd/flags" - "github.com/devsy-org/devsy/pkg/agent" "github.com/devsy-org/devsy/pkg/client" "github.com/devsy-org/devsy/pkg/config" provider2 "github.com/devsy-org/devsy/pkg/provider" @@ -66,8 +65,7 @@ func (cmd *LogsDaemonCmd) Run(ctx context.Context, args []string) error { } command := fmt.Sprintf( - "%s%q internal agent workspace logs-daemon --context %q --id %q", - agent.ContainerAgentEnvPrefix, + "%q internal agent workspace logs-daemon --context %q --id %q", workspaceClient.AgentPath(), workspaceClient.Context(), workspaceClient.Workspace(), diff --git a/cmd/workspace/logs.go b/cmd/workspace/logs.go index 09a2f7462..f871cfede 100644 --- a/cmd/workspace/logs.go +++ b/cmd/workspace/logs.go @@ -124,8 +124,7 @@ func (cmd *LogsCmd) Run(ctx context.Context, args []string) error { defer func() { _ = session.Close() }() agentCommand := fmt.Sprintf( - "%s%q internal agent workspace logs --context %q --id %q", - agent.ContainerAgentEnvPrefix, + "%q internal agent workspace logs --context %q --id %q", client.AgentPath(), client.Context(), client.Workspace(), diff --git a/cmd/workspace/up/agent.go b/cmd/workspace/up/agent.go index e94d157c3..6ed71b150 100644 --- a/cmd/workspace/up/agent.go +++ b/cmd/workspace/up/agent.go @@ -203,8 +203,7 @@ func (cmd *UpCmd) devsyUpMachineSSH( } agentCommand := fmt.Sprintf( - "%s%q internal agent workspace up --workspace-info %q", - agent.ContainerAgentEnvPrefix, + "%q internal agent workspace up --workspace-info %q", client.AgentPath(), workspaceInfo, ) diff --git a/pkg/agent/workspace.go b/pkg/agent/workspace.go index bdb8c569c..207f3cc81 100644 --- a/pkg/agent/workspace.go +++ b/pkg/agent/workspace.go @@ -35,42 +35,12 @@ var extraSearchLocations = []string{ config.ContainerDataDir + "/agent", } -// EnvAgentInContainer is set to "1" by every SSH command builder that -// launches `devsy agent ...` inside the workspace container or machine. -// It is the single signal used by IsHostAgentInvocation to distinguish a -// container-side invocation from a host-side one. The host never sets it. -const EnvAgentInContainer = "DEVSY_AGENT_IN_CONTAINER" - -// EnvAgentInContainerTrue is the value the env var takes when set. -const EnvAgentInContainerTrue = "1" - -// ContainerAgentEnvPrefix is the inline env-var assignment SSH command -// builders prepend to the shell snippet that launches `devsy agent ...` -// inside the workspace container or machine. POSIX shells parse leading -// `NAME=value cmd ...` as a one-shot environment assignment for `cmd`, -// so this works without requiring the SSH server to honour SetEnv (which -// is often disabled). -const ContainerAgentEnvPrefix = EnvAgentInContainer + "=" + EnvAgentInContainerTrue + " " - -// AgentCommandEnvPrefix omits the container env prefix when the command -// will be executed on the host (provider agent.local=true); prepending it -// there would mislabel the host process and trip IsHostAgentInvocation's -// stale-env warning. -func AgentCommandEnvPrefix(isLocal bool) string { - if isLocal { - return "" - } - return ContainerAgentEnvPrefix -} - var ErrFindAgentHomeFolder = fmt.Errorf("couldn't find devsy home directory") // GetAgentDaemonLogFolder returns the folder that holds agent-daemon.log. -// The daemon is a container/machine-side process: it is started by the -// inject-and-run path during `devsy up` and the SSH command builder sets -// DEVSY_AGENT_IN_CONTAINER=1. A host-side invocation has no daemon to -// inspect and therefore is rejected explicitly instead of silently -// resolving to the legacy `/agent` glob. +// The daemon runs inside the workspace devcontainer, so a host-side +// invocation has no daemon to inspect and is rejected explicitly instead of +// silently resolving to the legacy `/agent` glob. func GetAgentDaemonLogFolder(agentFolder string) (string, error) { if IsHostAgentInvocation(agentFolder) { return "", fmt.Errorf( @@ -229,39 +199,30 @@ func GetAgentBinariesDirFromWorkspaceDir(workspaceDir string) (string, error) { return "", os.ErrNotExist } -// IsHostAgentInvocation reports whether this `devsy agent ...` call is -// running on the user's host (as opposed to inside the workspace container -// or machine). The signal is explicit: every SSH command builder that -// launches `devsy agent ...` inside the container sets -// DEVSY_AGENT_IN_CONTAINER=1; the host never sets it. An explicit -// --agent-dir (agentFolder != "") also forces a non-host (legacy/explicit) -// routing, so unit tests and unusual deployments can still pin a folder. -// -// When this returns true, per-workspace agent state lives under the -// canonical PathManager.WorkspaceAgentDir so a single -// os.RemoveAll(WorkspaceDir) wipes it on delete. DEVSY_HOME is NOT -// consulted here — it is purely a host-side config-dir relocation knob -// and must not double as a container marker. -// containerDetector is the package-level seam used by IsHostAgentInvocation -// to detect whether the process is running inside a container. Tests -// override this to make the predicate deterministic across platforms. +// containerDetector reports whether the current process runs inside a +// container. It is a package var so tests can substitute a deterministic +// implementation; production uses the filesystem-marker probe. var containerDetector = isLikelyContainer +// IsHostAgentInvocation reports whether this `devsy agent ...` call runs +// host-side — the user's CLI or a bare (non-containerized) SSH machine — as +// opposed to inside a container (the workspace devcontainer, or a machine +// provider whose "machine" is itself a container). +// +// The distinction drives per-workspace state layout, and it depends on where +// the agent physically runs, which the orchestrator cannot know: a machine +// provider's exec command is an opaque template that may `docker exec` into a +// container or ssh into bare metal. So the running agent detects its own +// environment via container markers. An explicit --agent-dir (agentFolder) +// pins a folder for tests and unusual deployments, bypassing detection. +// +// DEVSY_HOME is deliberately NOT consulted: it is a host-side config-dir +// relocation knob and must not double as a container marker. func IsHostAgentInvocation(agentFolder string) bool { if agentFolder != "" { return false } - if os.Getenv(EnvAgentInContainer) != EnvAgentInContainerTrue { - return true - } - if !containerDetector() { - log.Debugf( - "%s=1 is set but no container indicator file found; treating as host invocation", - EnvAgentInContainer, - ) - return true - } - return false + return !containerDetector() } func GetAgentBinariesDir(agentFolder, context, workspaceID string) (string, error) { diff --git a/pkg/agent/workspace_test.go b/pkg/agent/workspace_test.go index 3a5061ab2..dc6387f83 100644 --- a/pkg/agent/workspace_test.go +++ b/pkg/agent/workspace_test.go @@ -6,19 +6,6 @@ import ( const explicitAgentDir = "/some/dir" -func TestAgentCommandEnvPrefix(t *testing.T) { - if got := AgentCommandEnvPrefix(true); got != "" { - t.Errorf("AgentCommandEnvPrefix(true) = %q, want \"\"", got) - } - if got := AgentCommandEnvPrefix(false); got != ContainerAgentEnvPrefix { - t.Errorf( - "AgentCommandEnvPrefix(false) = %q, want %q", - got, - ContainerAgentEnvPrefix, - ) - } -} - // withContainerDetector swaps the package-level container detector for // the duration of the test, restoring the previous value on cleanup. func withContainerDetector(t *testing.T, fn func() bool) { @@ -33,7 +20,6 @@ func withContainerDetector(t *testing.T, fn func() bool) { type hostInvocationCase struct { name string agentFolder string - inContainer string // empty == unset; "1" == container marker containerSeen bool want bool } @@ -41,51 +27,26 @@ type hostInvocationCase struct { func hostInvocationCases() []hostInvocationCase { return []hostInvocationCase{ { - name: "host: no agentFolder, no marker, no indicator", - agentFolder: "", - inContainer: "", - containerSeen: false, - want: true, - }, - { - name: "container: no agentFolder, marker set, indicator present", - agentFolder: "", - inContainer: "1", - containerSeen: true, - want: false, - }, - { - name: "host with stale env: marker set but no indicator", + name: "host: no agentFolder, not in a container", agentFolder: "", - inContainer: "1", containerSeen: false, want: true, }, { - name: "host with rogue indicator but no env", + name: "container: no agentFolder, running in a container", agentFolder: "", - inContainer: "", containerSeen: true, - want: true, - }, - { - name: "explicit agentFolder, no marker (legacy/explicit)", - agentFolder: explicitAgentDir, - inContainer: "", - containerSeen: false, want: false, }, { - name: "explicit agentFolder beats stale env", + name: "explicit agentFolder, not in a container (legacy/explicit)", agentFolder: explicitAgentDir, - inContainer: "1", containerSeen: false, want: false, }, { - name: "explicit agentFolder and marker (container with --agent-dir)", + name: "explicit agentFolder beats container detection", agentFolder: explicitAgentDir, - inContainer: "1", containerSeen: true, want: false, }, @@ -93,19 +54,17 @@ func hostInvocationCases() []hostInvocationCase { } // TestIsHostAgentInvocation covers the matrix of -// (agentFolder empty/non-empty) x (env unset/"1") x (container indicator yes/no). +// (agentFolder empty/non-empty) x (in a container or not). func TestIsHostAgentInvocation(t *testing.T) { for _, tc := range hostInvocationCases() { t.Run(tc.name, func(t *testing.T) { - t.Setenv(EnvAgentInContainer, tc.inContainer) withContainerDetector(t, func() bool { return tc.containerSeen }) got := IsHostAgentInvocation(tc.agentFolder) if got != tc.want { t.Fatalf( - "IsHostAgentInvocation(%q) with %s=%q indicator=%v = %v, want %v", - tc.agentFolder, EnvAgentInContainer, tc.inContainer, - tc.containerSeen, got, tc.want, + "IsHostAgentInvocation(%q) with container=%v = %v, want %v", + tc.agentFolder, tc.containerSeen, got, tc.want, ) } }) @@ -113,26 +72,13 @@ func TestIsHostAgentInvocation(t *testing.T) { } // TestIsHostAgentInvocation_IgnoresDevsyHome guards the regression that -// setting DEVSY_HOME on the host must NOT flip the predicate to -// "container" — only DEVSY_AGENT_IN_CONTAINER + an indicator does that. +// setting DEVSY_HOME on the host must NOT flip the predicate to the +// container side — only actually running in a container does that. func TestIsHostAgentInvocation_IgnoresDevsyHome(t *testing.T) { t.Setenv("DEVSY_HOME", "/custom/devsy/home") - t.Setenv(EnvAgentInContainer, "") withContainerDetector(t, func() bool { return false }) if !IsHostAgentInvocation("") { t.Fatal("IsHostAgentInvocation should still report host when only DEVSY_HOME is set") } } - -// TestIsHostAgentInvocation_NonStandardMarkerValue ensures that only the -// exact "1" string flips the predicate, mirroring the strict equality -// check in the implementation. -func TestIsHostAgentInvocation_NonStandardMarkerValue(t *testing.T) { - t.Setenv(EnvAgentInContainer, "true") - withContainerDetector(t, func() bool { return true }) - - if !IsHostAgentInvocation("") { - t.Fatal("only DEVSY_AGENT_IN_CONTAINER=1 should be honoured; got false for value 'true'") - } -} diff --git a/pkg/client/clientimplementation/workspace_client.go b/pkg/client/clientimplementation/workspace_client.go index 8ae274df9..bd2b49694 100644 --- a/pkg/client/clientimplementation/workspace_client.go +++ b/pkg/client/clientimplementation/workspace_client.go @@ -378,8 +378,7 @@ func (s *workspaceClient) Delete(ctx context.Context, opt client.DeleteOptions) return fmt.Errorf("agent info") } command := fmt.Sprintf( - "%s%q internal agent workspace delete --workspace-info %q", - agent.AgentCommandEnvPrefix(s.agentLocalLocked()), + "%q internal agent workspace delete --workspace-info %q", info.Agent.Path, compressed, ) @@ -487,8 +486,7 @@ func (s *workspaceClient) Stop(ctx context.Context, opt client.StopOptions) erro return fmt.Errorf("agent info") } command := fmt.Sprintf( - "%s%q internal agent workspace stop --workspace-info %q", - agent.AgentCommandEnvPrefix(s.agentLocalLocked()), + "%q internal agent workspace stop --workspace-info %q", info.Agent.Path, compressed, ) @@ -667,8 +665,7 @@ func (s *workspaceClient) getContainerStatus(ctx context.Context) (client.Status return "", fmt.Errorf("get agent info") } command := fmt.Sprintf( - "%s%q internal agent workspace status --workspace-info %q", - agent.AgentCommandEnvPrefix(s.agentLocalLocked()), + "%q internal agent workspace status --workspace-info %q", info.Agent.Path, compressed, ) @@ -1008,8 +1005,7 @@ func buildAgentCommand( agentCommand, workspaceInfo string, ) string { command := fmt.Sprintf( - "%s%q internal agent workspace %s --workspace-info %q", - agent.AgentCommandEnvPrefix(workspaceClient.AgentLocal()), + "%q internal agent workspace %s --workspace-info %q", workspaceClient.AgentPath(), agentCommand, workspaceInfo, diff --git a/pkg/tunnel/container.go b/pkg/tunnel/container.go index 65a0d39d1..5cf6175cf 100644 --- a/pkg/tunnel/container.go +++ b/pkg/tunnel/container.go @@ -146,8 +146,7 @@ func (c *ContainerTunnel) updateConfig(ctx context.Context, sshClient *ssh.Clien // update workspace remotely buf := &bytes.Buffer{} command := fmt.Sprintf( - "%s%q internal agent workspace update-config --workspace-info %q", - agent.ContainerAgentEnvPrefix, + "%q internal agent workspace update-config --workspace-info %q", c.client.AgentPath(), workspaceInfo, ) @@ -243,8 +242,7 @@ func (c *ContainerTunnel) runContainerTunnel(ctx context.Context, opts container defer log.Debugf("Container tunnel exited") command := fmt.Sprintf( - "%s%q internal agent container-tunnel --workspace-info %q", - agent.ContainerAgentEnvPrefix, + "%q internal agent container-tunnel --workspace-info %q", c.client.AgentPath(), opts.workspaceInfo, ) diff --git a/pkg/tunnel/services.go b/pkg/tunnel/services.go index cce6fc8c7..fe149ce9c 100644 --- a/pkg/tunnel/services.go +++ b/pkg/tunnel/services.go @@ -14,7 +14,6 @@ import ( "al.essio.dev/pkg/shellescape" "github.com/devsy-org/api/pkg/devsy" - "github.com/devsy-org/devsy/pkg/agent" "github.com/devsy-org/devsy/pkg/agent/tunnelserver" "github.com/devsy-org/devsy/pkg/config" config2 "github.com/devsy-org/devsy/pkg/devcontainer/config" @@ -150,8 +149,7 @@ func addGitSSHSigningKey( // buildCredentialsCommand builds the credentials server command. func buildCredentialsCommand(ctx context.Context, opts RunServicesOptions) string { command := fmt.Sprintf( - "%s%s internal agent container credentials-server --user %s", - agent.ContainerAgentEnvPrefix, + "%s internal agent container credentials-server --user %s", shellescape.Quote(config.ContainerDevsyHelperLocation), shellescape.Quote(opts.User), ) From 556886fc9a59331c52e795febd947192c4cecea9 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Wed, 8 Jul 2026 08:20:20 -0500 Subject: [PATCH 2/4] fix(agent): allow workspace logs on the machine host, not just in-container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `devsy workspace logs` failed on the ws3-ssh (bare SSH machine) provider with "only valid inside the workspace container or machine". The command fetches the devcontainer's logs via the docker daemon (docker logs) and reads the per-workspace state — both available on the machine/host that hosts the container, not only inside it. The IsHostAgentInvocation guard was therefore too strict: on a bare SSH machine the agent runs on the host, which the guard rejected. Drop the guard for logs; it already reads workspace state via ReadAgentWorkspaceInfo (host or container layout) and errors clearly when the workspace is absent (the user's own CLI case). logs-daemon and the daemon command keep their guards — they read agent-daemon.log, which only exists where the daemon runs. Verified on ws3-ssh: logs now returns the container logs; and the docker machine-provider logs e2e still passes. --- cmd/internal/agentworkspace/logs.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cmd/internal/agentworkspace/logs.go b/cmd/internal/agentworkspace/logs.go index 42bddb892..6fc49e169 100644 --- a/cmd/internal/agentworkspace/logs.go +++ b/cmd/internal/agentworkspace/logs.go @@ -39,16 +39,11 @@ func NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command { } func (cmd *LogsCmd) Run(ctx context.Context) error { - // `agent workspace logs` returns devcontainer logs from inside the - // workspace container/machine. Reject host invocations explicitly - // to avoid silently reading from the wrong place. - if agent.IsHostAgentInvocation(cmd.AgentDir) { - return fmt.Errorf( - "`devsy internal agent workspace logs` is only valid inside the workspace container or machine", - ) - } - - // get workspace info + // `agent workspace logs` fetches the devcontainer's logs from the docker + // daemon (docker logs). It runs wherever that daemon and the per-workspace + // state live — inside the devcontainer, or on the machine/host that hosts + // it — so it is NOT gated on running inside a container. Missing workspace + // state (e.g. the user's own CLI with no such workspace) surfaces below. shouldExit, workspaceInfo, err := agent.ReadAgentWorkspaceInfo( cmd.AgentDir, cmd.Context, @@ -59,6 +54,9 @@ func (cmd *LogsCmd) Run(ctx context.Context) error { } else if shouldExit { return nil } + if workspaceInfo == nil { + return fmt.Errorf("workspace %q not found", cmd.ID) + } // create new runner runner, err := devcontainer.NewRunner( From 597383e969da5a015eefe77fca3cf89fac33a315 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Wed, 8 Jul 2026 08:46:32 -0500 Subject: [PATCH 3/4] chore: cleanup docstrings Signed-off-by: Samuel K --- pkg/agent/workspace.go | 24 +++--------------------- pkg/agent/workspace_test.go | 7 ------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/pkg/agent/workspace.go b/pkg/agent/workspace.go index 207f3cc81..bd29b4e36 100644 --- a/pkg/agent/workspace.go +++ b/pkg/agent/workspace.go @@ -37,10 +37,8 @@ var extraSearchLocations = []string{ var ErrFindAgentHomeFolder = fmt.Errorf("couldn't find devsy home directory") -// GetAgentDaemonLogFolder returns the folder that holds agent-daemon.log. -// The daemon runs inside the workspace devcontainer, so a host-side -// invocation has no daemon to inspect and is rejected explicitly instead of -// silently resolving to the legacy `/agent` glob. +// GetAgentDaemonLogFolder returns the path to the agent daemon log folder, which is only +// available inside the workspace container or machine. func GetAgentDaemonLogFolder(agentFolder string) (string, error) { if IsHostAgentInvocation(agentFolder) { return "", fmt.Errorf( @@ -199,25 +197,9 @@ func GetAgentBinariesDirFromWorkspaceDir(workspaceDir string) (string, error) { return "", os.ErrNotExist } -// containerDetector reports whether the current process runs inside a -// container. It is a package var so tests can substitute a deterministic -// implementation; production uses the filesystem-marker probe. var containerDetector = isLikelyContainer -// IsHostAgentInvocation reports whether this `devsy agent ...` call runs -// host-side — the user's CLI or a bare (non-containerized) SSH machine — as -// opposed to inside a container (the workspace devcontainer, or a machine -// provider whose "machine" is itself a container). -// -// The distinction drives per-workspace state layout, and it depends on where -// the agent physically runs, which the orchestrator cannot know: a machine -// provider's exec command is an opaque template that may `docker exec` into a -// container or ssh into bare metal. So the running agent detects its own -// environment via container markers. An explicit --agent-dir (agentFolder) -// pins a folder for tests and unusual deployments, bypassing detection. -// -// DEVSY_HOME is deliberately NOT consulted: it is a host-side config-dir -// relocation knob and must not double as a container marker. +// IsHostAgentInvocation determines whether the current invocation is a host-side invocation of the agent. func IsHostAgentInvocation(agentFolder string) bool { if agentFolder != "" { return false diff --git a/pkg/agent/workspace_test.go b/pkg/agent/workspace_test.go index dc6387f83..039baf80f 100644 --- a/pkg/agent/workspace_test.go +++ b/pkg/agent/workspace_test.go @@ -6,8 +6,6 @@ import ( const explicitAgentDir = "/some/dir" -// withContainerDetector swaps the package-level container detector for -// the duration of the test, restoring the previous value on cleanup. func withContainerDetector(t *testing.T, fn func() bool) { t.Helper() prev := containerDetector @@ -53,8 +51,6 @@ func hostInvocationCases() []hostInvocationCase { } } -// TestIsHostAgentInvocation covers the matrix of -// (agentFolder empty/non-empty) x (in a container or not). func TestIsHostAgentInvocation(t *testing.T) { for _, tc := range hostInvocationCases() { t.Run(tc.name, func(t *testing.T) { @@ -71,9 +67,6 @@ func TestIsHostAgentInvocation(t *testing.T) { } } -// TestIsHostAgentInvocation_IgnoresDevsyHome guards the regression that -// setting DEVSY_HOME on the host must NOT flip the predicate to the -// container side — only actually running in a container does that. func TestIsHostAgentInvocation_IgnoresDevsyHome(t *testing.T) { t.Setenv("DEVSY_HOME", "/custom/devsy/home") withContainerDetector(t, func() bool { return false }) From a3e73cef07c163b7f1ee212dc6de2833e61ff429 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Wed, 8 Jul 2026 08:50:05 -0500 Subject: [PATCH 4/4] chore: cleanup docstring Signed-off-by: Samuel K --- cmd/internal/agentworkspace/logs.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmd/internal/agentworkspace/logs.go b/cmd/internal/agentworkspace/logs.go index 6fc49e169..630db0551 100644 --- a/cmd/internal/agentworkspace/logs.go +++ b/cmd/internal/agentworkspace/logs.go @@ -39,11 +39,6 @@ func NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command { } func (cmd *LogsCmd) Run(ctx context.Context) error { - // `agent workspace logs` fetches the devcontainer's logs from the docker - // daemon (docker logs). It runs wherever that daemon and the per-workspace - // state live — inside the devcontainer, or on the machine/host that hosts - // it — so it is NOT gated on running inside a container. Missing workspace - // state (e.g. the user's own CLI with no such workspace) surfaces below. shouldExit, workspaceInfo, err := agent.ReadAgentWorkspaceInfo( cmd.AgentDir, cmd.Context, @@ -58,7 +53,6 @@ func (cmd *LogsCmd) Run(ctx context.Context) error { return fmt.Errorf("workspace %q not found", cmd.ID) } - // create new runner runner, err := devcontainer.NewRunner( config.ContainerDevsyHelperLocation, config.DefaultAgentDownloadURL(), @@ -68,6 +62,5 @@ func (cmd *LogsCmd) Run(ctx context.Context) error { return fmt.Errorf("create runner: %w", err) } - // write devcontainer logs to stdout return runner.Logs(ctx, os.Stdout) }