Repository navigation
feat: alert before a token the jobs use expires - #69
Merged
Merged
Conversation
A daily token-expiry job posts to the alerts channel 14, 7 and 1 days before a token expires, and once when it has. The GitHub token's expiry comes from GitHub's response header; the Claude Code token is dated by fingerprint from the day the job first sees it, with an optional issue date for one that predates the job; the Crowdin token's is recorded in /etc/session-ops/expiry.toml.
mpretty-cyro
requested changes
Oct 6, 2026
The 09:00 Melbourne run is the previous day in UTC, so comparing dates could call an expiry hours away "tomorrow", skip the alert on the expiry date, and report expiry two days late. Expiries are now UTC times (a date-only one counts from its start) and the alerts say "in less than 14 days / 7 days / 24h".
mpretty-cyro
approved these changes
Oct 6, 2026
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.
Adds
token-expiry, a daily job (09:00 Melbourne, assessionops) that posts to the alerts channel 14, 7 and 1 days before a token expires, and once when it has. Quiet otherwise; a new expiry or a rotated token starts its alerts over.GITHUB_PRS_TOKENgithub-authentication-token-expirationresponse headerCLAUDE_CODE_OAUTH_TOKEN[issued]inexpiry.toml, which applies only while that fingerprint matches.CROWDIN_API_TOKEN/etc/session-ops/expiry.toml, by hand (no API exposes it); reported until it has a date or"never"The Zendesk API token, Discord webhooks and the GitHub App key do not expire.
Trade-off: fingerprinting the Claude token means the unit loads
zendesk.env, so the Zendesk secrets are in this unit's environment too, and the job is only ready on a host wherezendesk.envhas content.Also:
install.shinstallsdeploy/env/*.example, which now includesexpiry.toml.example; a doc page atdocs/jobs/token-expiry.md; the drop-in golden updated for the new job.Deploying
Testing
uv run python -m unittest discover -s tests -t .: 759 tests pass;ruff checkclean.2027-10-02 03:00:00 UTC).