fix(spawn): support same-task OMP relaunch after exit - #130
Merged
Conversation
The early OMP artifact guard in fm-spawn.sh treated existing task metadata and runtime markers from a prior /exit as a new-spawn collision, so a legitimate same-task --relaunch was refused. - Allow relaunch of an OMP ship/scout when the recorded endpoint is missing/dead, the task identity matches, and the recorded worktree still exists. - Recover --mode, --yolo, --prewalk-into, and --allow-project-omp-extensions from the prior meta when the caller omits them, preserving the original launch profile. - Keep the fail-closed collision guard for fresh spawns and refuse active, ambiguous, unreadable, or mismatched relaunches. Add a portable fake-tmux/fake-omp regression for the guard, profile recovery, and negative boundaries; add an opt-in live tmux/OMP lab that exits a real worker and relaunches it, verifying worktree, dirty sentinel, pending inbox, and generation isolation. Verified by: - tests/fm-omp-relaunch-guard.test.sh - tests/fm-spawn-worktree-settle.test.sh - tests/fm-omp-harness.test.sh - FM_OMP_TMUX_LIVE_E2E=1 tests/fm-omp-relaunch-tmux-live-e2e.test.sh - bin/fm-lint.sh - bin/fm-doc-audience-check.sh Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ded symlink regression
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
Repair same-task OMP ship/scout restart in Firstmate after a supported /exit. Use upstream b1ad702 as reference, not replacement. Inspect relaunch flow and early OMP artifact guard; fix the same-task --relaunch refusal caused by existing metadata and runtime markers. Preserve task identity, recorded worktree, WIP, brief, inbox, mode/yolo, model/effort, and OMP launch options. Continue refusing active/ambiguous endpoints, mismatched identities, missing worktrees, and fresh-spawn collisions. Add portable behavioral regressions and a safe tmux/OMP live lab with isolated throwaway home/worktree. No edits to fm-omp-orchestrate-opt-in. Delivery mode=no-mistakes, yolo off. Firstmate-Validation-Generation: 99070276740a094f1c527669fc9a92f5
What Changed
fm-spawn.shto recover same-task OMP ship/scout relaunches after a supported exit while preserving recorded task, worktree, and launch configuration.Risk Assessment
✅ Low: The relaunch changes are bounded, preserve the recorded OMP/task state, retain fail-closed checks for unsafe artifacts and endpoint ambiguity, and add behavioral fixtures without introducing a source-verifiable defect.
Testing
Exercised portable same-task OMP relaunch acceptance, profile and launch-option preservation, symlink/collision/identity/worktree refusal paths, and related OMP runtime identity behavior. Automated targeted tests passed; the real tmux/OMP lab was attempted but could not complete initial spawn because the environment reported a missing pane and unsafe GOTMPDIR submission.
Evidence: OMP relaunch guard results
Evidence: Live tmux lab attempt
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-omp-relaunch-guard.test.shbash tests/fm-omp-harness.test.shbash tests/fm-omp-primary.test.shFM_OMP_TMUX_LIVE_E2E=1 bash tests/fm-omp-relaunch-tmux-live-e2e.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.