Skip to content

feat: add Pax and Code Puppy support - #352

Open
mpfaffenberger wants to merge 2 commits into
kbwo:mainfrom
mpfaffenberger:feat/pax-and-code-puppy
Open

mpfaffenberger wants to merge 2 commits into
kbwo:mainfrom
mpfaffenberger:feat/pax-and-code-puppy

Conversation

@mpfaffenberger

@mpfaffenberger mpfaffenberger commented Nov 28, 2026 •

Copy link
Copy Markdown

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 own code-puppy strategy (it needs its own entry in the strategy picker and default command), and that strategy uses the same PaxStateDetector.

This follows the same layout as #341 (Grok Build):

  • src/types/index.ts: new pax and code-puppy StateDetectionStrategy values
  • src/services/stateDetector/pax.ts + pax.test.ts: the detector and its tests; index.ts maps both strategies to it
  • src/components/ConfigureCommand.tsx: labels "Pax" / "Code Puppy", default commands pydantic-ai-pax / code-puppy. Plain pax is avoided because it is also the POSIX archive utility (/bin/pax on macOS), which can come first on PATH. Pax installs pydantic-ai-pax with the same entry point.
  • src/utils/presetPrompt.ts + test: covers how preset prompts are passed (see below)
  • README table, plus the ccmanager-config plugin's schema enum, config reference table and validator (pydantic-ai-pax → pax; code-puppy and pup → code-puppy). The validator also warns when a pax-strategy preset runs plain pax.

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-pax 0.77.0 in a 160x45 tmux pane, then checked them against the Pax source:

State What's on screen Source
busy The rule above the prompt turns into ─ Working ⠏ 9s · Esc to interrupt ─── while a turn runs _working_title in ui/prompt/live_prompt.py
waiting_input The inline question picker's key hint row, Up/Down or Tab/Shift+Tab move - … (or Enter submits - Esc back - Ctrl+C decline while typing a custom answer). It is the same picker for ask_user_question, permission approvals and the trust question. QuestionMenu.hint in ui/menus/question_menu.py
waiting_input The first-run folder trust question, Trust this folder? ui/menus/trust_prompt.py
idle Anything else, e.g. the empty ❯ prompt after Done in 32s

The 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: its waiting means 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_question picker (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/--prompt runs one headless prompt and exits, so neither final-arg nor flag works. Both strategies use ccmanager's existing stdin method (the default fallback, now with a comment saying so). I checked this on Pax 0.77.0 by writing prompt\r to 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 \r arrives 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 lint and bun run typecheck pass.
  • vitest run src/services/stateDetector/pax.test.ts src/utils/presetPrompt.test.ts: 43 tests pass. I did not run the full suite.
  • I ran the detector on the full, untrimmed tmux captures too, not just the fixtures: busy (3 frames), idle (2), ask_user_question (2) and the trust question (Pax and Code Puppy) all came out right.
  • I ran the validator on a sample config: a pup preset without detectionStrategy gets a warning suggesting "code-puppy", a pydantic-ai-pax preset without one gets a warning suggesting "pax", and a preset running plain pax gets a warning to use pydantic-ai-pax. pydantic-ai-pax --help prints 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_question picker 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.permissions is full, 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).

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`.
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