mirror of
https://github.com/instructkr/claw-code.git
synced 2026-06-05 14:07:11 +08:00
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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user