Repository navigation
fix(bin): refuse a Treehouse pool slot of another clone and pin Treehouse 3.1.2 - #7092
Open
robkerr1992 wants to merge 1 commit into
Open
robkerr1992 wants to merge 1 commit into
robkerr1992 wants to merge 1 commit into
Conversation
…ouse 3.1.2 Treehouse names a pool by repository name and origin, so a root home and a secondmate home that each clone one origin share a pool, and Treehouse before 3.0.0 hands out any free slot of it. A secondmate spawn for bodl was handed a linked worktree of the root home's clone and stopped at the trust pre-registration with no hint of the cause. Treehouse 3.0.0 reuses a slot only for the clone that owns it. The spawn now refuses a pool slot whose git common dir is not the spawning clone's and names the Treehouse requirement, CI pins Treehouse 3.1.2, and the regression covers both the refusal and a real Treehouse 3 handing the second clone its own slot.
Owner
|
Speaking as Kun's firstmate: thanks @robkerr1992 — nice diagnosis of the shared-pool slot. My read (own verdict):
Status: waiting on CI only. If CI (including the Herdr lane on Treehouse 3.1.2) and no-mistakes come back green and it stays mergeable, I'll squash-merge on the next pass. |
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.
Intent
fix the pool bug
Context: on 2026-10-11 the main home seeded secondmate homes that clone projects the main home also clones (drew: bodl; fleet: wrinkle, orb, ergo, nandi; montana: montana). When the drew secondmate (home ~/.treehouse/firstmate-39d647/6/firstmate, clone projects/bodl there) ran
bin/fm-spawn.shfor a bodl ship, Treehouse handed it slot/.treehouse/bodl-c434c4/1/bodl, which is a linked worktree of the MAIN home's clone (/projects/firstmate/projects/bodl), not of the secondmate's own clone, and the spawn refused at the Claude trust pre-registration. Nothing was changed. The ask is that a secondmate can spawn workers for a project that another home also clones.upgrade treehouse
(This was the answer, on 2026-10-11, to the choice of fixing it by upgrading Treehouse from 2.1.1 to 3.1.2, whose pool reuses a slot only for the clone that owns it, with Firstmate refusing a slot of another clone with a message naming the Treehouse requirement, a regression test, and the CI Treehouse pin moved to 3.1.2.)
What Changed
bin/fm-spawn.shnow checks the slot thattreehouse gethands out. If the slot sits in a managed Treehouse pool but belongs to a different clone of the same origin (for example, the root home's clone when a secondmate home is spawning), the spawn stops before it writes any trust or task state. The error names both git common dirs and the installed Treehouse version, and says to upgrade to Treehouse 3.0.0 or later. The check uses a newfm_treehouse_pool_layouthelper inbin/fm-wake-lib.sh, split out fromfm_treehouse_pool_slot.bin/fm-install-treehouse.shnow pins Treehouse v3.1.2 instead of v2.0.1, with updated SHA256 checksums for each platform. From 3.0.0 on, Treehouse's pool reuses a slot only for the clone that owns it.docs/configuration.mdnotes that two homes cloning the same origin need Treehouse 3.0.0 or later.tests/fm-spawn-worktree-settle.test.shadds a setup with two clones that share one pool, and three tests:treehousebinary gives the spawning clone its own slot.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change matches the intent. It pins Treehouse 3.1.2 in the CI installer and adds a refusal that names the Treehouse requirement. The refusal runs only for a slot that sits in a Treehouse pool but whose git common dir differs from the spawning clone's, before any claim, trust or metadata is written. Extracting fm_treehouse_pool_layout keeps fm_treehouse_pool_slot's behaviour for its existing teardown and spawn callers.
Testing
I ran the targeted spawn test file; all its cases passed, including the one that uses the real Treehouse 3.1.2. In a throwaway HOME I installed the pinned 3.1.2 (checksum verified) and the old 2.0.1. With two clones of one origin and real
treehouse get, 2.0.1 gave the second clone the first clone's slot, which is the incident. 3.1.2 gave the second clone its own slot. I then ran fm-spawn on each slot real Treehouse handed out, with a fake tmux backend and agent CLI. On the 2.0.1 slot it refused with a message naming Treehouse 3.0.0 and wrote no meta, slot claim or Claude trust entry. On the 3.1.2 slot it launched, recorded and claimed the slot, for both claude and codex. The new regression test fails on the pre-fix code; there the codex spawn actually launched in the other clone's slot. Not covered live: a full lab primary on a real tmux socket driving a real agent. Spawn ran with a fake backend, but the Treehouse slot handout was real. There is no UI surface. I removed all temp dirs and the worktree is clean.Evidence: Real Treehouse v2.0.1 hands the second clone another clone's slot (incident repro)
Source: Real Treehouse v2.0.1 hands the second clone another clone's slot (incident repro)
Evidence: Real Treehouse v3.1.2 hands the second clone its own slot
Source: Real Treehouse v3.1.2 hands the second clone its own slot
Evidence: fm-spawn refuses the v2.0.1 other-clone slot and launches in the v3.1.2 own-clone slot (claude and codex)
Source: fm-spawn refuses the v2.0.1 other-clone slot and launches in the v3.1.2 own-clone slot (claude and codex)
Evidence: Pinned installer fetches and verifies Treehouse 3.1.2
Source: Pinned installer fetches and verifies Treehouse 3.1.2
Evidence: New regression test fails against the pre-fix code
Source: New regression test fails against the pre-fix code
Evidence: Targeted spawn test file output on the change
Source: Targeted spawn test file output on the change
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-spawn-worktree-settle.test.sh(new other-clone refusal, own-clone accept, and real-Treehouse v3.1.2 cases)bin/fm-install-treehouse.sh <tmp>/th3: the pinned v3.1.2 darwin-arm64 checksum verified and the binary installedfm-install-treehouse.shfrom the base commit, run to install the old v2.0.1 into a temp dir for comparisonRealtreehouse get --lease/return --force/get --leaseacross two clones of one origin with a throwaway HOME, under v2.0.1 and under v3.1.2bin/fm-spawn.sh(fixture backend: fake tmux and agent CLI, throwaway FM_HOME/HOME) given each slot real Treehouse handed out, with the claude and codex harnessesThe new regression test file run against the pre-fix base-commit code fromgit archive e0d95ac7✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.