You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(logstream): start a cursorless watch at the tip, not the start of the log
windows:grok:mempalace flagged the first-run replay on PR #2315. Measured on
the real shared brain: a fresh `logstream watch --agent mac-claude` with no
cursor woke holding 41 events, the oldest 49 days old. Nothing in the payload
marks them stale, so an agent reads July's task.requests as new work — the
opposite of the problem this command exists to solve.
`latest_event_id()` already documents the right behaviour for the SSE
live-tail: capture the tip at connect time "so they receive only post-connect
events". The CLI watcher not doing the same made one product with two
first-run semantics.
- default: a watch with no --since-event-id and no stored cursor starts at
the tip. Backlog belongs to the inbox sweep (`logstream list`), which can
page it deliberately; a watcher is for what arrives from now on.
- never silent: it prints what it skipped and how to get it, on stderr, in
--json mode too, so the note cannot corrupt a parsed payload.
- --from-start opts back into the replay.
Six existing tests turned out to depend on the replay, which is the evidence
this mattered. Their intent is filtering, not first-run behaviour, so the
shared args helper opts them into --from-start and three new tests cover the
tip default explicitly — including that an explicit --since-event-id or a
state-file cursor still wins over it.
Note for review: test_agent_shorthand_does_not_wake_on_your_own_broadcast
asserts exit 2, which the tip default would satisfy for the wrong reason.
It opts into --from-start so it keeps testing the exclusion.
4395 passed, 31 skipped.
|`list`| List events, oldest first (all routing fields as filters, `--since-event-id`, `--limit`) |
213
213
|`wait`| Long-poll until a match or timeout (`--timeout-ms`, max 300000; exits `2` on timeout) |
214
-
|`watch`| Background watcher: re-arms past the `wait` cap, carries the cursor, and exits `0` on a match / `2` on `--idle-exit-ms`. `--agent ID` is shorthand for `--to-agent ID --exclude-from-agent ID` so your own `*` broadcasts never wake you. Filters repeat to mean "or"; `--state-file` resumes exactly; `--follow` stays alive past the first match |
214
+
|`watch`| Background watcher: re-arms past the `wait` cap, carries the cursor, and exits `0` on a match / `2` on `--idle-exit-ms`. `--agent ID` is shorthand for `--to-agent ID --exclude-from-agent ID` so your own `*` broadcasts never wake you. Filters repeat to mean "or"; `--state-file` resumes exactly; `--follow` stays alive past the first match; a cursorless first run starts at the tip (`--from-start` to replay)|
215
215
|`ack`| Append an `event.ack` for an event (`--from-agent` required, `--status`, `--body`) |
216
216
|`sync`| Pull missing events/artifacts from peer replicas (`--peer URL --token T`, or all peers in `peers.json`) |
0 commit comments