Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/forge_fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
[dependencies]
tokio.workspace = true
anyhow.workspace = true
tracing.workspace = true
infer = "0.15.0" # For binary file detection
thiserror = "1.0"

Expand Down
2 changes: 2 additions & 0 deletions crates/forge_infra/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ impl ForgeCommandExecutorService {
#[cfg(unix)]
command.arg(command_str);

tracing::info!(command = command_str, "Executing command");

command.kill_on_drop(true);

// Set the working directory
Expand Down
4 changes: 3 additions & 1 deletion crates/forge_main/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ impl<F: API> UI<F> {

loop {
tokio::select! {
_ = tokio::signal::ctrl_c() => {}
_ = tokio::signal::ctrl_c() => {
tracing::info!("User interrupted operation with Ctrl+C");
}
Comment thread
ssddOnTop marked this conversation as resolved.
result = self.on_command(command) => {
match result {
Ok(exit) => if exit {return Ok(())},
Expand Down
11 changes: 2 additions & 9 deletions crates/forge_main/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::sync::Arc;

use colored::Colorize;
use forge_api::{Update, API};
use forge_tracker::{EventKind, VERSION};
use forge_tracker::VERSION;
use update_informer::{registry, Check, Version};

use crate::TRACKER;

const UPDATE_COMMAND: &str = "npm update -g @antinomyhq/forge --force";

/// Runs npm update in the background, failing silently
Expand Down Expand Up @@ -81,12 +79,7 @@ pub async fn on_update(api: Arc<impl API>, update: Option<&Update>) {

/// Sends an event to the tracker when an update fails
async fn send_update_failure_event(error_msg: &str) -> anyhow::Result<()> {
// Ignore the result since we are failing silently
// This is safe because we're using a static tracker with 'static lifetime
let _ = TRACKER
.dispatch(EventKind::Error(error_msg.to_string()))
.await;

tracing::error!(error = error_msg, "Update failed");
// Always return Ok since we want to fail silently
Ok(())
}
4 changes: 4 additions & 0 deletions crates/forge_services/src/tool_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ impl<M: McpService> ForgeToolService<M> {
)
})?;

if let Err(error) = &output {
tracing::warn!(cause = %error, tool = ?call.name, "Tool Call Failure");
}

output
}
}
Expand Down
7 changes: 5 additions & 2 deletions crates/forge_services/src/tools/fs/fs_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,14 @@ impl<F: Infrastructure> FSFind<F> {
}

// Content matching mode - read and search file contents
let content = match tokio::fs::read_to_string(&path).await {
let content = match forge_fs::ForgeFS::read_to_string(&path).await {
Ok(content) => content,
Err(e) => {
// Skip binary or unreadable files silently
if e.kind() != std::io::ErrorKind::InvalidData {
if let Some(e) = e
.downcast_ref::<std::io::ErrorKind>()
.map(|e| std::io::ErrorKind::InvalidData.eq(e))
{
matches.push(format!(
"Error reading {}: {}",
self.format_display_path(&path)?,
Expand Down
Loading