pbakaus/impeccable · error

Reply failed

Error message

Reply failed: {}

What it means

Generic failure path for the reply POST: any `PollError::AckTimeout(m)` or `PollError::Other(m)` is printed as `Reply failed: <m>` and the command exits 1. The `{}` placeholder carries the underlying message — either the server never acknowledged the reply in time, or the HTTP request failed with some other error.

Solutions

  1. Retry the reply once the live server is responsive (check with a simple poll or curl).
  2. Restart the live server if it is consistently failing to ack, then retry.
  3. Read the interpolated message in the actual output to identify the specific underlying cause (timeout vs HTTP error body).

Example fix

// before
$ impeccable live-poll --reply --reply-text hi
Reply failed: ack timed out after 5000ms
// after
$ ./scripts/impeccable live &   # restart a healthy server
$ impeccable live-poll --reply --reply-text hi
Defensive patterns

Strategy: try-catch

Try / catch

// catch any 'Reply failed: <msg>' exit and surface the interpolated message for diagnosis
try {
  execSync('impeccable live-poll --reply --reply-text "..."', { stdio: 'pipe' });
} catch (e) {
  const msg = String(e.stderr).match(/^Reply failed: (.*)$/m)?.[1];
  console.error('reply failed, underlying cause:', msg);
  // AckTimeout -> restart server and retry; other -> report
}

Prevention

When it happens

Trigger: `impeccable live-poll --reply` where `post_reply` returns AckTimeout (server did not ack within the timeout window) or Other (any non-401 HTTP/transport error, e.g. a 500 or malformed response).

Common situations: Live server busy or hung so the ack times out; server version mismatch producing an unexpected response; transient loopback failure mid-POST; server returning a non-OK status with an error body.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of pbakaus/impeccable@f2c7051853 (2026-09-08). Data as JSON: /api/errors/64a0e6c868329828. Report an issue: GitHub.

Appendix: source

Thrown at crates/live/src/live_poll.rs:762

                    return one_shot_poll(&argv, &base, &token, Some(ack), io);
                }
                println(io, &serde_json::to_string(&ack).unwrap_or_default());
                0
            }
            Err(PollError::ConnRefused) => {
                io.err(&format!(
                    "Live server not running. Start one with: {}\n",
                    script_cmd(&env, &cwd, "live")
                ));
                1
            }
            Err(PollError::Auth) => {
                // JS: a 401 on the reply POST is a non-ok response -> "Reply failed: <body.error>"
                io.err("Reply failed: Unauthorized\n");
                1
            }
            Err(PollError::AckTimeout(m)) | Err(PollError::Other(m)) => {
                io.err(&format!("Reply failed: {}\n", m));
                1
            }
        };
    }

    let stream_mode = argv.iter().any(|a| a == "--stream");
    let types_arg = argv
        .iter()
        .find(|a| a.starts_with("--types="))
        .map(|a| a["--types=".len()..].to_string());
    let types = normalize_poll_types(types_arg.as_deref());
    let ack_timeout_ms = arg_value_int(&argv, "--ack-timeout=", 600_000);

    if stream_mode {
        io.err("[impeccable-poll] stream mode: one JSON object per line on stdout; use --reply while this process stays running\n");
        loop {
            let event = match fetch_next_event(&base, &token, None, &types) {
                Ok(e) => e,

View on GitHub (pinned to f2c7051853)