Repository navigation
feat: add Pax and Code Puppy support - #352
Open
mpfaffenberger wants to merge 2 commits into
Open
mpfaffenberger wants to merge 2 commits into
mpfaffenberger wants to merge 2 commits into
Conversation
Add a `pax` detection strategy built from screens captured from pydantic-ai-pax 0.77.0, and a `code-puppy` strategy that reuses it, since Code Puppy is a distribution of Pax with the same terminal UI: - busy: the `─ Working <spinner> · Esc to interrupt` row above the prompt - waiting_input: the inline question picker's key hint row (ask_user_question, permission approvals) and the first-run "Trust this folder?" question - neither CLI takes a prompt argument, so preset prompts go via stdin
`pax` is also the POSIX archive utility (/bin/pax on macOS, a package on Linux), which can come first on PATH. Pax installs `pydantic-ai-pax` with the same entry point, so use that as the default command and in the docs, and have the config validator warn about a preset that runs plain `pax`.
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.
Summary
Adds support for Pax (launched as
pydantic-ai-pax, from pydantic/pydantic-ai) and Code Puppy (code-puppy/pup). Code Puppy is a distribution of Pax and runs the same terminal UI, so it gets its owncode-puppystrategy (it needs its own entry in the strategy picker and default command), and that strategy uses the samePaxStateDetector.This follows the same layout as #341 (Grok Build):
src/types/index.ts: newpaxandcode-puppyStateDetectionStrategyvaluessrc/services/stateDetector/pax.ts+pax.test.ts: the detector and its tests;index.tsmaps both strategies to itsrc/components/ConfigureCommand.tsx: labels "Pax" / "Code Puppy", default commandspydantic-ai-pax/code-puppy. Plainpaxis avoided because it is also the POSIX archive utility (/bin/paxon macOS), which can come first onPATH. Pax installspydantic-ai-paxwith the same entry point.src/utils/presetPrompt.ts+ test: covers how preset prompts are passed (see below)ccmanager-configplugin's schema enum, config reference table and validator (pydantic-ai-pax→pax;code-puppyandpup→code-puppy). The validator also warns when apax-strategy preset runs plainpax.State detection
Pax sets no terminal title and no OSC status marker, so the state comes from what it draws on screen. I built the rules from screens I captured from
pydantic-ai-pax0.77.0 in a 160x45 tmux pane, then checked them against the Pax source:busy─ Working ⠏ 9s · Esc to interrupt ───while a turn runs_working_titleinui/prompt/live_prompt.pywaiting_inputUp/Down or Tab/Shift+Tab move - …(orEnter submits - Esc back - Ctrl+C declinewhile typing a custom answer). It is the same picker forask_user_question, permission approvals and the trust question.QuestionMenu.hintinui/menus/question_menu.pywaiting_inputTrust this folder?ui/menus/trust_prompt.pyidle❯prompt afterDone in 32sThe picker hint is matched by its start because Pax cuts that row from the right on narrow terminals. The toolbar's
ready/waiting/running: …field is deliberately not used: itswaitingmeans waiting on the model, not on the user. Background tasks and team members are reported as 0.The test fixtures are trimmed versions of the real captured frames: idle after a turn, busy during a tool call and before the first response, the
ask_user_questionpicker (on an option row and on its "Other" row), the trust question, and the screen after the trust question is answered (its explanation stays in the scrollback, and that screen must read as idle).Preset prompts
Neither CLI takes a positional prompt, and
-p/--promptruns one headless prompt and exits, so neitherfinal-argnorflagworks. Both strategies use ccmanager's existingstdinmethod (the default fallback, now with a comment saying so). I checked this on Pax 0.77.0 by writingprompt\rto the PTY right after spawning it, the way ccmanager does: the text shows up in Pax's input box but is not sent, because the\rarrives before the prompt is ready and becomes a newline in the draft. So the user still has to press Enter. That is the most an interactive launch supports today.Verification
bun run lintandbun run typecheckpass.vitest run src/services/stateDetector/pax.test.ts src/utils/presetPrompt.test.ts: 43 tests pass. I did not run the full suite.ask_user_question(2) and the trust question (Pax and Code Puppy) all came out right.puppreset withoutdetectionStrategygets a warning suggesting"code-puppy", apydantic-ai-paxpreset without one gets a warning suggesting"pax", and a preset running plainpaxgets a warning to usepydantic-ai-pax.pydantic-ai-pax --helpprints Pax's usage.What I verified on Code Puppy 1.0.1 (pydantic-ai-pax 0.75.0): it shows the same trust question and picker hint row, and its idle screen is detected as idle. I could not capture a busy frame or an
ask_user_questionpicker from Code Puppy, because no model provider was signed in for it on the test machine. Its busy and waiting detection relies on it sharing Pax's UI code.Not verified: permission approval prompts (the default
run.permissionsisfull, which never asks; they use the same picker according to the source), and narrow-terminal truncation of the hint row (the rule comes from the source, not a capture).