feat(run): redirect firma run logs to run.log while agent TUI owns tty#292
Merged
Conversation
…ippy `clippy::elidable_lifetime_names` (default-deny under `-D warnings` in rust 1.96) rejected the explicit `'a` on the fuzz-only `Arbitrary` impl. Elide it. Unrelated to FIR-433, but blocks `just check`.
luca-iachini
marked this pull request as ready for review
July 13, 2026 16:59
luca-iachini
force-pushed
the
fir-433
branch
2 times, most recently
from
July 13, 2026 17:23
efef848 to
21147fc
Compare
…y (FIR-433) While a wrapped agent's TUI owns the terminal, firma run's own tracing lines corrupt it. Redirect the foreground (stderr) log surface to run.log in the per-run marker dir <runtime>/run/<sandbox_id>/run.log (beside sidecar.log / authority.log) once the agent is spawned, then restore stderr for teardown output after it exits. - Swappable Destination sink (Disabled/Stderr/RunLog) behind the compact stderr layer; ANSI color suppressed while redirected to a file. - log::init() returns a ForegroundLog handle (dependency injection) instead of OnceLock globals; main passes it to services::run only. File mode (--log-file) yields an inert handle. - firma-run exposes LaunchHooks fired around the tty-handoff and supplies the marker dir. - Docs: firma-run guide documents run.log location and per-session lifecycle. The marker dir is removed on teardown, so run.log is a live per-session record, not a durable archive; use --log-file for a log that outlives the run.
veeso
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While a wrapped agent's TUI owns the terminal,
firma run's own tracing lines leak to stderr and corrupt the interface. Redirect them to a per-run log file for the session, then restore stderr for teardown. Closes FIR-433.What Changed
run.login the per-run marker dir<runtime>/run/<sandbox_id>/run.logwhile the agent runs; restore stderr on exit.Destinationsink (Disabled/Stderr/RunLog) behind the compact layer; ANSI suppressed when redirected to a file.log::init()returns aForegroundLoghandle (DI) instead ofOnceLockglobals;mainpasses it toservices::runonly.--log-file-> inert handle.firma-rungainsLaunchHooksaround the tty-handoff and supplies the marker dir.firma-runguide documentsrun.loglocation + per-session lifecycle.Risks / Notes
run.logis a live per-session record, nota durable archive; use
--log-filefor a lasting log. Fail-closed behaviorunchanged.
elidable_lifetime_namesclippy fix infirma-http(separate commit) that unblocksjust check.Cargo.lockcatch-up (pasetors/tokio-stream from merged FIR-428) rides along.AI Assistance
Authored with Claude Code (claude-opus-4-8).