File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1100,15 +1100,13 @@ func (api *API) maybeInjectSubAgentIntoContainerLocked(ctx context.Context, dc c
1100
1100
directory = DevcontainerDefaultContainerWorkspaceFolder
1101
1101
}
1102
1102
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 )
1111
1108
}
1109
+ proc .agent = SubAgent {}
1112
1110
}
1113
1111
if proc .agent .ID == uuid .Nil {
1114
1112
displayAppsMap := map [codersdk.DisplayApp ]bool {
You can’t perform that action at this time.
0 commit comments