acpmux: run_wait waits for an Actions run or a PR's checks and wakes the chat once
Leo's words (2026-11-03): "hmm claude code desktop's summarization of tool calls/parsing of them seem kinda good? we should bea bel to do that AND have condensed tools that are callable in acpmux/cmux-next..."
Stacked on #33317 (background-run-and-notify); it lands after that one.
What
A new condensed tool in the acpmux MCP server: run_wait. It waits under the daemon for a GitHub Actions run, or for a pull request's checks, and wakes the chat once with the outcome, naming the failed jobs. The agent no longer polls CI itself.
- Args:
repo(OWNER/REPO), exactly one ofrun(an Actions run id) orpr(a pull request number), optionalshawithpr(pins the head: if the PR's head is another commit, before or after the wait, the result is failed), anddescription(the condensed-tool contract: what the call is for; by default "checks of OWNER/REPO#N" or "Actions run N in OWNER/REPO"). - It is a
bg_startwithnotifythat the server writes for you. The command makes one blockingghcall (gh run watch RUN --exit-status --interval 30, orgh pr checks N --watch --fail-fast --interval 30), reads once which jobs or checks failed, and prints the outcome as its last line:Checks of o/r#12 passed, orActions run 7 in o/r failed: build, lint. There is no shell sleep loop. Every interpolated value is checked first (digits, hex, OWNER/REPO characters), so nothing in the script needs quoting. - New task flag
resultLine(record fieldresult_line): when the task has ended, its summary line is its last output line. So both the end notice title andstructuredContent.summarycarry that outcome;statusstill comes from the exit code (okonly for 0). - With no
ghon PATH, the call is refused with a clear message before any task starts. The script checks again in the agent's environment and exits 127 withrun_wait: gh is not installed.
Tests
acpmux_mcp_bg::tests::run_wait_checks_its_arguments: valid and refused argument shapes, including a repo with shell characters.acpmux_mcp_bg::tests::run_wait_scripts_end_on_their_outcome: runs the generated script against a fakegh. A failed run ends on... failed: build, lintwith exit 1. A passing pinned PR ends on... passedwith exit 0. A PR pinned to another head fails with exit 2 and never waits (exactly one--watchcall is recorded).acpmux_mcp_bg::tests::a_result_line_task_is_summed_up_by_its_last_line.- The
acpmuxtool list snapshot gainsrun_wait.
Observed / Not run
- Not run on this machine (no local cargo here). The new tests run on the fleet at this head through
cmux-ci test; results go in a comment.
Changelog
- Added: agents can wait for a GitHub Actions run or a PR's checks with the acpmux
run_waittool, which wakes the chat once with the outcome and names the failed jobs.
Agent session: agent session
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds run_wait, a new acpmux tool that waits in the background for a GitHub Actions run or a PR's checks and wakes the chat once with the outcome, naming the failed jobs, so the agent no longer polls CI.
- Takes
repoplus exactly one ofrun(Actions run id) orpr(pull request number); optionalshapins the PR's head commit, failing the wait if it points elsewhere. - Adds a
resultLinetask flag so an ended task's summary is its last output line, which carries the pass/fail outcome. - Refuses the call before any task starts when
ghis not on PATH.