TOKEN_EXPIRY_WARN_DAYS's env-override seam silently desynchronises the dashboard's hardcoded 7-day amber band
Id: TD-PPagop-26082512 · Status: resolved · Filed: 2026-08-25 · Resolved: 2026-09-15 · Ref: #1557
lib/token-expiry.sh declares the warning threshold as TOKEN_EXPIRY_WARN_DAYS="${TOKEN_EXPIRY_WARN_DAYS:-7}" — an environment seam nothing currently sets — while dashboard/index.html’s inline script hardcodes var TOKEN_EXPIRY_WARN_DAYS = 7 with only a comment saying it must match. If an operator ever sets that variable on a node (the seam invites it), doctor.sh’s warn/ok split and agent-cycle.sh’s escalation move to the new threshold but the dashboard’s amber band stays at 7, so the page and the escalation the same node files disagree silently. The PR that introduced this (agent-ops#789, issue #694) deliberately kept the threshold a fixed constant per the refinement, so the fix is small and knowable: either drop the :- env default so the constant is genuinely fixed in one place, or record the threshold doctor.sh judged against into .doctor-status.json’s token_expiry object and have the dashboard read it from the payload instead of hardcoding it. Raised in the Reviewer’s findings comment on PR #789 but otherwise unrecorded — nothing sweeps PR comments for unfiled debt.
Noticed while the Approver was judging https://github.com/Poetic-Poems/agent-ops/pull/789.
Migrated to https://github.com/Poetic-Poems/agent-ops/issues/989.