Skip to content

feat: add pi as a built-in agent - #309

Closed
farhadg974 wants to merge 19 commits into
windmill-labs:mainfrom
centdix:feat/pi-agent
Closed

farhadg974 wants to merge 19 commits into
windmill-labs:mainfrom
centdix:feat/pi-agent

Conversation

@farhadg974

Copy link
Copy Markdown

Phase 1: adds pi (`pi`, `@earendil-works/pi-coding-agent`) as a built-in agent, at parity with opencode.

Supported

  • Lifecycle status: generated pi extension maps `session_start` → idle, `agent_start` → running, `agent_settled` → stopped (via `webmux-agentctl`, with dedupe).
  • PR detection: `tool_result` for `bash` → new `pi-post-tool-use` agentctl subcommand.
  • System prompt: native `--append-system-prompt`. `yolo` is a no-op (pi has no permission prompts).
  • Resume / fork / tabs: `--session ` / `--continue`; `--fork --session-id ` (verified in pi's `main.js` that the combo is allowed); fork tabs pin the child id, so no disk-discovery race.
  • Session discovery: reads `$PI_CODING_AGENT_DIR|~/.pi/agent/sessions//*.jsonl` headers (filename fallback).
  • Config parsing, api-contract, `webmux init` authoring (`pi --mode json`), docs/README, sandbox image install, tests.

Design

The extension is written to the webmux storage dir (`/webmux/webmux-pi-extension.js`, next to `webmux-agentctl`) and loaded with `pi -e`, so nothing is added to the worktree and no git-exclude entry is needed. The launch path derives it from `dirname(runtimeEnvPath)`, which is already reachable in docker containers.

Out of scope

In-app chat, conversation history parsing, interrupt, "waiting for permission" state.

centdix and others added 19 commits July 12, 2026 18:17
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix: stabilize terminal attachment after worktree creation
fix: keep tmux window on in-worktree branch rename
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Conflicts:
#	bin/src/worktree-commands.ts
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: isolate development servers from production

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

* fix: make isolated tmux cleanup signal-safe

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: let agents create panes and address panes by stable label

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

* fix: fail loudly when a pane label resolves to no pane

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

* fix: keep agent-created panes alive in the right-hand column

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

* fix: proxy project-prefixed api and ws paths in vite dev server

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add opencode as a built-in agent

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

* fix: keep opencode status from reverting to running after a turn ends

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
# Conflicts:
#	backend/src/services/lifecycle-service.ts
#	frontend/src/lib/utils.test.ts
#	frontend/vite.config.ts
…actually runs

Bun auto-loads .env from the CWD before webmux's own loader runs, so every
key of the launch project's .env is already in process.env; loadEnvFile only
reported keys it added itself, returned nothing, WEBMUX_PROJECT_ENV_KEYS was
never set, and the project's secrets reached the tmux global environment
(and every pane) despite windmill-labs#285. The loader now reports every key a file
defines, set or not; an already-set value still wins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fix: report every project .env key so the tmux env scrub actually runs
@farhadg974 farhadg974 closed this Oct 27, 2026
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.

2 participants