Skip to content

fix(doctor): report a broken Python; wake idle sessions for notes - #16

Merged
ancongui merged 3 commits into
mainfrom
hotfix/26.11.13
Nov 11, 2026
Merged

ancongui merged 3 commits into
mainfrom
hotfix/26.11.13

Conversation

@ancongui

Copy link
Copy Markdown
Collaborator

What and why

Two problems reported on 2026-11-10. A teammate's dev doctor crashed on devkit 26.11.11: their Homebrew Python
3.15.2 cannot load pyexpat (built against a newer macOS SDK than the Mac's own libexpat), and the jobs module
imported plistlib, which needs it, as it loaded. And a note from another agent session (the kit-consulting session's
report about that crash) waited unread in an idle session until the developer wrote: a plain note notified nobody.

Changes

  • jobs.py imports plistlib only where it writes a launchd file, so the module loads without pyexpat.
  • dev doctor's first row imports pyexpat, ssl, sqlite3, zlib, and ctypes in a process of the same Python
    and names each one that fails, with its error and the fix (uv python install 3.13 --default); a jobs check that
    fails is a failed row instead of a crash.
  • A note to a session with no wait armed sends a desktop notification (at most one every ten minutes per session);
    dev session tell says which sessions are not waiting; a Claude Code session's end-of-turn checklist asks for
    dev watch --wait --standby while other sessions run on this Mac.
  • CHANGELOG section 26.11.13; VERSION and the three manifests at 26.11.13. Built on 26.11.12 (PR fix(codex): restore session, crew, and audit integration #15).

How to verify

  • Local CI: dev ci --run passed 7 of 7 steps (compile, unit tests, gitleaks, semgrep, osv-scanner, trivy, zizmor)
    on tree 9bbf120.
  • tests.test_doctor, test_jobs_audit, test_peers, test_peerscli, test_hooks_peers,
    test_threaded_turn_endings, and test_watch_peers on Python 3.15 and the system Python 3.9: OK.
  • dev test prove: the 7 new tests fail without the change; one fails with the teammate's own error
    ("Standard library module 'pyexpat' was not found" when plistlib loads).

Risk and rollback

Low: one import moved, one doctor row added, one block made to report instead of raise, and the peer notification
widened from questions to notes, still throttled. Roll back with dev install --version 26.11.12.

Links

  • Release notes: CHANGELOG.md, section 26.11.13
  • The report from the kit-consulting session proposes a pinned Python runtime and CI-tested version ranges; those
    need a design and are not in this release.

A teammate's dev doctor crashed on 26.11.11: their Homebrew Python 3.15.2 cannot load pyexpat. The jobs module now loads without it, dev doctor's first row names each native module devkit needs that does not load, with the fix, and a failure reading the jobs is a failed row instead of a crash.

Root cause: jobs.py imported plistlib when the module loaded, plistlib needs pyexpat, and that Python's pyexpat was built against a newer macOS SDK than the Mac's /usr/lib/libexpat, so importing jobs from doctor raised ImportError (jobs.py:17, setup.py doctor)

Verified: python3 and /usr/bin/python3 -m unittest tests.test_doctor: OK; tests.test_jobs_audit: OK; dev test prove: the 3 new tests fail without the change, one with the teammate's pyexpat error
The kit-consulting session's note about a teammate's crash reached the idle devkit session only when the developer wrote. A note to a session with no wait armed now notifies the developer (at most once per ten minutes per session), the sender is told which sessions are not waiting, and the turn checklist of a Claude main session asks for dev watch --wait --standby while other sessions run on this Mac.

Root cause: send() notified the developer only for a question or an urgent note, so a plain note to an idle session with no wait reached nobody until its next prompt; the sender's output did not say the receiver was not waiting; and nothing asked an idle main session for the standby wait that peer notes wake (peers.py send, peerscli.py _send, hooks.py turn_checklist)

Verified: python3 and /usr/bin/python3 -m unittest tests.test_peers tests.test_peerscli tests.test_hooks_peers tests.test_threaded_turn_endings tests.test_watch_peers: OK; dev test prove: the 4 new tests fail without the change
Version 26.11.13 in VERSION and the three manifests, and its CHANGELOG section: dev doctor reports a Python whose native modules do not load instead of crashing, and a note from another session reaches an idle session.

Verified: dev docs check CHANGELOG.md: 0 issues, links resolve
@ancongui
ancongui merged commit 3a3bb8d into main Nov 11, 2026
3 checks passed
@ancongui
ancongui deleted the hotfix/26.11.13 branch November 11, 2026 01:26
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.

1 participant