Repository navigation
fix(bin): extend treehouse worktree wait - #9
Conversation
…eehouse get to enter a worktree
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebe0a6713d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case $worktree_wait_secs in | ||
| '' | *[!0-9]* | 0) worktree_wait_secs=600 ;; |
There was a problem hiding this comment.
Treat all zero-valued waits as the documented default
When FM_SPAWN_WORKTREE_WAIT_SECS is set to a zero-valued string such as 00 or 000, this case statement does not match it, so seq 1 "$worktree_wait_secs" produces no polls and spawn refuses immediately instead of using the documented 600-second default for zero values. Normalize numeric zero values before entering the loop (or reject them consistently with the documentation).
Useful? React with 👍 / 👎.
Notes on scope and decisions
|
Intent
The machine is under load, so give treehouse some time to install dependencies and prepare the worktree before fm-spawn gives up.
Context: bin/fm-spawn.sh waits for
treehouse getto enter an isolated worktree with a fixed loop of 60 one-second polls (around the "did not enter an isolated worktree within 60s" error, roughly line 5165-5185). On a loaded machine a large project's worktree needs longer for its dependency install, so the spawn fails at 60 s, leaving an empty Rex tab and a leased worktree behind that the next spawn then trips over ("a Rex block labeled ... already exists").What Changed
treehouse getworktree-settling limit with a configurableFM_SPAWN_WORKTREE_WAIT_SECSpoll window, defaulting to 600 seconds and falling back for blank, zero, or non-numeric values.Risk Assessment
✅ Low: The change is narrowly scoped to making the existing treehouse worktree-settle polling duration configurable, documents the default and fallback behavior, and adds behavioral coverage without changing the surrounding spawn state transitions.
Testing
The targeted spawn regression suite passed, including transient-path protection, the 600-second default, the environment override, and deadline refusal. A real Herdr lab drove a Treehouse-backed spawn and produced backend/worktree metadata; all disposable lab and accidental checkout residue was removed, and the source worktree remains clean. No linters or full-suite tests were run.
Evidence: Focused spawn regression output
Evidence: Real Herdr spawn transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-spawn-worktree-settle.test.shReal named-lab Herdr lifecycle viabin/fm-herdr-lab.sh provision,run, andteardownReal Herdr pane execution offm-spawn.shwithFM_SPAWN_WORKTREE_WAIT_SECS=7and the runbook environment scrubtreehouse destroy --include-unlanded --yeson the exact damaged disposable checkout left by the live rungit status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.