| 3552 | } |
| 3553 | |
| 3554 | bool ClientBase::checkAIProviderAcknowledgment() |
| 3555 | { |
| 3556 | // If API key came from environment and user hasn't acknowledged yet, ask for confirmation |
| 3557 | if (ai_inferred_from_env && !ai_provider_acknowledged && is_interactive) |
| 3558 | { |
| 3559 | // Clear any progress display |
| 3560 | if (need_render_progress && tty_buf) |
| 3561 | { |
| 3562 | std::unique_lock lock(tty_mutex); |
| 3563 | progress_indication.clearProgressOutput(*tty_buf, lock); |
| 3564 | } |
| 3565 | |
| 3566 | const auto question = fmt::format( |
| 3567 | "AI SQL generation will use {} API key from environment variable.\n" |
| 3568 | "Do you want to continue? [y/N] ", |
| 3569 | ai_provider_name); |
| 3570 | |
| 3571 | if (!ask(question, *std_in, *std_out)) |
| 3572 | { |
| 3573 | // User declined |
| 3574 | error_stream << "AI query cancelled.\n"; |
| 3575 | return false; |
| 3576 | } |
| 3577 | |
| 3578 | // User accepted, remember for this session |
| 3579 | ai_provider_acknowledged = true; |
| 3580 | *std_out << '\n'; |
| 3581 | } |
| 3582 | |
| 3583 | return true; |
| 3584 | } |
| 3585 | #endif |
| 3586 | |
| 3587 | void ClientBase::addCommonOptions(OptionsDescription & options_description) |
nothing calls this directly
no test coverage detected