Pi Development Workflow
This guide summarizes a sane workflow for working on the pi integration in OpenClaw.Type Checking and Linting
- Default local gate:
pnpm check - Build gate:
pnpm buildwhen the change can affect build output, packaging, or lazy-loading/module boundaries - Full landing gate for Pi-heavy changes:
pnpm check && pnpm test
Running Pi Tests
Run the Pi-focused test set directly with Vitest:src/agents/pi-*.test.tssrc/agents/pi-embedded-*.test.tssrc/agents/pi-tools*.test.tssrc/agents/pi-settings.test.tssrc/agents/pi-tool-definition-adapter.test.tssrc/agents/pi-hooks/*.test.ts
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
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.jsonfor configagents/<agentId>/agent/auth-profiles.jsonfor model auth profiles (API keys + OAuth)credentials/for provider/channel state that still lives outside the auth profile storeagents/<agentId>/sessions/for agent session historyagents/<agentId>/sessions/sessions.jsonfor the session indexsessions/if legacy paths existworkspace/if you want a blank workspace
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.