Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 34 additions & 5 deletions tools/wta/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3131,9 +3131,14 @@ impl App {
tracing::warn!(
target: "agents_view",
key = %key,
cwd = %raw_cwd_string,
"dispatch_resume: stored cwd is no longer a valid directory; falling back to profile default",
);
tracing::trace!(
target: "agents_view.content",
key = %key,
cwd = %raw_cwd_string,
"dispatch_resume: invalid stored cwd",
);
}
let short_key: String = key.chars().take(8).collect();
let launch_commandline = format!(
Expand Down Expand Up @@ -3186,9 +3191,15 @@ impl App {
cli = %cli_id,
commandline = %commandline,
launch_commandline = %launch_commandline,
cwd = %cwd_string,
has_cwd = !cwd_string.is_empty(),
"dispatch_resume: new-tab scheduled",
);
tracing::trace!(
target: "agents_view.content",
key = %key,
cwd = %cwd_string,
"dispatch_resume: new-tab cwd",
);

#[cfg(test)]
{
Expand Down Expand Up @@ -3331,9 +3342,14 @@ impl App {
tracing::warn!(
target: "agents_view",
key = %key,
cwd = %raw_cwd_string,
"dispatch_resume_in_agent_pane: stored cwd is no longer a valid directory; omitting from resume_in_new_agent_tab event",
);
tracing::trace!(
target: "agents_view.content",
key = %key,
cwd = %raw_cwd_string,
"dispatch_resume_in_agent_pane: invalid stored cwd",
);
}
let cwd_string = valid_cwd.unwrap_or_default();

Expand All @@ -3359,9 +3375,15 @@ impl App {
tracing::info!(
target: "agents_view",
key = %s.key,
cwd = %cwd_string,
has_cwd = !cwd_string.is_empty(),
"dispatch_resume_in_agent_pane: resume_in_new_agent_tab event published",
);
tracing::trace!(
target: "agents_view.content",
key = %s.key,
cwd = %cwd_string,
"dispatch_resume_in_agent_pane: resume cwd",
);

#[cfg(test)]
{
Expand Down Expand Up @@ -5423,9 +5445,16 @@ impl App {
target: "acp_load_session",
tab_id,
session_id,
cwd = ?cwd,
has_cwd = cwd.is_some(),
"inbound load_session event from WT"
);
tracing::trace!(
target: "acp_load_session.content",
tab_id,
session_id,
cwd = ?cwd,
"inbound load_session cwd"
);
if tab_id.is_empty() || session_id.is_empty() {
tracing::warn!(
target: "acp_load_session",
Expand Down
22 changes: 17 additions & 5 deletions tools/wta/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,11 @@ async fn run_delegate(
delegate_model: Option<&str>,
cwd: Option<&str>,
) -> Result<()> {
// Log the prompt length, not the text — the prompt is user content.
tracing::info!(prompt_chars = prompt.map(|p| p.chars().count()), agent = agent_cmd, cwd, "run_delegate started");
tracing::trace!(target: "delegate.content", prompt = ?prompt, "run_delegate prompt");
// Log the prompt length, not the text — the prompt is user content. `cwd`
// is a filesystem path (carries the username / folder names), so it is
// personal data too: keep it on the trace-only content channel.
tracing::info!(prompt_chars = prompt.map(|p| p.chars().count()), agent = agent_cmd, "run_delegate started");
Comment thread
vanzue marked this conversation as resolved.
tracing::trace!(target: "delegate.content", prompt = ?prompt, cwd, "run_delegate prompt");
Comment thread
vanzue marked this conversation as resolved.
Outdated

let (debug_tx, _) = tokio::sync::mpsc::unbounded_channel::<app::DebugMessage>();
let channel = match connect_to_wt_protocol(debug_tx).await {
Expand Down Expand Up @@ -2567,19 +2569,29 @@ async fn run_acp_app(
if v.is_none() {
tracing::warn!(
target: "acp_load_session",
cwd = %s,
"--initial-load-cwd refers to a missing directory; dropping from load_session params",
);
tracing::trace!(
target: "acp_load_session.content",
cwd = %s,
"--initial-load-cwd missing directory",
);
}
v
});
tracing::info!(
target: "acp_load_session",
session_id = sid,
tab_id = %tab_id,
cwd = ?cwd,
has_cwd = cwd.is_some(),
"queueing boot-time initial load_session via AppEvent::WtEvent"
);
tracing::trace!(
target: "acp_load_session.content",
session_id = sid,
cwd = ?cwd,
"initial load_session cwd"
);
let mut params = serde_json::Map::new();
params.insert(
"tab_id".to_string(),
Expand Down
9 changes: 8 additions & 1 deletion tools/wta/src/master/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,18 @@ impl acp::Agent for HelperHandler {
step = "helper→agent",
op = "new_session",
helper_id = ?self.helper_id,
cwd = ?args.cwd,
has_cwd = !args.cwd.as_os_str().is_empty(),
mcp_servers = args.mcp_servers.len(),
pane_session_id = ?wta_meta.pane_session_id,
"forwarding new_session"
);
tracing::trace!(
target: "master.content",
step = "helper→agent",
op = "new_session",
cwd = ?args.cwd,
"new_session cwd"
);
let resp = self.agent_conn.new_session(args).await?;
let forwarder = self.forwarder_for_route("new_session")?;
// Record routing entry BEFORE returning so the helper can't
Expand Down
Loading