Repository navigation
Host limits wait for free disk space (#2091) - #2104
Merged
Merged
Conversation
A new [resources] min_available_disk_mb, 5120 by default, delays new sessions while free space on the worktrees' filesystem, or the temporary directory's when lower, is below it. The CLI and Console Resources snapshot show available disk and its minimum.
…adiness tests Name the disk wait on the architecture page, in the Command limit's glossary entry and guide; rename worktree_parent; tests that expect a ready host set a 1 MB disk minimum so a small TMPDIR can't flip them.
Merged
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.
Summary
Host limits gain a third check, free disk space. It is on by default, so a full disk delays new sessions instead of letting them fail on
git worktree addor Session trace writes.[resources] min_available_memory_mb = 0 # 0 disables; default 0 max_load_per_cpu_percent = 0 # 0 disables; default 0 +min_available_disk_mb = 5120 # free MB where worktrees and temporary files go; 0 disables; default 5120[resources]was missing from the guide's copy of the setup defaults. This PR adds it.Seams tested:
Limits::assessandworktree_parent: unit tests.DEFAULTSand parsing: unit tests.thirdshift config resources.min_available_disk_mbround-trip:tests/user_config.rs.thirdshift resources [--json]:tests/resources.rs.tests/console/resources.rsandconsole/tests/resources.test.cjs.Evidence
Execution evidence
The User config sets
[resources] min_available_disk_mb = 9007199254740991, then the commandthirdshift resourcesruns.main):cargo test --bin thirdshift resources::tests:The run covers these tests:
Final validation:
scripts/affected-tests main.Passed: site,
cargo build --lockedand the Console browser tests.cargo test: two runs each hit one flaky failure in an unrelated binary, and both of those tests pass when run alone.tests/process/findings.rs: 18/18 passed, twice.working-targets.test.cjs: 3/3 passed.cargo test --no-fail-fastover the whole Rust suite then ran on the final head. Every binary passed excepttests/process.rs, where 238 passed and 2 failed:findings::fixing_dispatches_each_reproduced_finding_and_keeps_unreproduced_findings_privatefindings::closing_rechecks_each_merged_base_and_leaves_a_failing_finding_for_the_day_shiftBoth fail with "created public issue(s) outside the staged path: Keeping the PR mergeable: merge the Base branch and conflict Repair #8". The fake
ghstamps issues to the second, so a second publishing session'sissues_created_sincewindow can catch the first session's issue. Nothing in this PR touches Security fix publishing. Rerun on their own, both pass:cargo test --test processgave 240 passed and 0 failed. CI is the independent run.Visual evidence
Console Resources page,
/resources, with memory 2048 MB and load 100%; the disk minimum is left at its default.Desktop, 1440×900
Mobile, 390×844
Merge Danger
Door: two-way
Setting
min_available_disk_mb = 0or reverting restores today's behaviour. No data is migrated.Blast Radius: machine-wide
[resources]now measures the host before each session, where it used to skip measuring altogether.thirdshift resourcesmeasure the directory they were started in. See the triage issue below.Review
Fixed point:
refs/remotes/origin/main. The Standards reviewer raised 7 findings and the Spec reviewer raised 3.Fixed:
site/architecture/index.htmlnow names the disk wait.worktree_parent(cwd).TMPDIRon a 100 MB tmpfs.resources::console_header_shows_host_admission_and_reloads_limitsfailed attests/console/resources.rs:54, as the finding said. Tests that expect a ready host now setmin_available_disk_mb = 1, both in Rust and in the browser test. Rerunning the command, both console resources tests pass.is_ok().Full-suite validation also caught
tests/console/github.rs::history_freezes_do_not_wake_an_unchanged_inbox. It compared two full Inbox renders, and the header now carries live measurements, so it now compares the page below</header>.Review coverage:
site/docs/index.html.npm run docs:check --prefix sitepasses.GLOSSARY.mdsite/architecture/index.htmlconsole/tests/resources.test.cjstests/console/github.rsUnaddressed findings
Standards
src/worktree.rssibling()needs aGitfor the launch repository and runsgit rev-parse --show-toplevel.resources::observehas noGit. It runs on every 10-second Console header poll and outside any repository, for example a Console started from~.worktree_parent(src/resources.rs) walks to the nearest.gitwithout spawning git, and falls back to the directory itself.Spec
thirdshift resourcesmeasure the directory they were started in, which may not be any Launch directory.sibling().[resources]block.grep -n "can't read host CPU load" -B8 src/resources.rs, confirms the order: reads happen before the limits are consulted.getloadavgandstatvfsreliably succeed.Closes #2091
Built with claude 2.1.314 · opus · default effort
Security review outcome
No unaddressed introduced findings.