Repository navigation
A run held by the token limit reads as paused, and admins hear before the limit runs out - #514
Merged
Merged
Conversation
… the limit runs out A run waiting on the monthly token limit (waiting_on.pause) shows one line with when it resumes, in the viewer's own time zone, a link to the limit setting and no Retry; its badge reads Paused or Waiting for token room, never Needs a person. Admins and owners get a banner at 80% and at 95% of a limit with the projected run-out date, once each per month and limit. The reached-limit banner says paused runs resume by themselves.
Contributor
|
🟡 Post-merge health check: deploy cancelled: the deploy for
|
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.
Summary
A run held by the team's monthly token limit starts again by itself, so it no longer shows as "Needs a person". The run page says when it resumes, in the viewer's own time zone, with a link to the limit setting and no Retry. Admins and owners also get a banner before a limit runs out, at 80% and again at 95%, with the date it runs out at this month's pace.
Pairs with CoderHelm/coderhelm-platform#937, which adds the fields this reads. Every new field is optional, so an older backend renders as before.
Changes
waiting_on.pauseis set on aneeds_inputrun, the outcome card reads "Paused" (token_limit) or "Waiting for token room" (token_room), with a "Resumes by itself" chip, one line such as "Paused: this month's token limit is used up (40.3M of 40M). Resumes by itself on Mon, Nov 30, 7:00 PM EST when the month turns, or as soon as an admin raises the limit.", and a "Token limit settings" link. No Retry is offered. The timeline's last step and heading say the same, as a wait rather than a person's task. Every otherneeds_inputrun keeps the "Needs a person" card.RunStatusBadgetakes the pause kind and reads "Paused" or "Waiting for token room" in a calm info tone. The runs list and the command palette don't receivewaiting_onfrom the list endpoint, so they keep the status word they have today.projected_atin their own zone, and a link to the limit setting. Each level shows once per month and limit (stored with the existing dismissed-banner list). The reached-limit banner still comes first and now says paused runs resume by themselves.RunPauseandRunWaitingOn.pauseinlib/api.ts;warn_levelandprojected_atonTokenLimitUse; helpers inlib/usage.ts(pauseLine,pauseLabel,formatWhenLocal,warnedLimit,warnBannerId).openapi-fields.tsis unchanged: it is generated from the platform's committed OpenAPI document, and the contract checks don't coverRunWaitingOnorUsageLimit. It can be regenerated once the platform change lands.Verification
npm run lint,npm run typecheckandnpm run buildindashboard/pass.e2e/token-limit-pauses.spec.ts(8 tests, mocked API, viewer in America/New_York): a paused run shows the line with the viewer-zone time, the settings link, no "Needs a person" and no Retry; a token-room run; a run waiting on a person still shows "Needs a person"; the 80% and 95% banners with the projected date, dismissed and staying dismissed for that month and level, then back for a new month; members get no warning; the reached banner still shows and wins.