Repository navigation
fix: wrapper commands run straight through, and a smaller memory boost - #25
Merged
Merged
Conversation
A command that wraps other taskguard jobs, such as `taskguard bun run ci:local` around a turbo run, was queued as one job. It booked the memory of its biggest run, a full build of up to 20 GB, also when turbo's cache left almost nothing to do, and the jobs inside it ran unqueued under its claim. On one machine such wrappers waited 995 minutes in 17 days. Each nested call now leaves a note for the job it runs in (`nested/<outer>.<pid>`), and the run records how many it got (new nullable column `nested_jobs`, in `runs` and `pruned_runs`). A command whose last runs started taskguard jobs inside them runs straight through, with one line saying so, and the jobs inside it queue on their own. A long-lived job, a job in a pool, and a job with a minimum stay queued. A run starved of memory now raises the next need by 25% only when it reached 90% of its need. Outside the wrappers, 340 of 344 boosted runs never used the extra room. Closes #24 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #24.
Problem
Agents run
taskguard bun run ci:localandtaskguard sh -c "git fetch … && git merge … && bun install && bun run ci:local". Inside, turbo starts package scripts that calltaskguardagain; a nested call runs straight through, so the whole pipeline was one job. It learned "max of the last 10 runs": a full build (20 GB) also when turbo's cache left almost nothing to do (0.1 GB). These wrappers waited 995 minutes in 17 days on one machine, and held 20 GB booked while they ran.Change
nested/<outer>.<pid>in the state directory). At its end the job records how many it got (runs.nested_jobs). A command where any of its last runs had nested jobs runs straight through, with one line saying so; the jobs inside it then queue on their own, each by its own need. "Any of the last runs" covers a run where turbo's cache started nothing.taskguard prune 'KEY' --applyforgets the history, so the command queues again.git merge,bun install) now run unguarded, as they do when run bare.Tests
a_command_that_wraps_taskguard_jobs_runs_straight_through_next_time(CLI, real binary): first run queued withnested_jobs = 1, second run straight through, inner job recorded on its own.a_run_with_jobs_inside_it_makes_its_command_a_wrapper,a_starved_run_raises_the_need_only_when_it_reached_it,nested_calls_leave_notes_for_their_outer_job.Mixed versions
nested_jobs, inrunsandpruned_runs(added on open), and inRUN_COLUMNS. Older versions insert NULL and ignore it; an older prune drops the value, which only makes the command queue again.queue::Entry,machine::MachineSample, or job keys.🤖 Generated with Claude Code