feat: experimental pdev harness behind the pdev-agent flag

Merged
HA
1mo ago
+1127-49

What

Adds pdev as an experimental agent and chat harness, behind the PostHog flag pdev-agent.

  • With the flag off (or not loaded), pdev is hidden from the agent catalog, pickers, agent settings, preset buttons, the scripts menu and preset hotkeys, and its presets do not launch. Saved pdev terminal presets stay listed in Settings → Terminal so they can be deleted.
  • In chat, the pdev-acp harness runs pdev acp. Chat also needs acp-chat.
  • pdev has its own icon on desktop and mobile.
  • The desktop build bundles the pdev binary (bun run bundle:pdev, macOS and Linux) and installs ~/.superset/bin/pdev, like the superset CLI. The archive's SHA-256 is pinned, and release builds fail if it cannot be downloaded or verified.
  • Every build ships pdev, including for users with the flag off (about 35–45 MB per update). This is intended for the experiment; only the UI is gated.

No API, web, DB or tRPC changes.

How to test

  1. Turn on pdev-agent and acp-chat for your user.
  2. Settings → Agent commands → add pdev.
  3. Start a new chat and pick pdev.
  4. Turn pdev-agent off: pdev and its preset buttons disappear.

Known gaps

  • pdev's questions and permission prompts show as generic "Allow this action?" cards.
  • Not bundled on Windows.
  • ~/.superset/bin/pdev is installed for every user, and that directory comes first on PATH in Superset terminals. It hides any other pdev there. The shim never overwrites a pdev file already in ~/.superset/bin.

Summary by cubic

Adds pdev as an experimental agent and chat harness behind the pdev-agent flag. With the flag off, pdev is hidden from the agent catalog, pickers, settings, preset buttons, scripts menu, preset hotkeys, new-tab and workspace-init presets, and terminal scripts that invoke pdev in any form — env assignments, paths, quotes, or shell operators — and its presets do not launch. In chat, the pdev-acp harness runs pdev acp and also requires acp-chat.

Desktop builds now bundle the pdev binary (macOS and Linux, arm64 and x64) with a pinned SHA-256 and install a ~/.superset/bin/pdev shim, never overwriting a user-installed pdev; release builds fail if the archive can't be downloaded or verified or if it's missing from the package. Every build ships pdev even for users with the flag off, adding roughly 35–45 MB per update.

  • pdev's questions and permission prompts show as generic "Allow this action?" cards.
  • Not bundled on Windows.

Summary by CodeRabbit

  • New Features

    • Added PDev as an agent option, with support for interactive sessions, resuming and forking sessions, and non-interactive prompts.
    • Added PDev support to desktop and host chat workflows, including a bundled desktop executable on supported macOS and Linux systems.
    • Added PDev icons and thinking-level controls.
  • Improvements

    • Agent and terminal preset lists now show only options enabled for the current configuration. PDev remains hidden unless enabled.
    • Existing custom presets and terminal scripts remain available.
    • Desktop packaging now verifies that the bundled PDev executable is present and runnable.