fix(mcp): bound the run_watch summary and stop the watch on cancel #613

Merged
hexajon merged 1 commit from issue-602-run-watch-bounds into main 2026-09-24 14:00:09 +00:00
Owner

Summary

run_watch appended a status line on every poll, so a long timeout with a short interval grew the result without bound. It now records a line only when the status changes, so the summary stays a few lines long for any timeout.

The wait between polls used time.Sleep, so a cancelled request kept polling. It now waits on the request context and returns at once on cancel, with the status so far.

The loop moved into watchRun, which takes the status read as a function, so tests drive it without a forge. Each new test fails when its fix is reverted. The timeout is unchanged: 300 s default, set by the caller. run_watch stays an intentional mirror of the CLI actions runs watch.

Closes #602

Closes #602

## Summary `run_watch` appended a status line on every poll, so a long timeout with a short interval grew the result without bound. It now records a line only when the status changes, so the summary stays a few lines long for any timeout. The wait between polls used `time.Sleep`, so a cancelled request kept polling. It now waits on the request context and returns at once on cancel, with the status so far. The loop moved into `watchRun`, which takes the status read as a function, so tests drive it without a forge. Each new test fails when its fix is reverted. The timeout is unchanged: 300 s default, set by the caller. `run_watch` stays an intentional mirror of the CLI `actions runs watch`. Closes #602 Closes #602
fix(mcp): bound the run_watch summary and stop the watch on cancel
Some checks failed
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 1m6s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (pull_request) Successful in 1m57s
ci / mcp-conformance (push) Successful in -2s
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in -7s
drift / forgejo-smoke (push) Has been skipped
ci / gate (push) Failing after 9m49s
ci / gate (pull_request) Successful in 26m14s
4a101f8338
Closes #602
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!613
No description provided.