重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。

同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。

Made-with: Cursor
This commit is contained in:
oliver 2026-04-26 08:34:33 +08:00
parent 4a23b715a2
commit dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions

80
openclaw/docs/pi-dev.md Normal file
View file

@ -0,0 +1,80 @@
---
title: "Pi Development Workflow"
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
---
# 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 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`
## Running Pi Tests
Run the Pi-focused test set directly with Vitest:
```bash
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:
```bash
OPENCLAW_LIVE_TEST=1 pnpm test src/agents/pi-embedded-runner-extraparams.live.test.ts
```
This covers the main Pi unit suites:
- `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`
## 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
- `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
- `agents/<agentId>/sessions/` for agent session history
- `agents/<agentId>/sessions/sessions.json` for the session index
- `sessions/` if legacy paths exist
- `workspace/` if you want a blank workspace
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.
## References
- [Testing](/help/testing)
- [Getting Started](/start/getting-started)