Repository navigation
fix: skip runs that skipped every job in the token report - #1644
Merged
Merged
Conversation
A run whose jobs were all skipped by their if: ran no session and uploaded no session logs, yet the report still spent a gh run download call on it. Refs #1642
max-sixty
added a commit
that referenced
this pull request
Nov 5, 2026
`tend runtime token-report`, which each consumer's nightly sweep runs, made one `gh run download` per run in its window, and every Tend workflow on the account shares that account's 5,000-request hourly allowance. On max-sixty/leaf on 2 Nov the report spent 3,977 of those requests in three minutes and starved the account's other Tend workflows for most of an hour (#1642). #1644 dropped runs that skipped every job. This drops the requests for runs that uploaded no session log, which is most of what remains. The report now pages the repository's artifact listing once, newest first, back to the run fetch's creation bound. It downloads each session-log artifact of a run it covers by artifact id, so a run without one costs nothing. Most runs in a busy window upload none: landing checks, mention relays, CI-failure verdicts and mentions not addressed to the bot. Measured on max-sixty/leaf over the 24 hours to 2026-11-05 17:48 UTC: 832 runs in the window after skipped ones, 328 of them with a session log (329 artifacts). The per-run requests go from 832 + 329 = 1,161 to 13 listing pages + 329 = 342. On the same one-hour window against leaf, the old and new code gave byte-identical JSON and summaries, at 103 and 59 requests. - `_common.gh` takes a `stdout` file, so the zip download still goes through the one `gh` call site. - A `token-usage.json` holding a value that isn't an object now costs only its own run. Its `TypeError` used to escape the per-run handler and end the report. - A failed listing page now fails the report outright, where the old path counted each failed per-run download as a missing upload and under-reported without saying so. Of 27 calls at 100 per page, 7 failed with HTTP 500 in a burst, and none of the 30 since. Known, and unchanged here: - The missing-upload footnote says those runs "ended before the upload or had torn uploads". On leaf, nearly all of the roughly 500 a day it counts never ran an agent, which hides any real torn upload. - `tend-land` completed 413 runs in a day on leaf, so a long window plus the 24-hour creation cushion could pass the 1,000-run listing ceiling. The report warns when that happens. Refs #1642 > _This was written by Claude Code on behalf of max-sixty_
Merged
max-sixty
added a commit
that referenced
this pull request
Nov 9, 2026
Release 0.3.24, shipping #1648's per-issue triage concurrency, so a consumer's triage sessions for different issues run at once instead of in one lane. Also ships #1652's CI handoff to tend-land when the review's CI wait is off, the token report's API savings (#1644, #1653), and the fixes and tool bumps listed in the changelog. Validation: full `wt test` and all pre-commit hooks passed on the release commit. The Codex subscription smoke passed on `d1f7c5ef` after `CODEX_AUTH_JSON` in the `tend` environment was refreshed with an access-only login; it runs again on the exact release commit before the tag. > _This was written by Claude Code on behalf of max-sixty_
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.
tend runtime token-reportrangh run downloadfor every completed run in its window, including runs whose jobs were all skipped by theirif:. Those runs ran no session and uploaded no session logs, but each still cost at least one REST call. The run listing now also asks forconclusion, and runs with conclusionskippednever reach the download loop. On leaf's 2026-11-02 sweep, which the issue cites, that is 621 of 2,297 runs.test_a_skipped_run_is_never_downloadedfails on the old code, which downloads the skipped run, and passes now. Skipped runs also drop out of the "uploaded no readable session-logs artifact" count, which was meant for runs that ended before the upload.This doesn't take the issue's other two ideas: one artifact listing for the whole repository instead of one per run, and a rate-limit floor that ends the report early with partial results. Both add mechanism. Whether the report's remaining one call per run is worth it is for a maintainer to judge.
Refs #1642 — automated triage