Skip to content

feat(wait): add since=now to scope pattern matches to new output - #30

Merged
tomfordweb merged 1 commit into
mainfrom
fix/wait-pattern-since
Jul 25, 2026
Merged

feat(wait): add since=now to scope pattern matches to new output#30
tomfordweb merged 1 commit into
mainfrom
fix/wait-pattern-since

Conversation

@tomfordweb

Copy link
Copy Markdown
Owner

Problem

wait(until="pattern") scans the job's whole output region (#27). During a long release monitor, once a failure line has printed, every later wait with a broad failure pattern returns in ~10ms re-matching that stale line — you cannot wait for the next summary or failure without stripping useful terms from the regex.

Fix

New since option on the wait tool:

  • "job" (default, unchanged): scan everything since the job started, or the visible screen without a job. Kept as default because the common run-then-wait flow must match a server-ready line that printed before the wait call landed.
  • "now": fix the scan start at the pane's absolute line count when the wait begins (cursor row included — the next output lands there), so only output produced after the call can match.

The tool description now documents the whole-job default explicitly, per the issue's ask.

Tests

Integration tests against real tmux: since="now" skips an already-printed matching line and catches the one printed after the call; and times out when only stale output matches. Full gate (lint, typecheck, test, build) green locally.

Closes #27

Pattern waits scan everything since the job started, so re-waiting on a
long job with a broad failure pattern instantly re-matches a line printed
long before the call — making it impossible to wait for the NEXT failure
or summary without narrowing the pattern. since="now" fixes the scan
start at the pane's line count when the wait begins (cursor row included:
the next output lands there), so only output produced after the call can
match. The default stays "job": the run-then-wait flow must still match
a server-ready line that printed before the wait landed. The tool
description now states the whole-job default explicitly.

Fixes #27
@tomfordweb
tomfordweb merged commit ce5ed3f into main Jul 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wait(pattern) can match stale log output instead of new output

1 participant