MCPcopy Index your code
hub / github.com/docker/docker-agent / PromptMaxIterationsContinue

Method PromptMaxIterationsContinue

pkg/cli/printer.go:158–177  ·  view source on GitHub ↗

PromptMaxIterationsContinue prompts the user to continue after max iterations

(ctx context.Context, maxIterations int)

Source from the content-addressed store, hash-verified

156
157// PromptMaxIterationsContinue prompts the user to continue after max iterations
158func (p *Printer) PromptMaxIterationsContinue(ctx context.Context, maxIterations int) ConfirmationResult {
159 p.Printf("\n⚠️ Maximum iterations (%d) reached. The agent may be stuck in a loop.\n", maxIterations)
160 p.Println("This can happen with smaller or less capable models.")
161 p.Println("\nDo you want to continue for 10 more iterations? (y/n):")
162
163 response, err := input.ReadLine(ctx, os.Stdin)
164 if err != nil {
165 p.Println("\nFailed to read input, exiting...")
166 return ConfirmationAbort
167 }
168
169 response = strings.TrimSpace(strings.ToLower(response))
170 if response == "y" || response == "yes" {
171 p.Print("✓ Continuing...\n\n")
172 return ConfirmationApprove
173 } else {
174 p.Print("Exiting...\n\n")
175 return ConfirmationReject
176 }
177}
178
179// PromptOAuthAuthorization prompts the user for OAuth authorization
180func (p *Printer) PromptOAuthAuthorization(ctx context.Context, serverURL string) ConfirmationResult {

Callers 1

RunFunction · 0.80

Calls 4

PrintfMethod · 0.95
PrintlnMethod · 0.95
PrintMethod · 0.95
ReadLineFunction · 0.92

Tested by

no test coverage detected