Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions crates/goose-cli/src/session/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::io::{Error, IsTerminal, Write};
use std::path::Path;
use std::sync::LazyLock;
use std::time::Duration;

use super::streaming_buffer::MarkdownBuffer;
Expand Down Expand Up @@ -446,12 +445,11 @@ pub fn goose_mode_message(text: &str) {
println!("\n{}", style(text).yellow(),);
}

static SHOW_THINKING: LazyLock<bool> = LazyLock::new(|| {
std::env::var("GOOSE_CLI_SHOW_THINKING").is_ok() && std::io::stdout().is_terminal()
});

fn should_show_thinking() -> bool {
*SHOW_THINKING
Config::global()
.get_param::<bool>("GOOSE_CLI_SHOW_THINKING")
.unwrap_or(false)
Comment on lines +450 to +451
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve legacy env-var enable semantics

Switching to get_param::<bool>("GOOSE_CLI_SHOW_THINKING") changes the environment-variable contract from “set means enabled” to “must parse as boolean”. In this path, values like GOOSE_CLI_SHOW_THINKING=1 deserialize as a number and then fail bool deserialization, so unwrap_or(false) silently disables thinking output for existing users who followed current docs/examples. This is a behavior regression introduced by this change.

Useful? React with 👍 / 👎.

Comment on lines +449 to +451
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cache thinking visibility instead of loading config per chunk

should_show_thinking() is called from streaming rendering for each MessageContent::Thinking chunk, and it now calls Config::global().get_param(...) every time. get_param falls back to load()/load_raw() when the env var is unset, which performs config file reads/migration checks on each invocation; this adds avoidable per-chunk I/O in the hot path and can degrade streaming responsiveness compared with the previous LazyLock behavior.

Useful? React with 👍 / 👎.

&& std::io::stdout().is_terminal()
}

fn render_thinking(text: &str, theme: Theme) {
Expand Down
Loading