Skip to content

fix(ci): give the retention-readiness cohort a cold-compile budget so the desk-linux build can go green - #183

Merged
KooshaPari merged 3 commits into
masterfrom
fix/ci-cold-cache-build-green
Oct 27, 2026
Merged

KooshaPari merged 3 commits into
masterfrom
fix/ci-cold-cache-build-green

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

User description

Closes #182

What

Raises the Build & Test (desk-linux) retention-readiness cohort budget from
600s to 1800s, and refreshes the two comments that described the old numbers.

One semantic change to a budget. Nothing else:

Step Before After
Run deterministic retention-readiness cohort 600 1800
Compile library and binary tests 3300 3300 (unchanged, from #168)
job timeout-minutes 240 240 (unchanged, from #168)

Every other run_with_timeout.py value in the file is byte-identical: the
eight remaining 600 cohort budgets, the 900 provider-matrix budget, and the
3300 compile budget.

Why 1800

The retention step is not just running slow, it is compiling the
jcode-app-core lib-test harness cold, every cache-miss run. That harness is
never pre-built by the compile step directly above it, because
cargo metadata reports workspace_default_members = 1 -- only kcode. The
root Cargo.toml declares no default-members key, so cargo defaults to the
root package alone and cargo test --lib --bins --no-run builds just kcode's
test targets, never the cohort crates' harnesses.

Observed: run 39672218586 / job 119472777140 hit exit 124 at 600s on exactly
this compile.

The cohort itself still runs in under a second once the harness exists, so 1800s
covers the one-time cold compile and nothing more. This is a budget fix, not a
performance fix.

Relationship to #168 and #177

This branch is based on #168 (fix/ci-build-cache-blob-size) at
b24ec59031709802e54c6d17628b357c622bb15d, with one commit on top. #168
already carries the 3300 compile budget, the 240-minute job cap, and the
rust-cache blob-size fix.

This branch is therefore a strict superset of #177
(fix/ci-retention-cohort-timeout), which raises the same retention budget but
branches from master -- where the compile budget is still 900. #177 therefore
fails earlier than the original bug, at step 7 compile with exit 124, and never
reaches the retention step. The two branches also conflict with each other on the
identical timeout-minutes line.

#177 can be closed without merging once this lands.

Scope and validation

Scope is .github/workflows/ci.yml only. No Rust source, no tests, no Cargo
manifest, no other workflow file. crates/ is untouched.

Validated by static inspection only (no cargo builds -- the host disk is
saturated and CI is live):

  • git diff origin/master...HEAD --stat -> only .github/workflows/ci.yml
  • every run_with_timeout.py value diffed line-by-line against the base; the
    only value delta is 600 -> 1800
  • yaml.safe_load parses the merged tree; job timeout-minutes still 240,
    compile step still 3300
  • git merge-tree --write-tree origin/master HEAD -> clean (exit 0)
  • git merge-tree --write-tree origin/fix/ci-build-cache-blob-size HEAD -> clean
    (exit 0); merge-base --is-ancestor confirms the base is a direct ancestor
  • base branch SHA is b24ec5903 before and after, confirmed via
    git ls-remote -- published history not rewritten

Not done

No cargo/test run. This branch changes CI timeouts only and has no runtime
effect on the binary. The actual proof is a green Build & Test (desk-linux)
run on a cold cache.


CodeAnt-AI Description

Keep desk-linux build checks running when the build cache is cold

What Changed

  • Build & Test now skips the oversized workspace build cache and uses a fresh registry-only cache, avoiding repeated failed cache downloads.
  • Cold build and test compilation, including the retention-readiness cohort, now have longer time limits.

Impact

✅ Fewer desk-linux CI failures from cache restore timeouts
✅ Cold builds have time to finish compiling
✅ Retention-readiness checks can finish on a cold run

💡 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.

KooshaPari and others added 3 commits October 21, 2026 12:57
tx-agent: jcode
tx-validated: manual
tx-scope: .github/workflows/ci.yml (build job only)
tx-intent: Make Build & Test (desk-linux) able to restore its cache and go green on PR branches

The Build & Test (desk-linux) job's rust-cache blob was 2,029,470,155 bytes.
Every restore attempt aborted at a ~600s cap (617s / 605s / 600s across jobs
119054392243, 119055460640, 119065565800) at 37.4% / 39.7% / 44.0% and fell
through to "No cache found", so the job always ran cold, so the 900s compile
cap killed it, so the save step was skipped. GitHub caches are ref-scoped and
PR refs (refs/pull/N/merge) cannot read refs/heads/master, so the loop repeats.

target/ is the dominant contributor: this is the only job that puts a release
build, a --lib --bins test compile, and eight integration/e2e compiles into one
target dir. Per Swatinem/rust-cache action.yml, cache-targets:false caches only
the cargo registry, which is provably under the 687,972,881 bytes that job
119062133759 already restored successfully.

cache-all-crates was evaluated and is the wrong lever: src/save.ts calls
cleanRegistry(pkgs, crates !== "true"), so cache-all-crates:"true" skips the
registry cleanup and keeps MORE. This job already uses the pruning default.

Timeouts raised because the job is now intentionally cold: Build cold 2453s,
compile cold ~2990s.

Co-Authored-By: Jcode <[email protected]>
…pin it

  The previous rust-cache key (v0-rust-desk-linux-stablepin-build-...) had
  a 2,029,470,155-byte entry stuck on refs/heads/master. Even with
  cache-targets: "false" flipped on, the key was identical so actions/cache
  attempted to restore the 2GB blob and aborted at ~600s (37-44%). The
  post-step save was then SKIPPED because the key was immutable per
  (key, ref), so master remained pinned forever and every fresh PR paid the
  same doomed download.

  Suffix the key with -notarget. This propagates into both the primary key
  and the restore-key prefix, and matches no legacy entry -- the doomed
  restore is never attempted and the save reserves a fresh slot.

  tx-agent: jcode
  tx-validated: manual
  tx-scope: .github/workflows/ci.yml
  tx-intent: make the build job's rust-cache use a new key so cache-targets:false can actually take effect
The Build & Test (desk-linux) job cannot go green on a cold cache because
the retention-readiness cohort budget is 600s while that step pays a full
cold compile of the jcode-app-core lib-test harness.

The harness stays cold at that point: the workspace declares no
`default-members`, so `cargo test --lib --bins --no-run` builds only the
default member `kcode` and never pre-builds the cohort crates' harnesses.
Run 39672218586 / job 119472777140 hit exit 124 at 600s on exactly this.

Raise that one budget to 1800s and record why. The cohort itself still runs
in under a second once the harness is built; 1800s covers the one-time cold
compile and nothing more.

Based on #168 (fix/ci-build-cache-blob-size), which already carries the
3300s compile budget and the 240-minute job cap, so this branch is a strict
superset of #177 (fix/ci-retention-cohort-timeout), which can be closed
without merging.

tx-agent: jcode
tx-validated: manual
tx-scope: .github/workflows/ci.yml
Copilot AI balanced review requested due to automatic review settings October 22, 2026 06:42

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.

@codeant-ai

codeant-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR be1eea4 Oct 22, 2026 · 06:43 06:46

@codeant-ai

codeant-ai Bot commented Oct 22, 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

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 53181f25-fb83-40cf-8e48-d19ca64c6162
📥 Commits

Reviewing files that changed from the base of the PR and between 0d95c41 and be1eea4.

📒 Files selected for processing: 1
  • .github/workflows/ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 10
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Windows Cross-Target Check (Linux)
  • GitHub Check: Release Automation
  • GitHub Check: Build & Test (desk-linux)
  • GitHub Check: Quality Guardrails
  • GitHub Check: Format
  • GitHub Check: TypeScript SDK
  • GitHub Check: Require Linked Issue
  • GitHub Check: Kilo Code Review
  • GitHub Check: semgrep-cloud-platform/scan
🧰 Additional context used
🪛 zizmor (1.30.1)
.github/workflows/ci.yml

[warning] 1-840: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

[warning] 136-519: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

[warning] 296-296: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🔇 Additional comments: 1
.github/workflows/ci.yml: 1

149-156: LGTM!

Also applies to: 196-234, 237-256, 295-295, 301-309

📝 Summary

Summary

The workflow raises the desk-linux job cap to 240 minutes, disables target-directory caching with a new cache-key suffix, raises the library/binary test compile budget to 3300 seconds, and raises the retention-readiness cohort budget to 1800 seconds. The retention step comment explains the cold harness compile that caused the timeout. These changes address the cold-cache budget failures described in linked issue #182.

Must Fix

None identified from the inspected workflow.

Should Fix

Update the stale timeout comments at .github/workflows/ci.yml:143–149. They describe the old 35-minute cap and say 75 minutes bounds the job, but the configured cap is now 240 minutes.

Consider

The supplied evidence does not include a test run or a successful cold-cache CI result. The linked issue identifies a green cold-cache Build & Test (desk-linux) run as the proof still needed.

Approve / Request Changes

Approve with the stale-comment note. The available evidence does not establish that the cold-cache CI run has passed.

The Build & Test job timeout increases to 240 minutes. The Rust cache key changes and target-directory caching is disabled. Library and binary test compilation and the retention-readiness cohort receive longer timeouts.

Changes: Build & Test workflow

Layer / File(s) Summary
Cold-cache Build & Test settings
.github/workflows/ci.yml
The job timeout increases from 120 to 240 minutes. The Rust cache key gains a -notarget suffix, and target-directory caching is disabled. The library and binary test compilation timeout increases from 900 to 3300 seconds. The retention-readiness cohort timeout increases from 600 to 1800 seconds.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • KooshaPari/KCode#161 — This change raises the library and binary test compilation timeout, which the issue identifies as a separate cold-cache compile budget.
  • KooshaPari/KCode#176 — This change raises the retention-readiness cohort timeout from 600 to 1800 seconds, matching the issue’s reported timeout.
  • KooshaPari/KCode#167 — The issue describes cache-restore failures that can lead to a cold build; this change modifies the Rust cache key and disables target-directory caching.

Suggested reviewers: 1jehuang

Merge Risk: ⚪ Minimal · up to be1ee

No actionable merge-blocking issue is established. A cold-cache desk-linux run would confirm that the new budget is sufficient.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: increasing the retention-readiness cohort budget to support cold compilation in the desk-linux CI build.
Description check Passed The description directly explains the timeout change, its cause, scope, relationship to related work, and validation status.
Linked Issues check Passed The reviewed workflow raises Compile library and binary tests to 3300 seconds, raises Run deterministic retention-readiness cohort to 1800 seconds, and sets the Build & Test (desk-linux) job cap…
Out of Scope Changes check Passed The whole-PR diff is limited to .github/workflows/ci.yml. The registry-only cache and cache-key changes support the same cold-cache Build & Test (desk-linux) reliability objective by avoiding the …
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The reviewed workflow raises Compile library and binary tests to 3300 seconds, raises Run deterministic retention-readiness cohort to 1800 seconds, and sets the Build &amp; Test (desk-linux) job cap to 240 minutes. Comments explain the cold compile costs and the 1800-second retention rationale. The whole-PR diff changes only .github/workflows/ci.yml, as required by #182. No additional automated test is required for these timeout-only workflow changes; the reported validation is static, not a green CI run.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff is limited to .github/workflows/ci.yml. The registry-only cache and cache-key changes support the same cold-cache Build &amp; Test (desk-linux) reliability objective by avoiding the oversized cache restore. The timeout changes implement #182. No Rust source, test, Cargo manifest, or unrelated workflow file changes are present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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:M This PR changes 30-99 lines, ignoring generated files label Oct 22, 2026
@codeant-ai

codeant-ai Bot commented Oct 22, 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: be1eea4b48d8

@KooshaPari
KooshaPari merged commit 3b7f792 into master Oct 27, 2026
33 of 62 checks passed
KooshaPari added a commit that referenced this pull request Oct 27, 2026
…s jobs (#196)

Closes #195

The `Swatinem/rust-cache@v2` restore hangs for 25+ minutes on the oversized build-cache blob, and while it hangs it occupies the self-hosted runner, starving the entire CI queue.

PR #183 fixed the Build job, but the `quality`, `windows-build-test` and `windows-cross-check` jobs use their own cache keys and were still hanging (observed: job 121317250103 sat in the restore step for 26 minutes with no cargo running on the host, blocking every other run).

Give those three jobs the same treatment: a fresh `-notarget` key plus `cache-targets: "false"`, so the restore misses fast instead of downloading the oversized target/ directory.

Co-Authored-By: jcode <[email protected]>
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183 and #196 landing first.
All three conflict hunks were comment-only -- both sides already agreed on
every semantic value (job timeout-minutes 240, compile 3300s, retention
cohort 1800s, and the identical sequence of every other budget).

The resolution keeps master's comment text, which is now the canonical
wording for the merged cache and timeout fixes, and re-applies this
branch's one semantic change: the workspace-wide clippy gate.

The diff against master is exactly one line:
    cargo clippy --all-targets --all-features
 -> cargo clippy --workspace --all-targets --all-features

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict with the merged cache and timeout fixes
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183, #196 and #190 landing
first. All three conflict hunks were comment-only: both sides already
agreed on every semantic value, and the clippy gate line this branch
introduces is already on master via #190.

The resolved ci.yml is byte-identical to master. The branch's remaining
diff against master is exactly its lint fixes.

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict after the clippy and cache fixes landed
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183, #196, #190 and #198 landing
first. All three conflict hunks were comment-only -- both sides already
agreed on every semantic value, and the timeout and cache fixes this
branch carried are now on master.

The resolved ci.yml is byte-identical to master. The branch's remaining
diff against master is exactly the dictation test budget change.

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict after the timeout and cache fixes landed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): Build & Test (desk-linux) cannot go green on a cold cache: compile budget 900s and retention-cohort budget 600s both too tight

2 participants