Skip to content

Commit 8fb0cf1

Browse files
Revert "Mcp enablement squashed (#1327)" (#1329)
This reverts commit dd74425.
1 parent dd74425 commit 8fb0cf1

File tree

28 files changed

+137
-4055
lines changed

28 files changed

+137
-4055
lines changed

Cargo.lock

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indicatif = "0.17.11"
8686
indoc = "2.0.6"
8787
insta = "1.42.2"
8888
libc = "0.2.171"
89-
mcp_client = { path = "crates/mcp_client" }
9089
mimalloc = "0.1.46"
9190
nix = { version = "0.29.0", features = [
9291
"feature",
@@ -124,7 +123,6 @@ reqwest = { version = "0.12.14", default-features = false, features = [
124123
] }
125124
ring = "0.17.14"
126125
rusqlite = { version = "0.32.1", features = ["bundled", "serde_json"] }
127-
shellexpand = "3.0.0"
128126
shell-color = { path = "crates/shell-color" }
129127
semver = { version = "1.0.26", features = ["serde"] }
130128
serde = { version = "1.0.219", features = ["derive", "rc"] }

crates/fig_desktop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ rfd = "0.15.1"
7575
semver.workspace = true
7676
serde.workspace = true
7777
serde_json.workspace = true
78-
shellexpand.workspace = true
78+
shellexpand = "3.1.1"
7979
sysinfo.workspace = true
8080
tao = { version = "0.31.1", features = ["serde"] }
8181
tempfile.workspace = true

crates/fig_desktop_api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fig_util.workspace = true
3030
fnv = "1.0.7"
3131
serde.workspace = true
3232
serde_json.workspace = true
33-
shellexpand.workspace = true
33+
shellexpand = "3.1.1"
3434
thiserror.workspace = true
3535
tokio.workspace = true
3636
tracing.workspace = true

crates/fig_log/src/lib.rs

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ pub struct LogArgs<T: AsRef<Path>> {
5353
pub struct LogGuard {
5454
_file_guard: Option<WorkerGuard>,
5555
_stdout_guard: Option<WorkerGuard>,
56-
_mcp_file_guard: Option<WorkerGuard>,
5756
}
5857

5958
/// Initialize our application level logging using the given LogArgs.
@@ -66,7 +65,6 @@ pub fn initialize_logging<T: AsRef<Path>>(args: LogArgs<T>) -> Result<LogGuard,
6665
let filter_layer = create_filter_layer();
6766
let (reloadable_filter_layer, reloadable_handle) = tracing_subscriber::reload::Layer::new(filter_layer);
6867
ENV_FILTER_RELOADABLE_HANDLE.lock().unwrap().replace(reloadable_handle);
69-
let mut mcp_path = None;
7068

7169
// First we construct the file logging layer if a file name was provided.
7270
let (file_layer, _file_guard) = match args.log_file_path {
@@ -75,9 +73,6 @@ pub fn initialize_logging<T: AsRef<Path>>(args: LogArgs<T>) -> Result<LogGuard,
7573

7674
// Make the log path parent directory if it doesn't exist.
7775
if let Some(parent) = log_path.parent() {
78-
if log_path.ends_with("chat.log") {
79-
mcp_path = Some(parent.to_path_buf());
80-
}
8176
std::fs::create_dir_all(parent)?;
8277
}
8378

@@ -124,63 +119,20 @@ pub fn initialize_logging<T: AsRef<Path>>(args: LogArgs<T>) -> Result<LogGuard,
124119
(None, None)
125120
};
126121

127-
// Set up for mcp servers layer if we are in chat
128-
let (mcp_server_layer, _mcp_file_guard) = if let Some(parent) = mcp_path {
129-
let mcp_path = parent.join("mcp.log");
130-
if args.delete_old_log_file {
131-
std::fs::remove_file(&mcp_path).ok();
132-
} else if mcp_path.exists() && std::fs::metadata(&mcp_path)?.len() > MAX_FILE_SIZE {
133-
std::fs::remove_file(&mcp_path)?;
134-
}
135-
let file = if args.delete_old_log_file {
136-
File::create(&mcp_path)?
137-
} else {
138-
File::options().append(true).create(true).open(&mcp_path)?
139-
};
140-
#[cfg(unix)]
141-
{
142-
use std::os::unix::fs::PermissionsExt;
143-
if let Ok(metadata) = file.metadata() {
144-
let mut permissions = metadata.permissions();
145-
permissions.set_mode(0o600);
146-
file.set_permissions(permissions).ok();
147-
}
148-
}
149-
let (non_blocking, guard) = tracing_appender::non_blocking(file);
150-
let file_layer = fmt::layer()
151-
.with_line_number(true)
152-
.with_writer(non_blocking)
153-
.with_filter(EnvFilter::new("mcp=trace"));
154-
(Some(file_layer), Some(guard))
155-
} else {
156-
(None, None)
157-
};
158-
159122
if let Some(level) = args.log_level {
160123
set_log_level(level)?;
161124
}
162125

163126
// Finally, initialize our logging
164-
let subscriber = tracing_subscriber::registry()
127+
tracing_subscriber::registry()
165128
.with(reloadable_filter_layer)
166129
.with(file_layer)
167-
.with(stdout_layer);
168-
169-
if let Some(mcp_server_layer) = mcp_server_layer {
170-
subscriber.with(mcp_server_layer).init();
171-
return Ok(LogGuard {
172-
_file_guard,
173-
_stdout_guard,
174-
_mcp_file_guard,
175-
});
176-
}
177-
178-
subscriber.init();
130+
.with(stdout_layer)
131+
.init();
179132

180133
Ok(LogGuard {
181134
_file_guard,
182135
_stdout_guard,
183-
_mcp_file_guard,
184136
})
185137
}
186138

crates/figterm/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ semver.workspace = true
5555
serde.workspace = true
5656
serde_json.workspace = true
5757
shell-color.workspace = true
58-
shell-words = "1.1"
59-
shellexpand.workspace = true
58+
shellexpand = "3.1.1"
6059
shlex.workspace = true
6160
sysinfo.workspace = true
6261
time.workspace = true

crates/mcp_client/Cargo.toml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)