Skip to content

feat: make persistent Python the default agent path - #3

Merged
Luminger merged 7 commits into
mainfrom
feat/ipython-style-tool
Sep 20, 2026
Merged

Luminger merged 7 commits into
mainfrom
feat/ipython-style-tool

Conversation

@Luminger

@Luminger Luminger commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • present pi-python as an IPython-style session exposed directly to the agent
  • steer models toward the persistent python tool instead of python -c, heredocs, and temporary scripts
  • remove ineffective environment-variable filtering and document the actual execution boundary
  • make Windows timeout semantics explicit and return structured hard-kill results
  • test every claimed Python version across supported Node/Bun lines and Linux/macOS/Windows
  • correct contributor and release documentation to match live repository policy

Commit structure

  1. fix: inherit the host environment unchanged
  2. feat: prefer persistent Python over bash one-offs
  3. ci: test every supported runtime across hosted operating systems
  4. docs: present pi-python as an IPython-style agent session
  5. fix: make Windows timeout behavior explicit
  6. ci: collapse Python permutations into runtime jobs
  7. fix: use erasable TypeScript syntax on Node 26

CI coverage

The matrix covers 108 combinations while exposing only 18 runtime/OS checks:

  • Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
  • Node 22.19, latest 22.x, 24.x, 26.x
  • Bun 1.3.x, 1.4.x
  • Ubuntu, macOS Intel, Windows

Python versions run sequentially inside each runtime/OS job. CI gate is the stable branch-protection context and succeeds only when all 108 combinations pass.

Validation

  • npm ci --ignore-scripts
  • npm run check
  • npm test — 29/29
  • npm run test:bun — 29/29
  • hosted matrix — 108/108 combinations passed
  • README local links checked

Python is a first-class execution environment here, not a sandbox. The
old filter removed a hand-maintained list of provider variables plus any
name ending in API_KEY, SECRET, or TOKEN. That broke legitimate project
code while providing no meaningful isolation to an LLM that already has
arbitrary execution as the user running pi.

Pass the host environment through unchanged and document the actual
security model: enabling the tool delegates the user's authority to the
model, and any restriction has to live at an OS boundary outside the
process.

Pin the behavior with an end-to-end assertion that a custom host variable
is visible in the selected interpreter.
The old prompt guidance limited the tool to "non-trivial" data work and
named a few narrow domains. That gave models an easy reason to fall back
to `python -c`, heredocs, and temporary scripts for short or unrelated
Python, throwing away the persistent namespace this extension exists to
provide.

Make this the preferred path for all inline Python, including one-offs,
and spell out the legitimate exceptions: existing scripts and CLIs,
fresh-process behavior, and work where shell semantics are material.
Tell the model to reuse live kernel state after ordinary exceptions and
cooperative timeouts instead of reconstructing it in another process.
Replace the four-job Linux-only matrix with the full cross product of
Python 3.9 through 3.14, Node's supported 22/24/26 lines (plus the exact
22.19 floor), Bun 1.3/1.4, and Linux/macOS/Windows: 108 jobs. Use an x64
macOS label because the arm64 image has no Python 3.9 build, and cap every
leg at five minutes so a broken signal implementation cannot wedge CI.

Add a stable `CI gate` job for branch protection; it turns red unless the
entire dynamic matrix succeeds. Teach the test harness to select
`python.exe` on Windows or honor an explicit interpreter, and expose a
Bun test script. Synchronize the lockfile root metadata while touching
the runtime declarations.

Update the contributor guide to describe the real matrix, gate, squash
commit convention, and pre-1.0 release-please policy. Features are patch
bumps with our config; hidden commit types do not release on their own.
Lead with what the package is, how its persistent process behaves, and
where that persistence ends instead of opening with the history of an
old checkpoint implementation. Put installation and the execution-risk
warning above the fold, consolidate duplicated tool/install/reference
material, and move protocol internals and checkpoint archaeology behind
the user-facing behavior.

Describe the security model without pretending users review each cell or
listing every thing arbitrary model-driven code can do: enabling the tool
delegates the authority of the user running pi, full stop. Align npm
metadata and discovery keywords with the IPython-style positioning.
Node cannot deliver a catchable SIGINT to a Windows child process:
kill("SIGINT") terminates Python outright, and the exit event previously
rejected the request as an unexpected kernel death. Treat that platform
limitation as an immediate hard kill instead, preserving partial output
and returning the normal killed=true result before transparently
respawning on the next call.

Keep the namespace-preserving SIGINT assertions on POSIX and add a Windows
branch that pins the hard-kill contract. Document the difference in the
tool schema and README rather than promising cooperative interruption on
a platform that cannot provide it.
The first exhaustive matrix proved its point but exposed 108 individual
checks. Keep all 108 runtime combinations while presenting only 18 jobs:
one per JS runtime and OS, with Python 3.9 through 3.14 executed as
sequential composite-action steps inside it. Continue after an individual
Python failure, then aggregate all six outcomes so every version still
runs and any failure still turns the job red.

Add a tiny Node launcher because Node 26 removed
--experimental-transform-types after making transformation the default,
while Node 22/24 still need the flag for parameter properties. The stable
CI gate continues to summarize the entire matrix for branch protection.
Node 26 removed --experimental-transform-types and its built-in loader now
only strips erasable syntax. The sole construct requiring transformation
was PythonKernel's parameter property; expand it to an ordinary field and
assignment so Node 22 through 26 can all execute the test directly with
no version-switching launcher.
@Luminger
Luminger merged commit b47e2b0 into main Sep 20, 2026
19 checks passed
@Luminger
Luminger deleted the feat/ipython-style-tool branch September 20, 2026 05:52
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