Skip to content

Commit 7e5ede0

Browse files
committed
review comments
1 parent d4f208b commit 7e5ede0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

agent/agentcontainers/api.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,15 +1100,13 @@ func (api *API) maybeInjectSubAgentIntoContainerLocked(ctx context.Context, dc c
11001100
directory = DevcontainerDefaultContainerWorkspaceFolder
11011101
}
11021102

1103-
if proc.agent.ID != uuid.Nil {
1104-
if recreateSubAgent {
1105-
logger.Debug(ctx, "deleting existing subagent for recreation", slog.F("agent_id", proc.agent.ID))
1106-
err = api.subAgentClient.Delete(ctx, proc.agent.ID)
1107-
if err != nil {
1108-
return xerrors.Errorf("delete existing subagent failed: %w", err)
1109-
}
1110-
proc.agent = SubAgent{}
1103+
if proc.agent.ID != uuid.Nil && recreateSubAgent {
1104+
logger.Debug(ctx, "deleting existing subagent for recreation", slog.F("agent_id", proc.agent.ID))
1105+
err = api.subAgentClient.Delete(ctx, proc.agent.ID)
1106+
if err != nil {
1107+
return xerrors.Errorf("delete existing subagent failed: %w", err)
11111108
}
1109+
proc.agent = SubAgent{}
11121110
}
11131111
if proc.agent.ID == uuid.Nil {
11141112
displayAppsMap := map[codersdk.DisplayApp]bool{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy