Repository navigation
fix(mention): measure queue delay before checkout and setup - #1364
Closed
tend-agent wants to merge 1 commit into
Closed
tend-agent wants to merge 1 commit into
tend-agent wants to merge 1 commit into
Conversation
`Compute queue delay` rendered after `<<checkout>>` and `<<setup>>`, so the number handed to the agent was event -> (runner allocated + checkout + every `setup:` step) rather than event -> job start. The step has no dependency on either, so it now renders ahead of both. Closes #1363
This was referenced Sep 21, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 21, 2026
The mention handle job's prompt tells the agent it was queued when the delay between the triggering event and the job's start exceeds ~40s. The step that measures it ran after checkout and `setup:`, so the delay counted the consumer's setup as queue time. In worktrunk, whose setup installs cargo tools, shells and Nix, two mentions that weren't queued reported 59s and 44s: their handle jobs started 19s and 13s after the runs were created ([35614904598](https://github.com/max-sixty/worktrunk/actions/runs/35614904598), [35611849540](https://github.com/max-sixty/worktrunk/actions/runs/35611849540)). numbagg's bot review of numbagg/numbagg#831 raised it, since that PR moved `uv sync` ahead of the step. The step now runs before checkout, so it measures only the wait for the job to start, which is what the prompt and CLAUDE.md describe. `test_mention_handle_has_queue_delay` now generates with a `setup:` step and asserts the delay step precedes both checkout and that step; the mention snapshots move the step. Closes #1363. Supersedes #1364, the same fix. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Owner
|
Superseded by #1365, which merged the same reorder with this PR's
|
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.
Compute queue delayrendered after<<checkout(cfg)>>and<<setup>>in the mention template, so the figure it wrote tosteps.delay.outputs.secondswas event → (runner allocated + checkout + everysetup:step), not event → job start. The prompt then tells the agent "over ~40s means it was queued", so a repo whosesetup:does anapt-get, a container pull, or a dependency build has that time reported to every mention session as queue time — a systematic overstatement that neither averages out across runs nor stays comparable between repos.0.2.14 widened it:
sandbox_setup:commands used to run inside the agent step, downstream of the measurement, andconfig.pynow appends them as asetup:step, which moves them upstream of it. A repo that migrated and changed nothing else sees its measured delay grow.The step reads only
EVENT_TS— the event payload orneeds.verify.outputs.ts— and its output is consumed further down inagent_step, so it now renders ahead of the checkout and setup blocks. The reaction step stays first so the eyes still go on promptly; its singlegh apicall is ~1s against a 40s threshold.What the reorder removes is the repo-variable part. A fixed pipeline cost stays inside the figure and this PR doesn't address it:
handleis gated onverify, so the measurement still spans both jobs' runner allocation plusverify's ownastral-sh/setup-uvand engagement check, and on the relayed-review arm thetend-mention-relayrun as well. On six consecutivetend-mentionruns here (2026-09-21) that came to 10–18s from run creation tohandle's first step, which leaves headroom under the ~40s threshold but is not the zero the threshold implicitly assumes.test_mention_queue_delay_measures_to_job_start_not_past_setupgenerates the mention workflow with asetup:step and asserts the delay step precedes both the checkout and the setup step; it fails before the reorder and passes after. The four[mention]regtest fixtures are regenerated, and their diffs are the step move alone.Closes #1363 — automated triage