Redirect debug client output to a file (#17234)

In the app-server debug client, allow redirecting output to a file in
addition to just stdout. Shell redirecting works OK but is a bit weird
with the interactive mode of the debug client since a bunch of newlines
get dumped into the shell. With async messages from MCPs starting it's
also tricky to actually type in a prompt.
This commit is contained in:
Rasmus Rygaard
2026-04-14 09:53:17 -07:00
committed by GitHub
parent 81c0bcc921
commit d013576f8b
5 changed files with 81 additions and 8 deletions

View File

@@ -67,8 +67,8 @@ pub fn start_reader(
}
let line = buffer.trim_end_matches(['\n', '\r']);
if !line.is_empty() && !filtered_output {
let _ = output.server_line(line);
if !line.is_empty() {
let _ = output.server_json_line(line, filtered_output);
}
let Ok(message) = serde_json::from_str::<JSONRPCMessage>(line) else {