PromptMaxIterationsContinue prompts the user to continue after max iterations
(ctx context.Context, maxIterations int)
| 156 | |
| 157 | // PromptMaxIterationsContinue prompts the user to continue after max iterations |
| 158 | func (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 |
| 180 | func (p *Printer) PromptOAuthAuthorization(ctx context.Context, serverURL string) ConfirmationResult { |