Skip to content

[cloud-push] Trim verbose [trace:...] debug logs added during PR #15 development #21

@Zeus-Deus

Description

@Zeus-Deus

Context

While debugging the push-to-host feature in PR #15, a lot of `[trace:session-id]`-prefixed eprintln logs were added across the spawn path. They were essential for finding the bug stack (commit `6bb557e`) but are noisy in normal operation now.

Sample (from `src-tauri/src/terminal/daemon_backed.rs`):
```
[trace:session-88] spawn_via_daemon ENTRY t=0ms
[trace:session-88] daemon.list() at t=1ms returned: []
[trace:session-88] DECISION=fresh_spawn at t=1ms
```

For a workspace with 4 panes, every push generates ~30 of these lines. Useful when something breaks, noise when nothing does.

What's needed

Audit the lines added in commits between PR #15's first commit (`d99ad6a`) and last (`bd85c33`). Categorize each:

  • Drop: per-spawn-step lifecycle logs (`spawn_via_daemon ENTRY`, `DECISION=`, etc.)
  • Keep as eprintln: actionable errors, once-per-event landmarks (`remote relaunch for X: claude --resume Y`, `closed N stale remote session(s)`)
  • Keep but downgrade: things useful for debugging but not normal-run output — wrap in `#[cfg(feature = "trace-cloud-push")]` or similar so they're available with a recompile

Avoid losing the diagnostic value. The bug stack in PR #15 took hours of iteration; if a future bug surfaces in the same area, restoring the trace shouldn't require re-discovering what to log.

Acceptance criteria

  • A normal push of a 4-pane workspace produces fewer than 10 lines of cloud-push logs in stderr
  • The lines that remain are actionable (errors, decisions, lifecycle landmarks)
  • Detailed tracing can be re-enabled via a feature flag or env var without code changes

Files

  • `src-tauri/src/terminal/daemon_backed.rs` — most of the noise
  • `src-tauri/src/ssh/registry.rs` — `[client_for_workspace:X]` lines
  • `src-tauri/src/ssh/tunnel_supervisor.rs` — `[tunnel-supervisor]` lines (more useful, keep most)
  • `src-tauri/src/pty_daemon/server.rs` — `[daemon::spawn]` line

Out of scope

  • Removing the regression tests that pin the bugs (those are in commit `e71d8cc` and are valuable)
  • Restructuring how logging works app-wide

Estimate

~30 minutes. Mostly read-and-delete with a few `cfg` wrappers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions