Skip to content

Agent: bring over the CPython worker runtime from #897 - #1409

Draft
AnthonyRonning wants to merge 2 commits into
masterfrom
agent/python-runtime
Draft

AnthonyRonning wants to merge 2 commits into
masterfrom
agent/python-runtime

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

First layer of the CodeMode catch-up stack: the Python worker runtime from PR #897 (the Goose-era draft), copied onto current master and pinned to CPython 3.14.7. Nothing uses it yet; the python tool comes in the next layer.

What comes over from #897, unchanged

Commit Copy the CPython worker runtime from #897 is a verbatim copy of #897's head 4f8603d8, so it can be diffed against that PR:

  • crates/maple-code-mode: the GPUI-free runtime crate. It owns task-lived CPython processes: framing over private descriptors, bounded output, process supervision (process groups on Unix, a Job on Windows), four worker slots, reset and retire. It never depended on Goose, accounts or permissions.
  • python/worker.py and its protocol suite, scripts/prepare-python.py (hash-pinned Python Build Standalone download and safe extraction), scripts/test-python-worker.py, scripts/check-python-dependencies.py, and the pinned upstream license notices.
  • The only moves: the crate joins the workspace, and the prepare script's test sits beside master's other script tests (scripts/test_prepare_python.py).

What changed on top

  • CPython 3.14.7 from Python Build Standalone 20260929, up from 3.13.15 (20260901). The runtime still requires one exact version across the bundled and Nix distributions, and the pinned nixpkgs ships python314 3.14.7. A later nixpkgs bump can move both to a newer 3.14.
  • Targets follow what Maple ships or develops on now: macOS arm64, Linux x86_64 and arm64, Windows x64 and arm64. Intel macOS is gone from the build matrix; Windows arm64 is new.
  • The license notice texts are identical at the new release; only PROVENANCE.json moves.
  • Tests: just ci-test and just test prepare the runtime, then run the prepare script's tests and the worker's Python protocol suite before the Rust tests that need it. agent-full-macos and agent-full-windows prepare it before cargo test.

Validation (macOS arm64, pinned Nix shell)

  • just python-test: 25 tests, 1 Windows-only skip.
  • cargo test -p maple-code-mode: 22 unit, 12 native-worker and 2 process-tree tests pass against the real 3.14.7 interpreter.
  • just code-mode-smoke: "CPython 3.14.7 (pbs-20260929-aarch64-apple-darwin) … native worker smoke passed".
  • python3 scripts/test_prepare_python.py: 6 tests.
  • scripts/ci/test_plan.py, test_contracts.py, test_workflow_policy.py, test_change_detection.py pass.
  • The full pre-commit hook (just ci-lint and just ci-test) passed.

Not yet exercised here: native Windows and Linux runs of the worker suite, which the full lanes cover; the PR can take ci:full.

🤖 Generated with Claude Code

@AnthonyRonning AnthonyRonning changed the title agent/python runtime Agent: bring over the CPython worker runtime from #897 Nov 1, 2026
AnthonyRonning and others added 2 commits November 2, 2026 01:04
Bring over the GPUI-free `maple-code-mode` crate, its Python worker,
the runtime preparation and test scripts, and the pinned upstream
license notices from the draft CodeMode PR (#897, 4f8603d) unchanged.
The crate never depended on Goose; only workspace membership is new,
and the preparation test moves next to master's other script tests.

The pinned runtime and fixture wiring follow in the next commit, so
this commit skips the hook whose tests need the prepared interpreter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the code-mode runtime from Python Build Standalone 20260901
(CPython 3.13.15) to 20260929 (CPython 3.14.7), the release whose 3.14
matches the pinned nixpkgs' python314, so one exact version still holds
across both distributions. Pin the targets Maple ships or develops on:
macOS arm64, Linux x86_64 and arm64, Windows x64 and arm64. Intel
macOS left the build matrix since #897. The upstream notice texts are
unchanged at that release; only their provenance moves.

`just ci-test` and `just test` now prepare the pinned runtime and run
the worker's Python protocol suite before the Rust tests that use it.
The full macOS and Windows lanes prepare it before `cargo test`, and
the prepare script's own tests join `packaging-test`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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