Skip to content

Controller ignores ExecRequest.last_seq: disconnected clients cannot replay missed events #320

Description

@joycel-github

Summary

The ax exec --last-seq <n> flag is accepted by the CLI and sent on the wire, but the controller never reads ExecRequest.LastSeq. A disconnected client that reconnects with --last-seq does not get the events it missed replayed; the field is silently ignored.

Evidence

  • Client sets it: cmd/ax/exec.go (--last-seq flag → ExecRequest.LastSeq).
  • Proto field exists: proto/ax.proto (int32 last_seq = 3;).
  • No server-side reader: LastSeq / GetLastSeq() has zero non-test references anywhere under internal/ (including internal/controller/). Controller.Exec resumes purely from conversation state via ResumptionState, never filtering/replaying by sequence.

Regression

Server-side last_seq handling used to exist:

The recent controller rewrite in #308 ("Handle default harness correctly") replaced tryResuming/ResumptionState, and the last_seq handling was dropped in the process.

Impact

  • Disconnect/reconnect replay is broken: a client that saw up to seq N and reconnects with --last-seq N still cannot backfill the events it missed while a conversation was in flight.
  • The flag is effectively dead: it is documented and accepted but has no effect.

Repro

  1. Start a conversation and note the last seq printed.
  2. Disconnect the client mid-execution.
  3. Reconnect: ax exec --conversation <id> --last-seq <n> --resume.
  4. Observe the missed events between <n> and the current head are not replayed.

Expected

Either:

  • Restore server-side last_seq handling so the controller replays events with seq > last_seq (as in ConversationEvent.harness_config should be bytes #262), returning a clear error when last_seq is not in the event log; or
  • If the field is intentionally deprecated, remove it from the CLI/proto and update docs.

Notes

Docs corrected in #319 (README no longer promises the replay behavior) while this code gap is open. Related historical discussion: #7 (closed).

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