Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/fm-spawn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
# origin, resolves the current remote default branch, and resets to its tip.
# An unreachable origin, unresolved default branch, or non-clean worktree
# refuses the spawn rather than risking a PR based on stale history.
# A project with no origin remote at all (a local-only project registered
# with none) skips this freshen step silently, mirroring the same no-origin
# tolerance bin/fm-fleet-sync.sh already applies.
# Batch dispatch: pass one or more `id=repo` pairs instead of a single <id> <project>, e.g.
# fm-spawn.sh fix-a-k3=projects/foo add-b-q7=projects/bar [--scout]
# Each pair re-execs this script in single-task mode, so the single path stays the only
Expand Down Expand Up @@ -1729,6 +1732,9 @@ validate_spawn_worktree() { # <source> <inspect-target>

freshen_spawn_worktree_base() { # <worktree>
local worktree=$1 default target expected actual status
Comment on lines 1733 to 1734

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Broken origin bypasses freshening

When a pooled worktree has an existing origin entry whose URL is missing or invalid, remote get-url fails and this guard treats it as a remote-less project, causing the worker to launch from a potentially stale base without fetching or resetting.

if ! git -C "$worktree" remote get-url origin >/dev/null 2>&1; then
return 0
fi
if ! git -C "$worktree" fetch --quiet origin; then
echo "error: could not fetch origin for pooled worktree '$worktree'; refusing to launch from a potentially stale base" >&2
return 1
Expand Down