fix(issue-21): PR #29 delta review follow-up - prepare installs the delegate-job requirements, removes a half-made venv on install failure; prompt dirty flag sees untracked files

- worktree_prepare.sh installs the same files deploy/install.sh does
  (.agents/skills/multi-agent-mux-delegate-job/requirements.txt: paho-mqtt,
  PyYAML) plus requirements*.txt. Without paho the loop wrapper, stop_session
  and the subscriber tests fail in the worktree - seen as 4 suite failures
  in a worktree without its own venv, all passing with one.
- review D1: a failed pip install removes the venv it half made, so the next
  run recreates it instead of reporting VENV=kept (test w1c).
- review D3: the [worktree context] block's uncommitted-changes flag uses
  --untracked-files=all like the guards.
- review D2: the create skill doc says the install needs the package index.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-09-20 21:33:57 +09:00
1 parent 08db1da9d5
commit 80a5614f7c
5 files changed
+26 -7

No files matched your search

@@ -79,7 +79,7 @@ fi
if [ "$DRY_RUN" = "1" ]; then
echo "[dry-run] control root: $MAIN"
echo "[dry-run] worktree: $WT (branch $BRANCH${BASE_REF:+, base $BASE_REF})"
echo "[dry-run] own .venv (from $MAIN/.venv/bin/python + requirements*.txt) and shared info/exclude entries; submodules: $([ "$SUBMODULES" = 1 ] && echo init || echo skipped)"
echo "[dry-run] own .venv (from $MAIN/.venv/bin/python + the delegate-job requirements.txt and requirements*.txt) and shared info/exclude entries; submodules: $([ "$SUBMODULES" = 1 ] && echo init || echo skipped)"
[ -n "$CREATOR_AGENT" ] && echo "[dry-run] creator: $CREATOR_AGENT as $SESSION (role $ROLE)"
exit 0
fi
@@ -122,12 +122,16 @@ elif [ -x "$WT/.venv/bin/python" ]; then
elif [ -x "$MAIN/.venv/bin/python" ]; then
"$MAIN/.venv/bin/python" -m venv "$WT/.venv" || { echo "ERROR: could not create '$WT/.venv'" >&2; exit 1; }
req=()
for f in requirements.txt requirements-dev.txt; do
# the same files deploy/install.sh installs into the control root's venv
for f in .agents/skills/multi-agent-mux-delegate-job/requirements.txt requirements.txt requirements-dev.txt; do
[ -f "$WT/$f" ] && req+=(-r "$WT/$f")
done
if [ "${#req[@]}" -gt 0 ]; then
"$WT/.venv/bin/python" -m pip install -q "${req[@]}" \
|| { echo "ERROR: pip install into '$WT/.venv' failed; fix it and re-run (the worktree is kept)" >&2; exit 1; }
if ! "$WT/.venv/bin/python" -m pip install -q "${req[@]}"; then
rm -rf "$WT/.venv" # review D1: a half-made venv would be reported as kept by the next run
echo "ERROR: pip install into '$WT/.venv' failed (network to the package index is needed); the venv was removed, the worktree is kept - fix it and re-run" >&2
exit 1
fi
fi
VENV_STATE="created"
else