mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
fix(cli): sanitize errors and diagnostics at their choke points
From the narrow Codex confirmation: provider, KSEI, and manifest text still reached the terminal through error messages (a Yahoo error description, a manifest's `kind`), idx-core diagnostics, the ownership heading's ticker code and Bing date, the technical heading and comparison symbol, and printed paths. Sanitize where every error (emit_error) and every diagnostic (runtime) is printed instead of at each caller, plus the remaining direct prints. terminal_safe moves to idx_core::text so the runtime can use it; the CLI re-exports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh
This commit is contained in:
parent
75b8819d95
commit
927d4224e9
8 changed files with 67 additions and 49 deletions
|
|
@ -15,6 +15,7 @@ pub mod investor;
|
|||
pub mod market;
|
||||
#[cfg(feature = "ownership")]
|
||||
pub mod ownership;
|
||||
pub mod text;
|
||||
|
||||
pub use client::{CachePolicy, Fetched, Idx};
|
||||
|
||||
|
|
@ -47,7 +48,10 @@ pub mod runtime {
|
|||
let line = serde_json::json!({ "level": level, "message": message.to_string() });
|
||||
eprintln!("{line}");
|
||||
} else {
|
||||
eprintln!("{level}: {message}");
|
||||
eprintln!(
|
||||
"{level}: {}",
|
||||
crate::text::terminal_safe(&message.to_string())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue