Skip to content

fix(ci): give the test-binary compile step real headroom on a cache miss - #164

Closed
KooshaPari wants to merge 2 commits into
masterfrom
fix/ci-compile-timeout-headroom
Closed

KooshaPari wants to merge 2 commits into
masterfrom
fix/ci-compile-timeout-headroom

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

The build job reports a false failure on a cache miss: the compile step is killed by its own timeout, not by a compile error.

Evidence

  • Run 39523965735 (2026-10-21): rust-cache logged Failed to restore: Server failed to authenticate the request, so the job ran fully cold.
  • The preceding Build step took 2453s cold vs 520s warm (~4.7x).
  • Compile library and binary tests was killed at ~909s with exit 124 while still compiling transitive deps (last crate: crypto-bigint v0.5.5).
  • On the last green run 39390720989 the same step took 634s against a 900s cap (70.4% utilization, under 30% headroom). At the observed 4.7x cold:warm ratio, the cold cost of this step exceeds 900s. The budget was never sufficient on a cache miss.

Changes (both in .github/workflows/ci.yml, build job only)

  1. Step timeout 900s to 2400s. A timeout relaxation for a provably-too-tight budget, not a gate weakening. 2400s is ~3.8x the warm cost and consistent with the observed cold:warm ratio. Worst-case job wall clock is ~6900s (115m), inside the job-level timeout-minutes: 120 (7200s). The step still aborts the job on exit 124 if the compile genuinely hangs.
  2. Add cache-all-crates: "true" to the build job rust-cache step, matching the quality, windows-build-test, and windows-cross-check jobs that already do this. Defense in depth for future transient cache misses.

Explicitly not done

RUSTC_WRAPPER=sccache is not re-exported: the existing comment at the Build step documents that sccache emitted artifacts stamped <unknown rustc version> that the non-sccache test compile rejected with E0514. Preserved verbatim.

No assertion, gate, or test step is removed, skipped, or weakened. The quality, fmt, typescript-sdk, windows-*, and setup-friction jobs are untouched.

Closes #161


CodeAnt-AI Description

Prevent CI compile jobs from timing out on cache misses

What Changed

  • The test compilation step now has enough time to complete on a cold cache instead of being stopped after 15 minutes.
  • CI now caches all crates so a later run can recover more quickly after a cache miss.

Impact

✅ Fewer CI failures on cold caches
✅ Faster recovery after cache misses

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Run 39523965735 (2026-10-21) failed at "Compile library and binary tests"
with exit 124 (timeout-killed mid-compile at 909s, last logged crate
crypto-bigint v0.5.5). The preceding rust-cache restore step recorded an
auth-header error, so the build ran fully cold. The warm-cache baseline
on the same step (run 39390720989, 2026-10-20) was 634s against a 900s
cap -- a 70.4% utilization that left almost no headroom; the cold-cache
Build step ran 2453s vs 520s warm (a 4.7x ratio), so the cold-compile
cost of compiling every crate's --lib --bins test harness comfortably
exceeds 900s.

Two surgical edits to .github/workflows/ci.yml:

1. Add `cache-all-crates: "true"` to the build job's rust-cache step.
   Matches the other three jobs (quality, windows-build-test,
   windows-cross-check) that already cache every crate. Defense in
   depth -- a future cache miss rehydrates faster instead of
   re-downloading 200+ registry crates on every cold job.

2. Raise the "Compile library and binary tests" step timeout from 900s
   to 2400s. This is a timeout RELAXATION for a provably-too-tight
   budget, not a gate weakening:
   - 2400s ~= 3.79x warm-cache cost (634s), matching the empirical
     4.7x cold:warm ratio observed on the Build step.
   - Worst-case job wall-clock (Build cold 2453 + Compile cold 2400 +
     downstream ~1500 + overhead) ~= 6900s = 115m, fits inside the
     job-level timeout-minutes: 120 (= 7200s).
   - The step still gates the job on exit 124 if the compile genuinely
     hangs; no assertion, gate, or test step was removed, skipped, or
     weakened.

Did NOT consider RUSTC_WRAPPER=sccache: the existing comment at the
Build step documents its incompatibility with this exact --lib --bins
target (sccache emits rlibs stamped <unknown rustc version> that the
non-sccache test compile rejects with E0514). Preserved verbatim.

tx-agent: jcode
tx-validated: none
Copilot AI balanced review requested due to automatic review settings October 21, 2026 05:03
@codeant-ai

codeant-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 35f638d Oct 21, 2026 · 05:04 05:08

@codeant-ai

codeant-ai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7da8d22b-a8ea-4ec8-a488-c0128e15e69d
📥 Commits

Reviewing files that changed from the base of the PR and between 2aea04d and f0c7d2c.

📒 Files selected for processing: 1
  • .github/workflows/ci.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 21, 2026
@KooshaPari

Copy link
Copy Markdown
Owner Author

Orchestrator note: job-budget correction in flight

A follow-up commit is being added to this branch. The first commit's job-wall-clock arithmetic omitted the Post Run Swatinem/rust-cache@v2 step, which took 2042s (34m) in the green run 39390720989.

Measured cold-cache worst case (run 39523965735 setup, plus the green run downstream baseline):

setup (checkout+toolchain+failed cache restore)   833s
Build (cold)                                     2453s
Compile library and binary tests (cap)           2400s
downstream test steps (green baseline)           1863s
post rust-cache save                            2042s
------------------------------------------------------
TOTAL                                           9591s = 160m

against a job-level timeout-minutes: 120 = 7200s. That is over budget by ~40 minutes.

Why this matters more than a timeout

The job-level timeout would cancel the job. Every downstream test step (retention cohort, pty cohort, embedding cohort, TUI library tests, provider matrix, e2e, warning budget, security preflight) would be reported SKIPPED rather than FAILED. A green compile step with a cancelled job reads as "the compile passed" while every actual test never ran — the exact gate-dropping outcome this issue forbids.

The follow-up commit will raise the job budget to fit the true cold worst case and correct the explanatory comment to state the real arithmetic. No test step will be removed, skipped, or reordered, and no gate will be weakened.

@codeant-ai

codeant-ai Bot commented Oct 21, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 35f638dc1196

@kilo-code-bot kilo-code-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The downstream budget figure in this comment (~1500s) does not match the sum of the downstream step timeout caps in this same job. After the compile step, the remaining run_with_timeout.py calls total 7500s (eleven 600s steps plus the 900s integration-test compile step), so the worst-case sum of step timeouts is Compile 2400 + downstream 7500 = 9900s (plus the unbounded Build step) — which already exceeds the job-level timeout-minutes: 120 (7200s) on its own. The 900s → 2400s step timeout itself is well supported by the evidence cited and is a safe relaxation, but the 'fits inside the job-level budget' justification is not supported by the stated arithmetic. Either correct the downstream figure, or clarify that it reflects measured runtime rather than the sum of the step timeout caps.

Comment thread .github/workflows/ci.yml Outdated
# took 2453s cold (vs 520s warm, a ~4.7x ratio), so the cold-cache
# cost of compiling every crate's `--lib --bins` test harness comfortably
# exceeds 900s. 2400s keeps the step inside the job-level budget
# (Build=2453 + Compile=2400 + downstream ~1500 = 6353s = 106m, well

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The downstream budget estimate in this comment (~1500s) does not match the sum of the downstream step timeout caps in this same job. After the compile step, the remaining run_with_timeout.py calls total 7500s (eleven 600s steps plus the 900s integration-test compile step), so the worst-case sum of step timeouts is Compile 2400 + downstream 7500 = 9900s (plus the unbounded Build step) — which already exceeds the job-level timeout-minutes: 120 (7200s) on its own. The 900s → 2400s step timeout itself is well supported by the evidence cited and is a safe relaxation, but the 'fits inside the job-level budget' justification is not supported by the stated arithmetic. Either correct the downstream figure, or clarify that it reflects measured runtime rather than the sum of the step timeout caps.

@kilo-code-bot

kilo-code-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • .github/workflows/ci.yml
Previous Review Summary (commit 35f638d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 35f638d)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/ci.yml 244 The downstream budget figure in the new comment (~1500s) does not match the sum of the downstream step timeout caps in this job. After the compile step, the remaining run_with_timeout.py calls total 7500s (eleven 600s steps plus the 900s integration-test compile step), so the worst-case sum of step timeouts is Compile 2400 + downstream 7500 = 9900s (plus the unbounded Build step) — which already exceeds the job-level timeout-minutes: 120 (7200s) on its own. The 900s → 2400s step timeout itself is well supported by the evidence cited and is a safe relaxation, but the "fits inside the job-level budget" justification is not supported by the stated arithmetic.
Files Reviewed (1 file)
  • .github/workflows/ci.yml - 1 issue

Reviewed by free · Input: 42.5K · Output: 2.6K · Cached: 260.9K

…he save

The previous PR commit (35f638d) raised the "Compile library and binary
tests" step from 900s to 2400s and argued the cold worst case was
~115m, fitting inside the 120m job-level budget. That arithmetic was
wrong on two counts:

1. It omitted the `Post Run Swatinem/rust-cache@v2` step. Re-verified
   from the green run 39390720989 (Build & Test 118521303106) that step
   ran 08:54:51 -> 09:28:53 = 2042s = 34.1m. Job-level
   `timeout-minutes: 120` covers the entire job including post steps.

2. It underestimated the cold Compile cost. Re-verified from cold run
   39523965735 (Build & Test 118974171983): Build cold = 2453s vs warm
   520s = 4.7x ratio. Warm Compile:Build ratio is 634/520 = 1.219, so
   cold Compile extrapolates to 2453 * 1.219 ~ 2990s. 2400s would still
   kill the step mid-compile with exit 124 in cold mode, failing the
   job and reporting every downstream test step (retention cohort,
   pty cohort, embedding cohort, TUI lib tests, 4 audit B-7b lib
   tests, integration compile, provider matrix, e2e, warning budget,
   security preflight) as SKIPPED rather than FAILED. That is the
   silent-gate-drop failure mode issue #161 / PR #164 explicitly
   forbid.

Cold worst case with the corrected budgets (all measured or soundly
extrapolated, all in seconds):

  setup (checkout + toolchain + failed cache-restore 735s + mold)  814
  Build (cold, measured)                                          2453
  Compile (extrapolated cold cap with 10% margin)                 3300
  downstream (green baseline, steps 8-22 summed: 267+187+147
    +13+422+24+65+66+14+135+226+51+228+18 = 1863)                 1863
  post-cache-save (green baseline)                                2042
  post-checkout                                                     8
  TOTAL                                                          10480
                                                                  = 174.7m

vs new job cap 240m = 14400s: 37% (65m) margin. Warm baseline 5106s
still leaves 75% headroom under the new cap.

Edits:

  jobs.build-and-test-desktop timeout-minutes: 120 -> 240
  jobs.build-and-test-desktop Compile step timeout: 2400 -> 3300
  Updated the explanatory YAML comments on both to spell out the math
  including the post-cache-save step and the cold Compile extrapolation,
  and to state the failure mode (exit 124 -> SKIPPED, not FAILED) that
  PR #164 is designed to prevent.

Did NOT change anything else: no test step removed, skipped, reordered,
or weakened; no gate relaxed; the `Build` step's
`RUSTC_WRAPPER=sccache` warning comment preserved verbatim; all other
jobs (`quality`, `format`, `typescript-sdk`, `windows-*`, `setup-friction`)
untouched. The `cache-all-crates: "true"` change from 35f638d is kept.

tx-agent: jcode
tx-validated: lint
KooshaPari added a commit that referenced this pull request Oct 21, 2026
…olved conflicts

The recomputed residuals (recomputed against origin/master 2aea04d
via git merge-tree --write-tree) now cover 12 open PRs in the KCode
stack. The four PRs previously flagged as needing hand-resolved
conflicts (#140, #127, #157, #158) have already been merged against
origin/master by a parallel agent as real 2-parent merge commits at
d6e4cfa, b6508e6, 264c09a, and 47b42e2 respectively; merge-tree
reports zero conflict markers for all four. Two new PRs (#163 transport
pipe-stem, #164 CI timeout headroom) extend the stack to 12.

The CI Quality Guardrails clippy gate has a coverage gap that no
existing PR fixes: the command is 'cargo clippy --all-targets
--all-features -- -D warnings' with no --workspace, so exactly one
workspace member (jcode-sdk) is unreachable from the root package and
is never linted. In the green run id 39390720989 the cargo test -p
jcode-sdk parity step still emitted the 'never used' warning for the
Subscriber alias at crates/jcode-sdk/src/client.rs:330. The --workspace
change is NOT a no-op and may surface additional pre-existing
violations; this is recorded as an OPEN RISK, not a resolved fact.

The KCode self-hosted runner desk-kcode-1 wedged on 2026-10-21 in the
Build & Test (desk-linux) job of run 39530002307. Root cause: the
desk WSL2 instance is capped by .wslconfig at memory=16GB (not the
64GB the Windows host has), was competing with a 1h43m orphaned
cargo llvm-cov --workspace job, and the Build step in
.github/workflows/ci.yml has no per-step run_with_timeout.py wrapper.
Remediation (terminating the orphan) brought memory from 13.9/16 GB to
9.4/16 GB and recovered the runner.

Detailed conflict resolutions and the runner wedge root-cause analysis
moved to a new companion file 05a_MERGE_EVIDENCE.md so the plan itself
fits the 500-line cap.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/sessions/2026-10-19-orchestration-governance/
tx-intent: Refresh the merge plan against recomputed 12-PR residuals + 4 applied conflict resolutions + clippy coverage gap + runner wedge
@KooshaPari

Copy link
Copy Markdown
Owner Author

@KooshaPari KooshaPari closed this Oct 27, 2026
@KooshaPari
KooshaPari deleted the fix/ci-compile-timeout-headroom branch October 27, 2026 06:05
KooshaPari added a commit that referenced this pull request Nov 28, 2026
… plan (#375)

* docs(sessions): add cross-harness orchestration governance proposal

Proposes 4 enforcement mechanisms for the "Always Subagent — main context is management-only" operator directive (2026-10-11 21:08); records the 2026-10-19 manual cross-harness propagation of the rule to all 4 derivative AGENTS.md copies (codex, forge, kcode, helioslite); lists operator-approved next steps (none yet; each mechanism awaiting decision).

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: capture the cross-harness propagation decision + enforcement backlog in the repo

* docs(sessions): add fix-forward merge integration plan for the KCode PR stack

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: give the operator a no-force-push merge order for PRs #152/#127/#140/#148/#129/#132/#134/#150/#145

* docs(ci): rebuild the merge integration plan against master 2aea04d

tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth

* docs(ci): rebuild the merge integration plan against master 2aea04d

tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth

* docs(merge): refresh the merge plan with the recomputed stack and resolved conflicts

The recomputed residuals (recomputed against origin/master 2aea04d
via git merge-tree --write-tree) now cover 12 open PRs in the KCode
stack. The four PRs previously flagged as needing hand-resolved
conflicts (#140, #127, #157, #158) have already been merged against
origin/master by a parallel agent as real 2-parent merge commits at
d6e4cfa, b6508e6, 264c09a, and 47b42e2 respectively; merge-tree
reports zero conflict markers for all four. Two new PRs (#163 transport
pipe-stem, #164 CI timeout headroom) extend the stack to 12.

The CI Quality Guardrails clippy gate has a coverage gap that no
existing PR fixes: the command is 'cargo clippy --all-targets
--all-features -- -D warnings' with no --workspace, so exactly one
workspace member (jcode-sdk) is unreachable from the root package and
is never linted. In the green run id 39390720989 the cargo test -p
jcode-sdk parity step still emitted the 'never used' warning for the
Subscriber alias at crates/jcode-sdk/src/client.rs:330. The --workspace
change is NOT a no-op and may surface additional pre-existing
violations; this is recorded as an OPEN RISK, not a resolved fact.

The KCode self-hosted runner desk-kcode-1 wedged on 2026-10-21 in the
Build & Test (desk-linux) job of run 39530002307. Root cause: the
desk WSL2 instance is capped by .wslconfig at memory=16GB (not the
64GB the Windows host has), was competing with a 1h43m orphaned
cargo llvm-cov --workspace job, and the Build step in
.github/workflows/ci.yml has no per-step run_with_timeout.py wrapper.
Remediation (terminating the orphan) brought memory from 13.9/16 GB to
9.4/16 GB and recovered the runner.

Detailed conflict resolutions and the runner wedge root-cause analysis
moved to a new companion file 05a_MERGE_EVIDENCE.md so the plan itself
fits the 500-line cap.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/sessions/2026-10-19-orchestration-governance/
tx-intent: Refresh the merge plan against recomputed 12-PR residuals + 4 applied conflict resolutions + clippy coverage gap + runner wedge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): 900s compile-test timeout is too tight on a cache miss and reports a false failure

2 participants