2026-01-31 16:04:03 -05:00
---
title: "Pi Development Workflow"
2026-02-22 20:44:31 +01:00
summary: "Developer workflow for Pi integration: build, test, and live validation"
read_when:
- Working on Pi integration code or tests
- Running Pi-specific lint, typecheck, and live test flows
2026-01-31 16:04:03 -05:00
---
2026-01-31 01:52:50 +01:00
# Pi Development Workflow
This guide summarizes a sane workflow for working on the pi integration in OpenClaw.
## Type Checking and Linting
2026-04-04 10:21:30 +01:00
- Default local gate: `pnpm check`
- Build gate: `pnpm build` when the change can affect build output, packaging, or lazy-loading/module boundaries
- Full landing gate for Pi-heavy changes: `pnpm check && pnpm test`
2026-01-31 01:52:50 +01:00
## Running Pi Tests
2026-02-22 21:07:03 +01:00
Run the Pi-focused test set directly with Vitest:
2026-01-31 01:52:50 +01:00
``` bash
2026-04-04 04:01:17 +01:00
pnpm test \
2026-02-22 21:07:03 +01:00
"src/agents/pi-*.test.ts" \
"src/agents/pi-embedded-*.test.ts" \
"src/agents/pi-tools*.test.ts" \
"src/agents/pi-settings.test.ts" \
"src/agents/pi-tool-definition-adapter*.test.ts" \
2026-03-29 09:09:56 +01:00
"src/agents/pi-hooks/**/*.test.ts"
2026-01-31 01:52:50 +01:00
```
2026-02-22 21:07:03 +01:00
To include the live provider exercise:
2026-01-31 01:52:50 +01:00
``` bash
2026-04-04 04:01:17 +01:00
OPENCLAW_LIVE_TEST = 1 pnpm test src/agents/pi-embedded-runner-extraparams.live.test.ts
2026-01-31 01:52:50 +01:00
```
2026-02-22 21:07:03 +01:00
This covers the main Pi unit suites:
2026-01-31 01:52:50 +01:00
- `src/agents/pi-*.test.ts`
- `src/agents/pi-embedded-*.test.ts`
- `src/agents/pi-tools*.test.ts`
- `src/agents/pi-settings.test.ts`
- `src/agents/pi-tool-definition-adapter.test.ts`
2026-03-29 09:09:56 +01:00
- `src/agents/pi-hooks/*.test.ts`
2026-01-31 01:52:50 +01:00
## Manual Testing
Recommended flow:
- Run the gateway in dev mode:
- `pnpm gateway:dev`
- Trigger the agent directly:
- `pnpm openclaw agent --message "Hello" --thinking low`
- Use the TUI for interactive debugging:
- `pnpm tui`
For tool call behavior, prompt for a `read` or `exec` action so you can see tool streaming and payload handling.
## Clean Slate Reset
State lives under the OpenClaw state directory. Default is `~/.openclaw` . If `OPENCLAW_STATE_DIR` is set, use that directory instead.
To reset everything:
- `openclaw.json` for config
2026-04-04 10:21:30 +01:00
- `agents/<agentId>/agent/auth-profiles.json` for model auth profiles (API keys + OAuth)
- `credentials/` for provider/channel state that still lives outside the auth profile store
2026-01-31 01:52:50 +01:00
- `agents/<agentId>/sessions/` for agent session history
2026-04-04 10:21:30 +01:00
- `agents/<agentId>/sessions/sessions.json` for the session index
2026-01-31 01:52:50 +01:00
- `sessions/` if legacy paths exist
- `workspace/` if you want a blank workspace
2026-04-04 10:21:30 +01:00
If you only want to reset sessions, delete `agents/<agentId>/sessions/` for that agent. If you want to keep auth, leave `agents/<agentId>/agent/auth-profiles.json` and any provider state under `credentials/` in place.
2026-01-31 01:52:50 +01:00
## References
2026-03-17 23:55:24 -07:00
- [Testing ](/help/testing )
- [Getting Started ](/start/getting-started )