mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Do not fetch pricing information if GOOSE_CLI_SHOW_COST is false (#3901)
Co-authored-by: Jack Wright <jack.wright@nike.com>
This commit is contained in:
@@ -1524,12 +1524,17 @@ impl Session {
|
||||
.get_param::<String>("GOOSE_PROVIDER")
|
||||
.unwrap_or_else(|_| "unknown".to_string());
|
||||
|
||||
// Initialize pricing cache on startup
|
||||
tracing::info!("Initializing pricing cache...");
|
||||
if let Err(e) = initialize_pricing_cache().await {
|
||||
tracing::warn!(
|
||||
"Failed to initialize pricing cache: {e}. Pricing data may not be available."
|
||||
);
|
||||
// Do not get costing information if show cost is disabled
|
||||
// This will prevent the API call to openrouter.ai
|
||||
// This is useful if for cases where openrouter.ai may be blocked by corporate firewalls
|
||||
if show_cost {
|
||||
// Initialize pricing cache on startup
|
||||
tracing::info!("Initializing pricing cache...");
|
||||
if let Err(e) = initialize_pricing_cache().await {
|
||||
tracing::warn!(
|
||||
"Failed to initialize pricing cache: {e}. Pricing data may not be available."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
match self.get_metadata() {
|
||||
|
||||
Reference in New Issue
Block a user