mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-07 08:27:12 +00:00
Stream CLI stdout/stderr to stage logs during poll
Sync cli_stdout.log and cli_stderr.log to stage_dir each poll iteration so there is visibility into what the CLI agent is doing before it finishes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
552e7d7636
commit
378c3eb3e3
1 changed files with 16 additions and 0 deletions
|
|
@ -384,6 +384,22 @@ impl CodergenBackend for AgentCliBackend {
|
|||
.await
|
||||
.map_err(|e| ArcError::handler(format!("Failed to poll CLI command: {e}")))?;
|
||||
let status = poll_result.stdout.trim();
|
||||
|
||||
// Sync CLI output to stage_dir for visibility (best-effort)
|
||||
for (remote, local) in [
|
||||
(&stdout_path, "cli_stdout.log"),
|
||||
(&stderr_path, "cli_stderr.log"),
|
||||
] {
|
||||
if let Ok(r) = sandbox
|
||||
.exec_command(&format!("cat {remote}"), 30_000, None, None, None)
|
||||
.await
|
||||
{
|
||||
if !r.stdout.is_empty() {
|
||||
let _ = tokio::fs::write(stage_dir.join(local), &r.stdout).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if status != "running" {
|
||||
break status.parse::<i32>().unwrap_or(-1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue