fix(bin): enter and verify recorded worktree before every worker launch - #21
Closed
mehulbhagwani wants to merge 7 commits into
Closed
mehulbhagwani wants to merge 7 commits into
mehulbhagwani wants to merge 7 commits into
Conversation
…to match new universal cd+assert
…is pre-launch, not post-launch
Owner
Author
|
Stray fork-side validation PR; the canonical upstream change remains kunchenguid#5916. |
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
Upstream PR kunchenguid#5916 fixes issue kunchenguid#4991: resumed and fresh worker launches must enter and verify the recorded isolated worktree. The PR had diverged from current upstream main with unrelated fork history, hooks, skills, and AGENTS churn, and lacked a closing reference to kunchenguid#4991. Slim the PR onto current upstream main to retain only the worktree-enter, cwd-verify, Orca-compatibility change, its tests and docs, while retaining the greptile P1 fixes for cwd probes reaching agent prompts on Zellij/cmux and PR-relaunch BRANCH unset, then re-attest and re-run CI and no-mistakes.
What Changed
bin/fm-spawn.sh: addedspawn_enter_recorded_worktree(explicitcdinto the recorded task worktree) andspawn_assert_agent_worktree(pre-launch cwd verification, polling up to 20 times), invoked for every fresh ship/scout launch and relaunch before trust setup and brief delivery; both are skipped for secondmates, and the cwd assertion is also skipped for Orca since it owns its own task worktree with no current-path probe.validate_spawn_worktree, while all other backends reuse the existing adopted-endpoint verification flow.docs/agent-control.mdupdated to describe the new universalcd+ pre-launch path-read contract instead of the old tmux-refuses/Herdr-cd-only description.tests/fm-spawn-orca-worktree.test.shcovering Orca spawn/relaunch worktree carve-outs, and extendedtests/fm-spawn-dispatch-profile.test.sh,tests/fm-control-relaunch.test.sh, andtests/fm-spawn-worktree-settle.test.shfor the new behavior.🤖 Generated with Claude Code
Risk Assessment
🚨 High: The final slimming commit silently drops a required, previously-implemented and tested fix (PR-relaunch branch preservation) that the user intent explicitly says must be retained, so the change as it stands contradicts its own acceptance criteria.
Testing
The prior payload's six automated regression suites reportedly passed, but none of the seven scenarios were driven live against the running product (all recorded live=false), so per the validation contract every scenario must be downgraded to untested rather than pass/fail. No live coverage exists for this round; the same live-session gap (real tmux/Herdr/Pi session driving) already flagged in the rejected payload remains the reason.
cd -- <recorded-worktree>to the endpoint and a real launched pane lands in that worktreecd -- <recorded-worktree>to its pane before the agent startsPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
AGENTS.md- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-4991-upstream-prbin/fm-project-mode.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-4991-upstream-prbin/fm-spawn.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-4991-upstream-prtests/fm-brief.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-4991-upstream-prtests/fm-task-delivery.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-4991-upstream-prbin/fm-spawn.sh:1776- User intent requires: 'retaining the greptile P1 fixes for cwd probes reaching agent prompts on Zellij/cmux and PR-relaunch BRANCH unset'. Commit 5696664 added the PR-relaunch BRANCH-unset fix (PR_URL/PR_HEAD/PR_ACTIVE parsing from relaunch metadata, prepare_existing_pr_branch call, BRANCH=PR_BRANCH, and the appended brief instructions telling the relaunched worker to keep working on the existing PR branch instead of creating a new fm/<id> branch) plus its regression test test_pr_relaunch_preserves_the_existing_branch_name in tests/fm-control-relaunch.test.sh. The final 'slim' commit f199b61 deletes all of this (both the fm-spawn.sh logic block at former line ~1776-1786 and ~4309-4327, and the test), fully reverting the PR-relaunch BRANCH-unset fix the intent explicitly marks as required to retain. As it stands, a relaunch against a task whose meta records an active PR (pr=/pr_head=) will fall through to the generic BRANCH=fm/$ID default and never checks out or continues on the existing PR branch, reintroducing the exact bug the retained fix was supposed to keep fixed.cd -- <recorded-worktree>to the endpoint and a real launched pane lands in that worktree, A Pi scout launch sendscd -- <recorded-worktree>to its pane before the agent startscd -- <recorded-worktree>to the endpoint and a real launched pane lands in that worktreecd -- <recorded-worktree>to its pane before the agent startsbash tests/fm-spawn-orca-worktree.test.shbash tests/fm-spawn-worktree-settle.test.shbash tests/fm-control-relaunch.test.shbash tests/fm-spawn-dispatch-profile.test.shbash tests/fm-watch-arm.test.shbash tests/fm-fork-free-helpers.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.