Skip to content

Commit cd53acf

Browse files
authored
Merge pull request #582 from DefangLabs/lio-fix-for-debug
quick fix for compose debugging
2 parents 69b38a2 + 64ee6c3 commit cd53acf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/cmd/cli/command/commands.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -903,18 +903,17 @@ var composeUpCmd = &cobra.Command{
903903
// TODO: some services might be OK and we should only debug the ones that are not
904904
}
905905

906-
_, isPlayground := client.(*cliClient.PlaygroundClient)
907-
if !nonInteractive && isPlayground {
906+
if _, isPlayground := client.(*cliClient.PlaygroundClient); !nonInteractive && isPlayground {
908907
var aiDebug bool
909908
if err := survey.AskOne(&survey.Confirm{
910909
Message: "Would you like to debug the deployment with AI?",
911910
Help: "This will send logs and artifacts to our backend and attempt to diagnose the issue and provide a solution.",
912911
}, &aiDebug); err != nil {
913912
term.Debugf("failed to ask for AI debug: %v", err)
914913
} else if aiDebug {
915-
// Call the AI debug endpoint using the original command context (not the tailCtx which is canceled)
914+
// Call the AI debug endpoint using the original command context (not the tailCtx which is canceled); HACK: cmd might be canceled too
916915
// TODO: use the WorkingDir of the failed service, might not be the project's root
917-
if err := cli.Debug(cmd.Context(), client, deploy.Etag, project.WorkingDir, failedServices); err != nil {
916+
if err := cli.Debug(context.TODO(), client, deploy.Etag, project.WorkingDir, failedServices); err != nil {
918917
term.Warnf("failed to debug deployment: %v", err)
919918
}
920919
}

0 commit comments

Comments
 (0)