Repository navigation
Fix silent crash on Python 3.14.0-3.14.3, and --update resuming (2.1.2) - #31
Merged
Merged
Conversation
PythonMonkey's wheels read CPython's thread state at an offset from 3.14.4+ headers (3.14.4 added a PyThreadState field). On 3.14.0-3.14.3 they read the running Task as the event loop and crash on the first awaited promise, so generate died with no message when the first agent checked a diagram. A native crash raises nothing, so the existing Node fallback never ran. Now the real parse is tried once in a child process; a crash there switches the run to Node with a warning to upgrade Python. PythonMonkey stays in use wherever it works. Reported upstream as PythonMonkey #515, with a 45-job OS/CPU/Python matrix showing only 3.14.3 crashes. After a full rebuild stopped before writing pages (no metadata.json, new graph already saved), --update diffed to no_change and failed on the missing pages on every rerun. It now resumes generation instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG
The probe's warning already names the cause and says Node.js is used; the generic "trying system Node.js" line after it said the same thing again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
codewiki generateexited with no message on a Windows machine as soon as the first agent checked a Mermaid diagram, and the following--updatethen refused to run at all.Crash: PythonMonkey on Python 3.14.0–3.14.3
PythonMonkey finds the running asyncio loop by reading CPython's private thread state at a fixed offset. Its wheels are built against 3.14.4+ headers, and 3.14.4 added a pointer to
PyThreadState(python/cpython@19cbcc0f85). So on 3.14.0–3.14.3 it reads the running Task as the loop and crashes on the first awaited promise: a segfault on Linux/macOS,0xC0000005on Windows. A native crash raises nothing, so the existing Node fallback never ran.Fix: before the first diagram, the real parse runs once in a child process. If the child crashes, the run switches to Node.js with a warning to upgrade Python. If it succeeds, PythonMonkey is used in-process as before. A plain Python error in the child, such as PythonMonkey not being installed, isn't treated as a crash. Cost: one child process per run.
--updateafter an unfinished full rebuildThe full rebuild had moved
metadata.jsonaside and saved the new graph, then stopped before writing pages. The next--updatediffed the code against that same graph, gotno_change, and failed on ~400 missing pages on every rerun. Nowno_changewith missing pages returns aresumeoutcome: generation continues from the cached module tree, keeps existing pages, and doesn't writemetadata.jsonbefore the pages exist.Testing
0xC0000005) falls back to Node without parsing in-process and probes only once; a Python error isn't a crash; a real probe passes where PythonMonkey works;no_changewith missing pages returnsresumewithout writing metadata.🤖 Generated with Claude Code
https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG