fix: add prompt_ready to doctor auth check

Added prompt_ready:bool and prompt_blocked_reason:string|null to the
auth check in doctor --output-format json. prompt_ready is true when
any auth credential is present, false otherwise. prompt_blocked_reason
is auth_missing when prompt_ready is false.

Generated with https://github.com/Yeachan-Heo/gajae-code
Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
bellman
2026-06-05 01:11:31 +09:00
parent db56498460
commit 5a76ecb760
2 changed files with 8 additions and 1 deletions

View File

@@ -3690,6 +3690,7 @@ fn check_auth_health() -> DiagnosticCheck {
.ok()
.is_some_and(|value| !value.trim().is_empty());
let any_auth_present = api_key_present || auth_token_present || openai_key_present;
let prompt_ready = any_auth_present;
let env_details = format!(
"Environment api_key={} auth_token={} openai_key={}",
if api_key_present { "present" } else { "absent" },
@@ -3744,6 +3745,8 @@ fn check_auth_health() -> DiagnosticCheck {
.with_data(Map::from_iter([
("api_key_present".to_string(), json!(api_key_present)),
("auth_token_present".to_string(), json!(auth_token_present)),
("prompt_ready".to_string(), json!(prompt_ready)),
("prompt_blocked_reason".to_string(), if prompt_ready { Value::Null } else { json!("auth_missing") }),
("legacy_saved_oauth_present".to_string(), json!(true)),
(
"legacy_saved_oauth_expires_at".to_string(),
@@ -3773,6 +3776,8 @@ fn check_auth_health() -> DiagnosticCheck {
.with_data(Map::from_iter([
("api_key_present".to_string(), json!(api_key_present)),
("auth_token_present".to_string(), json!(auth_token_present)),
("prompt_ready".to_string(), json!(prompt_ready)),
("prompt_blocked_reason".to_string(), if prompt_ready { Value::Null } else { json!("auth_missing") }),
("legacy_saved_oauth_present".to_string(), json!(false)),
("legacy_saved_oauth_expires_at".to_string(), Value::Null),
("legacy_refresh_token_present".to_string(), json!(false)),
@@ -3787,6 +3792,8 @@ fn check_auth_health() -> DiagnosticCheck {
.with_data(Map::from_iter([
("api_key_present".to_string(), json!(api_key_present)),
("auth_token_present".to_string(), json!(auth_token_present)),
("prompt_ready".to_string(), json!(prompt_ready)),
("prompt_blocked_reason".to_string(), if prompt_ready { Value::Null } else { json!("auth_missing") }),
("legacy_saved_oauth_present".to_string(), Value::Null),
("legacy_saved_oauth_expires_at".to_string(), Value::Null),
("legacy_refresh_token_present".to_string(), Value::Null),