Skip to content

fix(dispatch): resolve the Mind checkout before the session bootstrap - #550

Merged
Jammy2211 merged 2 commits into
mainfrom
ccr-60e7ebfa-uggh80
Nov 1, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
ccr-60e7ebfa-uggh80

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

ensure_session_environment in bin/pyauto-brain called resolve_mind, which is defined in agents/_common.sh — a file the dispatcher never sources (introduced in c37ac41). In every remote session (CLAUDE_CODE_REMOTE=true) each verb printed resolve_mind: command not found and silently skipped PyAutoMind/scripts/session_bootstrap.sh, leaving sessions on the container's Python 3.11 (below the organism floor).

Found during a /health dashboard review: pyauto-brain health --scope dashboard --json emitted the error on stderr.

Change

  • Source agents/_common.sh in a subshell and call resolve_mind there, so the shared helpers stay out of the dispatcher namespace. An unresolvable Mind still skips the bootstrap, as before.
  • New tests/test_session_bootstrap_dispatch.py: runs the dispatcher with CLAUDE_CODE_REMOTE=true against a stub Mind bootstrap; asserts the bootstrap ran, no command not found, and that PYAUTO_SKIP_BOOTSTRAP is honoured.

Verification

  • New test fails on the old dispatcher, passes with the fix.
  • test_session_bootstrap_dispatch, test_health_conductor, test_grouped_organ_consumers, test_conductor_discovery: 49 passed.
  • Live: after the fix the bootstrap actually ran in the remote session (interpreter switched to the session Python 3.12 venv).

Generated by Claude Code

ensure_session_environment called resolve_mind, which is defined in
agents/_common.sh and never sourced by bin/pyauto-brain. In every remote
session each verb printed "resolve_mind: command not found" and silently
skipped PyAutoMind/scripts/session_bootstrap.sh, leaving sessions below the
Python floor. Source the helpers in a subshell so the dispatcher namespace
stays clean; an unresolvable Mind still skips the bootstrap as before.

Adds a regression test that runs the dispatcher with CLAUDE_CODE_REMOTE=true
against a stub Mind bootstrap (fails before this change, passes after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8QAki1rcqoS951ubcu
With the dispatcher fix the Mind's session bootstrap really runs in remote
sessions, and it registers a .claude/ hook under a declared PYAUTO_ROOT.
Tests that point PYAUTO_ROOT at a tmp fixture then had the fixture rewritten
under them (e.g. test_refs_resolves_dot_directory_references saw an extra
`.claude` sibling and reported `.claude/skills` dead). An autouse fixture sets
PYAUTO_SKIP_BOOTSTRAP=1; test_session_bootstrap_dispatch removes it explicitly
to exercise the bootstrap against a stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8QAki1rcqoS951ubcu
@Jammy2211
Jammy2211 merged commit 5727fab into main Nov 1, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the ccr-60e7ebfa-uggh80 branch November 1, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants