Skip to content

brev exec replays remote command after SSH reconnect #457

Description

@iskandr

Brev CLI v0.6.322 on macOS replayed a long-running remote command after its SSH transport dropped.

Observed on 2026-08-25:

  1. Started brev exec INSTANCE "mhcflurry eval compare-models ...".
  2. The remote evaluator began at 03:22:05 and completed one expensive inference phase.
  3. At 03:26:38 the client printed Connection failed, checking instance status... followed by waiting for SSH connection to be available.
  4. Once SSH returned, stdout restarted at the command beginning ([+ 0.0s] running components: processing).
  5. Remote process inspection showed two simultaneous evaluators with identical argv and output directory: original PID 2025529 (PPID 1 after disconnect) and replay PID 2033852 (parented by the new exec shell).
  6. The original later became defunct; the replay had already begun writing into the same output directory. I terminated only the replay and relaunched the job under an explicit detached/locked wrapper.

Expected: a reconnect may reattach to the existing remote process, or the client may fail and leave it detached, but it must never re-execute a non-idempotent remote command automatically.

This can corrupt output or duplicate costly/destructive work. Please make command execution at-most-once across reconnects, ideally using a remote execution ID/status marker rather than replaying argv.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions