Repository navigation
fix(release): keep the desktop planner's source gate inside the App token's 60-minute life - #11575
Conversation
…oken's 60-minute life The plan-release job mints one Omi Bot installation token and then let the exact-SHA source gate wait up to 90 minutes on it. Installation tokens expire after 60 minutes, so every poll past expiry — and the newest-green fallback scan the blocked path depends on — failed with 'gh: Bad credentials (401)'. Result on Aug 14 2026: every hourly auto-release run red, the fallback dead, and the reported reason a misleading credentials error (issue #11574); overlapping 90-minute waits also got the next tick's runs cancelled by concurrency. Clamp the wait to 45 minutes at every configuration source (default, env, CLI) in the planner, and mirror the clamp in the workflow shell for honest logs. A Swift CI run that needs longer defers to the next hourly train tick, which re-reads the finished checks instantly — cadence stays hourly (min-tag-interval 3300s on schedule), and every desktop update ships in the first tick whose checks are green. Verification: .github/scripts/test_plan_desktop_release.py — 26 tests pass, including the new clamp regression test; clamp exercised via CI_GATE_TIMEOUT_SECONDS=5400 -> 2700 on the real script. Failure-Class: FC-assumed-credential-lifetime
There was a problem hiding this comment.
3 issues found across 3 files
Confidence score: 2/5
- In
.github/scripts/plan-desktop-release.py, the new 45-minute timeout can be treated like a completed check block, so the planner may select and tag an older green SHA while the newest SHA is still pending; that can publish from stale code — keep timeout state distinct from pass/fail so pending SHAs are not bypassed. - In
.github/workflows/desktop_auto_release.yml,recheckandreplanshare one Omi Botapp-tokenwhile both use raw${CI_GATE_TIMEOUT_SECONDS}, which creates a risk that token lifetime and long waits drift apart and cause mid-flow auth failures or inconsistent planning — mint fresh tokens per long-running phase or bound each phase timeout to token validity. - In
.github/workflows/desktop_auto_release.yml, the plan-release job comments andtimeout-minutes: 105still describe a 90-minute gate even though waits are now capped at 45 minutes, which can mislead operators during incidents and troubleshooting — align the header text and job timeout with the new cap.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/scripts/plan-desktop-release.py">
<violation number="1" location=".github/scripts/plan-desktop-release.py:31">
P1: When the newest SHA's checks are still missing or in progress at the new 45-minute cap, the planner treats the timeout as a completed block and can tag an older green SHA. Keep timeout distinct from a failed check and defer it to the next hourly tick before entering the fallback branch.</violation>
</file>
<file name=".github/workflows/desktop_auto_release.yml">
<violation number="1" location=".github/workflows/desktop_auto_release.yml:55">
P3: This change caps the source-check wait at 2700s (45m), but the plan-release job header still says the job allows "the full desktop CI gate wait (up to 90m)" and still grants `timeout-minutes: 105`. The 90m claim (and the 105m budget sized for it) no longer reflects the effective 45m cap and will mislead operators reading the workflow. Update the header comment to the 45m ceiling and note the job now has large slack, or tighten the timeout accordingly.</violation>
<violation number="2" location=".github/workflows/desktop_auto_release.yml:61">
P2: The 45-minute clamp only covers the hour scheduler's `plan` step. In the tag-release job a single Omi Bot token (one `app-token` step) backs both `recheck` and `replan`, each passing the raw `${CI_GATE_TIMEOUT_SECONDS}` (default 5400 → clamped 45 min). Since `recheck` can wait up to 45 min and `replan` can wait another 45 min after the changelog/merge work, the cumulative polling on one 60-minute token can still exceed its life and hit the same 401 the PR is fixing. Account for the token budget across the whole job (clamp in `recheck`/`replan` too, or bound the aggregate wait), or note that this path can still wedge.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| # issue #11574). So the wait must stay safely inside the token's life; a Swift | ||
| # CI run that needs longer simply defers to the next hourly train tick, which | ||
| # re-evaluates the finished checks instantly. | ||
| TOKEN_SAFE_WAIT_CEILING_SECONDS = 45 * 60 |
There was a problem hiding this comment.
P1: When the newest SHA's checks are still missing or in progress at the new 45-minute cap, the planner treats the timeout as a completed block and can tag an older green SHA. Keep timeout distinct from a failed check and defer it to the next hourly tick before entering the fallback branch.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/plan-desktop-release.py, line 31:
<comment>When the newest SHA's checks are still missing or in progress at the new 45-minute cap, the planner treats the timeout as a completed block and can tag an older green SHA. Keep timeout distinct from a failed check and defer it to the next hourly tick before entering the fallback branch.</comment>
<file context>
@@ -20,10 +20,16 @@
+# issue #11574). So the wait must stay safely inside the token's life; a Swift
+# CI run that needs longer simply defers to the next hourly train tick, which
+# re-evaluates the finished checks instantly.
+TOKEN_SAFE_WAIT_CEILING_SECONDS = 45 * 60
+SOURCE_CHECK_WAIT_SECONDS = TOKEN_SAFE_WAIT_CEILING_SECONDS
SOURCE_CHECK_POLL_SECONDS = 30
</file context>
| if (( requested_timeout > 5400 )); then | ||
| echo "Clamping source-check wait from ${requested_timeout}s to 5400s for the 105m job ceiling" | ||
| requested_timeout=5400 | ||
| if (( requested_timeout > 2700 )); then |
There was a problem hiding this comment.
P2: The 45-minute clamp only covers the hour scheduler's plan step. In the tag-release job a single Omi Bot token (one app-token step) backs both recheck and replan, each passing the raw ${CI_GATE_TIMEOUT_SECONDS} (default 5400 → clamped 45 min). Since recheck can wait up to 45 min and replan can wait another 45 min after the changelog/merge work, the cumulative polling on one 60-minute token can still exceed its life and hit the same 401 the PR is fixing. Account for the token budget across the whole job (clamp in recheck/replan too, or bound the aggregate wait), or note that this path can still wedge.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/desktop_auto_release.yml, line 61:
<comment>The 45-minute clamp only covers the hour scheduler's `plan` step. In the tag-release job a single Omi Bot token (one `app-token` step) backs both `recheck` and `replan`, each passing the raw `${CI_GATE_TIMEOUT_SECONDS}` (default 5400 → clamped 45 min). Since `recheck` can wait up to 45 min and `replan` can wait another 45 min after the changelog/merge work, the cumulative polling on one 60-minute token can still exceed its life and hit the same 401 the PR is fixing. Account for the token budget across the whole job (clamp in `recheck`/`replan` too, or bound the aggregate wait), or note that this path can still wedge.</comment>
<file context>
@@ -47,17 +47,20 @@ jobs:
- if (( requested_timeout > 5400 )); then
- echo "Clamping source-check wait from ${requested_timeout}s to 5400s for the 105m job ceiling"
- requested_timeout=5400
+ if (( requested_timeout > 2700 )); then
+ echo "Clamping source-check wait from ${requested_timeout}s to 2700s for the 60m token life"
+ requested_timeout=2700
</file context>
| # newest-green fallback scan — fail with 401 and wedge the train | ||
| # (issue #11574). The planner clamps too; this keeps the log honest | ||
| # when a repository variable is configured higher. A Swift CI run | ||
| # that needs longer defers to the next hourly tick. |
There was a problem hiding this comment.
P3: This change caps the source-check wait at 2700s (45m), but the plan-release job header still says the job allows "the full desktop CI gate wait (up to 90m)" and still grants timeout-minutes: 105. The 90m claim (and the 105m budget sized for it) no longer reflects the effective 45m cap and will mislead operators reading the workflow. Update the header comment to the 45m ceiling and note the job now has large slack, or tighten the timeout accordingly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/desktop_auto_release.yml, line 55:
<comment>This change caps the source-check wait at 2700s (45m), but the plan-release job header still says the job allows "the full desktop CI gate wait (up to 90m)" and still grants `timeout-minutes: 105`. The 90m claim (and the 105m budget sized for it) no longer reflects the effective 45m cap and will mislead operators reading the workflow. Update the header comment to the 45m ceiling and note the job now has large slack, or tighten the timeout accordingly.</comment>
<file context>
@@ -47,17 +47,20 @@ jobs:
+ # newest-green fallback scan — fail with 401 and wedge the train
+ # (issue #11574). The planner clamps too; this keeps the log honest
+ # when a repository variable is configured higher. A Swift CI run
+ # that needs longer defers to the next hourly tick.
requested_timeout="${CI_GATE_TIMEOUT_SECONDS}"
if ! [[ "${requested_timeout}" =~ ^[0-9]+$ ]]; then
</file context>
Problem
Every scheduled desktop auto-release run on Aug 14 2026 went red and no beta candidates were cut. Two stacked causes:
gh: Bad credentials (401), which (a) reported a misleading credentials error instead of the real gate state, and (b) killed the newest-green fallback scan that exists precisely to route around a blocked newest SHA. The 90-minute waits also overlapped the next hourly tick, getting runs cancelled by concurrency.Fix
Clamp the source-gate wait to 45 minutes at every configuration source (planner default,
CI_GATE_TIMEOUT_SECONDS, CLI flag) viaclamp_source_check_wait_seconds, and mirror the clamp in the workflow shell so logs stay honest. A Swift CI run that needs longer defers to the next hourly train tick, which re-reads the finished checks instantly.Release cadence guarantees after this fix (per Nik's ask):
--min-tag-interval-seconds 3300, keyed to the last candidate's publication time, plus the hourly cron.Failure-Class: FC-assumed-credential-lifetime
Verification
.github/scripts/test_plan_desktop_release.py: 26 tests pass, including the newtest_source_check_wait_is_clamped_to_the_installation_token_liferegression test.CI_GATE_TIMEOUT_SECONDS=5400resolves to 2700 with the explanatory log line.PLAN_REASON: ... gh: Bad credentials (HTTP 401)after 5400s). Tracking issue: Desktop release planner: 90-min source gate outlives its 60-min App token — real block reason masked as 'gh: Bad credentials (401)' #11574.