Skip to content

Commit 13f08b0

Browse files
committed
log capabilities
1 parent dc8d012 commit 13f08b0

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/codex_agent.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ impl Agent for CodexAgent {
113113
let protocol_version = V1;
114114

115115
*self.client_capabilities.lock().unwrap() = client_capabilities;
116+
{
117+
let guard = self.client_capabilities.lock().unwrap();
118+
info!(
119+
"ACP initialize: client fs.read_text_file={} fs.write_text_file={} terminal={}",
120+
guard.fs.read_text_file, guard.fs.write_text_file, guard.terminal
121+
);
122+
}
116123

117124
let agent_capabilities = AgentCapabilities {
118125
load_session: false, // Currently only able to do in-memory... which doesn't help us at the moment

src/conversation.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,11 +1401,7 @@ impl SessionClient {
14011401
.await;
14021402
}
14031403

1404-
async fn send_token_usage(
1405-
&self,
1406-
info: TokenUsageInfo,
1407-
rate_limits: Option<RateLimitSnapshot>,
1408-
) {
1404+
async fn send_token_usage(&self, info: TokenUsageInfo, rate_limits: Option<RateLimitSnapshot>) {
14091405
let mut meta = serde_json::Map::new();
14101406
meta.insert(
14111407
"token_usage".to_string(),

src/local_spawner.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use agent_client_protocol::{
1010
};
1111
use codex_apply_patch::StdFs;
1212
use tokio::sync::mpsc;
13+
use tracing::warn;
1314

1415
use crate::ACP_CLIENT;
1516

@@ -123,6 +124,9 @@ impl AcpFs {
123124
impl codex_apply_patch::Fs for AcpFs {
124125
fn read_to_string(&self, path: &std::path::Path) -> std::io::Result<String> {
125126
if !self.client_capabilities.lock().unwrap().fs.read_text_file {
127+
warn!(
128+
"ACP FS read_to_string fallback to local fs for {path:?} (read_text_file disabled)"
129+
);
126130
return StdFs.read_to_string(path);
127131
}
128132
let (tx, rx) = std::sync::mpsc::channel();
@@ -138,6 +142,7 @@ impl codex_apply_patch::Fs for AcpFs {
138142

139143
fn write(&self, path: &std::path::Path, contents: &[u8]) -> std::io::Result<()> {
140144
if !self.client_capabilities.lock().unwrap().fs.write_text_file {
145+
warn!("ACP FS write fallback to local fs for {path:?} (write_text_file disabled)");
141146
return StdFs.write(path, contents);
142147
}
143148
let (tx, rx) = std::sync::mpsc::channel();
@@ -166,6 +171,7 @@ impl codex_core::codex::Fs for AcpFs {
166171
>,
167172
> {
168173
if !self.client_capabilities.lock().unwrap().fs.read_text_file {
174+
warn!("ACP FS file_buffer fallback to local fs for {path:?} (read_text_file disabled)");
169175
return StdFs.file_buffer(path, limit);
170176
}
171177
let (tx, rx) = tokio::sync::oneshot::channel();

0 commit comments

Comments
 (0)