You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
session: make a multi-repo remote session usable, and its tests 3.5x faster
A second mobile-performance review, measuring what a web/mobile session
actually costs. Python 3.12 is now the default (the last review's fix), but
three defects underneath it were still live, and the two mitigations shipped
last time both had holes.
**The hook still never fires in a multi-repo session.** Proved from
`~/.claude/session-env/<id>/`: two earlier single-repo sessions in this
container each wrote an env file, this session's directory is empty. The
workspace-root fan-out that was meant to fix it had never been installed by
anyone — writing it requires the hook to be running, the hook only runs in a
single-repo session, and an early return skipped exactly that session as
"nothing to add". So the seed was unreachable by construction. It now installs
from any session, targeting the workspace root derived from the checkout.
**`python3 -m pytest` and `pytest` both failed, and neither looked like an
environment problem.** With no env file there is no PATH export, so shells got
`/usr/local/bin/python3` (no pytest) and uv's isolated `pytest` (no PyYAML —
four collection ImportErrors that read like broken source, in a workspace whose
suite was green). `point_system_default` was passing `readlink -f
"$VENV/bin/python"`, resolving the venv straight through to the base
interpreter. It now writes a wrapper — a symlink is resolved before CPython
looks for `pyvenv.cfg`, which loses the venv again — and the venv is built
`--system-site-packages` so pointing the default at it adds packages without
removing any. The `pytest` on PATH is pointed at the venv's, confined to uv's
own shim directory.
**Tests ran on one of four cores.** No single slow test; 554 subprocess-heavy
ones. pytest-xdist joins BASE_DEPS: PyAutoBrain 96s -> 28s, PyAutoMind 10s ->
3.7s, all passing either way.
**`--check` reported "pytest: 3.12 OK" for that unusable pytest.** It asked the
version, which is necessary and not sufficient; it now also asks whether the
interpreter can import what the suite needs.
One trap, hit while building the fix and now pinned by a test: the wrapper was
written with `cat >`, `/usr/local/bin/python3` is a symlink, and a redirect
opens the link's target — so it overwrote `/usr/bin/python3.12` itself with a
wrapper that then exec'd itself. The container lost its interpreter. `rm -f`
before writing, plus a chain walk refusing a target that links back through the
destination.
Validation: 232 PyAutoMind tests and 554 PyAutoBrain tests pass, `ruff`,
`lifecycle.py check` and `repos_sync.py --check` clean. 8 new tests; each new
guard was confirmed to FAIL with its fix removed.
Follow-up: PyAutoHeart and PyAutoHands carry generated copies of this hook and
are not attached to this session, so `repos_sync.py --write` regenerated only
two of four. They need the same one-file update.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XLmJCBKNoh2tB5UkdecsSn
0 commit comments