feat(wait): add since=now to scope pattern matches to new output - #30
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sinceoption 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