Pi Development Workflow
Pi Development Workflow
Section titled “Pi Development Workflow”This guide summarizes a sane workflow for working on the pi integration in OpenClaw.
Type Checking and Linting
Section titled “Type Checking and Linting”- Type check and build:
pnpm build - Lint:
pnpm lint - Format check:
pnpm format - Full gate before pushing:
pnpm lint && pnpm build && pnpm test
Running Pi Tests
Section titled “Running Pi Tests”Run the Pi-focused test set directly with Vitest:
pnpm test -- \ "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" \ "src/agents/pi-hooks/**/*.test.ts"To include the live provider exercise:
OPENCLAW_LIVE_TEST=1 pnpm test -- src/agents/pi-embedded-runner-extraparams.live.test.tsThis covers the main Pi unit suites:
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
Section titled “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
Section titled “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 configcredentials/for auth profiles and tokensagents/<agentId>/sessions/for agent session historyagents/<agentId>/sessions.jsonfor the session indexsessions/if legacy paths existworkspace/if you want a blank workspace
If you only want to reset sessions, delete agents/<agentId>/sessions/ and agents/<agentId>/sessions.json for that agent. Keep credentials/ if you do not want to reauthenticate.