Repository navigation
Replies: 1 comment
|
One more data point. I audited a month of Claude Code and Codex sessions on my machine (6 Sep to 7 Oct). Agents wrote 25 separate watchers for a single workflow run, mostly the tests run on Resolving by head SHA, workflow and event matters here. Of the 4 loops that looked up a run by commit, only 1 filtered by event, so the others could pick a |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server (MCP
pullRequeststoolkit, orchestration-v2 watch reactor), packages/contracts.Problem or use case
watch_pull_requestwakes an agent when a PR's checks finish, someone comments, or the branch conflicts. Very often the next thing an agent has to wait for is a GitHub Actions workflow run that no open PR owns. The usual case is theDeployrun thatworkflow_runfires after a PR merges to main. Today agents fall back to a background shell helper that pollsgh run view. That means the wait runs outside T3, depends on the provider supporting background shells, and isn't visible as a T3 watch.Job results matter, not just the run conclusion. A deploy run often concludes
successwhile its actual deploy job wasskipped, for example because of a path filter or a failed condition. An agent that only sees "success" will tell the user it's live when it isn't.Proposed solution
Add a sibling pair to
watch_pull_request/unwatch_pull_request:watch_workflow_run { run: <run URL | owner/repo + run id> }, or{ repo, headSha, workflow }to resolve a run that may not exist yet (e.g. the post-merge deploy).unwatch_workflow_run { ... }It would use the same wake mechanism and lifecycle as the PR watch (the reactor, one wake per state change, cleared when the thread settles or on unwatch). It wakes the thread once, when the run concludes, with:
name: conclusion, soskippedjobs are explicitResolving by SHA + workflow name covers the gap between "PR merged" and "deploy run created".
Smallest useful scope
GitHub only (the PR layer now uses the GitHub API directly, #16320). Watching by run ID/URL, with a single wake on completion. Resolution by SHA + workflow name can follow if you'd rather keep v1 tiny.
Current workaround
A background
gh run watch/ polling script in the agent's shell, plus a manual check that the deploy job didn't skip.Related: #14072 (marking a thread as waiting on outside work). A run watch would be one concrete source of that state.
I'm happy to implement this if the direction and scope are approved.
All reactions