Skip to content

fix(remote): share the follow cursor between remote logs and the fleet dashboard - #146

Merged
outofcoffee merged 2 commits into
mainfrom
worktree-dashboard-logs-bug
Sep 3, 2026
Merged

fix(remote): share the follow cursor between remote logs and the fleet dashboard#146
outofcoffee merged 2 commits into
mainfrom
worktree-dashboard-logs-bug

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

Fixes the fleet dashboard replaying the same log lines on a remote node's detail view.

Summary

  • A remote environment's Logs call ignored its resume position and re-fetched its whole tail on every poll; since the dashboard's detail view and fleet logs -f accumulate what a node returns, this replayed the most recent lines every ~3s poll on a remote node.
  • Extracts the dedup-by-event-id, overlap-window follow cursor that spinloop remote logs -f already used into internal/remote.FollowCursor, and has the fleet's remoteNode share the exact same cursor, so the two follows can't drift apart.
  • Adds a remote-node spec requirement documenting the no-duplicate follow guarantee, via the OpenSpec propose → apply → archive flow.

Implementation details

  • remoteNode now holds its own *remote.FollowCursor, since the generic fleet.Node.Logs(offset, limit) interface only threads back a single int64 — nowhere to carry an event-id set. offset is repurposed as a binary signal (daemon.TailLog resets the cursor for a fresh view-open; anything else continues).
  • A from-the-beginning read finding nothing is reported as a missing log; a later poll finding nothing new is not — the log is quiet, not missing.

…t dashboard

A remote node's log read ignored its resume position and re-fetched the
whole tail on every poll. Since the fleet dashboard's detail view and
`fleet logs -f` accumulate what a node returns, this made a remote node's
log replay its most recent lines on every poll. Extract the dedup-by-id,
overlap-window cursor `spinloop remote logs -f` already used into
internal/remote.FollowCursor and have both it and the fleet's remoteNode
share it, so the two follows cannot drift apart.
Adds the remote-node spec's requirement that reading a remote environment's
logs resumes without duplicating events, sharing the follow cursor with
`spinloop remote logs -f` — the guarantee the previous commit's fix
implements.
@outofcoffee outofcoffee added the bug Something isn't working label Sep 3, 2026
@outofcoffee
outofcoffee merged commit 93fdbd2 into main Sep 3, 2026
2 checks passed
@outofcoffee
outofcoffee deleted the worktree-dashboard-logs-bug branch September 3, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant