Skip to content
PitestsDevOps5 files · +547 −16

Add headless CI smoke test for pi /web bridge command

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

38msession
0interventions
GOAL

Verify that installing the pi-web extension via CI actually works by launching pi and starting the /web command, not just checking install succeeded.

  1. Prompt · +0
    Installing pi in CI isn't enough to verify our extension is correct — is there a way to open pi on the CI machine and actually start /web?
  2. Agent did · +0m
    Investigated pi's modes (interactive, print/JSON, RPC, SDK), read AGENTS.md, bin/index.ts, bridge lifecycle and tests to understand how /web currently works and why RPC mode can't drive it (custom() degrades to undefined).
  3. Agent did · +2m
    Explained that /web is interactive (uses ctx.ui.custom()) so RPC/SDK smoke testing won't work as-is; proposed two options: drive real interactive pi via a PTY, or add a headless mode to /web itself.
  4. Prompt · +3m
    ok
  5. Agent did · +6m
    Implemented headless mode for /web (packages/bin/index.ts), added a smoke test script (scripts/smoke-pi-web.mjs) that spawns pi, waits for a ready file, checks HTTP and WebSocket connectivity, wired it into pi-install.yml, added unit tests, ran pnpm test (270 passed) and verified the smoke script passes end-to-end against a temp HOME.
  6. Prompt · +12m
    commit
  7. Agent did · +12m
    Committed the headless /web changes, smoke script, workflow update and tests as d0b2bd5 ("test: add headless pi web smoke check"), 5 files changed, working tree clean.
  8. Fail · +36m
    CI on Windows failed with 'spawn pi ENOENT' — the smoke script couldn't find the pi executable on the Windows runner's PATH.
  9. Agent did · +37m
    Diagnosed that spawn("pi") relied on a global PATH shim missing on Windows runners; rewrote scripts/smoke-pi-web.mjs to resolve and call the locally installed CLI (node .../pi-coding-agent/dist/cli.js) directly, falling back to pi/pi.cmd if absent, then re-ran the smoke test locally with a temp HOME.
  10. Outcome · +38m
    Windows ENOENT root-caused and fixed by resolving the local pi CLI path instead of relying on PATH; smoke test verified passing locally against a fresh HOME after pi install, fix not yet committed.
VERDICT

Next time I'd start by asking directly for a headless mode in /web instead of first exploring RPC/SDK paths that turned out to be dead ends — that exploration cost a lot of turns before we landed on the right approach. The fix that actually mattered was catching that Windows CI couldn't find 'pi' on PATH and switching the smoke script to call the local CLI path directly rather than relying on a global shim.

I tried this · 0

Discussion · 0

How Builds work