All agents working in this repository must run validation after each code change before marking work complete.
Required steps:
- Run full repo build:
./build.ps1
- Run shared tests:
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
- Run tray tests:
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
If a command fails:
- Fix the issue.
- Re-run the failed command.
- Re-run all required validation commands before completion.
Notes:
- If a build/test is blocked by an environmental lock (for example running executable locking output assemblies), stop/close the locking process and rerun.
- First-run gotcha:
dotnet test --no-restoresilently no-ops in a fresh worktree where the testbin/doesn't exist yet (reports "Build succeeded in 0.5s" then exits 0 with no tests run). For first-run validation, either omit--no-restoreOR rundotnet buildon the test project first. Subsequent reruns honor--no-restorecorrectly. - In linked git worktrees, set
OPENCLAW_REPO_ROOTto the worktree path before running tests that discover the repository root, for example:$env:OPENCLAW_REPO_ROOT='D:\github\moltbot-windows-hub.<worktree-name>'
- Tray tests must isolate
SettingsManagerfrom real user settings. Do not usenew SettingsManager()in tests unless the test intentionally reads%APPDATA%\OpenClawTray\settings.json; pass a temp settings directory or setOPENCLAW_TRAY_DATA_DIRbefore the test process starts. - Prefer isolated worktrees for PR validation. Use
git-wtfor worktree workflows;wt.exemay resolve to WorkTrunk instead of Windows Terminal, so use the full Windows Terminal path when explicitly launching Terminal. - Do not claim completion without reporting validation results.
Start with these docs before changing connection, pairing, node, MCP, or tray UX behavior:
docs/CONNECTION_ARCHITECTURE.md- current gateway registry, connection manager, credential precedence, migration, MCP-only, and tray action behavior.docs/MCP_MODE.md- local MCP server mode and theEnableNodeMode/EnableMcpServermatrix.docs/WINDOWS_NODE_TESTING.md- Windows node capabilities, manual smokes, and gateway-dependent behavior.docs/ONBOARDING_WIZARD.md- first-run setup flow, setup-code/bootstrap pairing, and test isolation.
Important current facts:
- Gateway credentials are no longer stored in
SettingsData.Token/SettingsData.BootstrapToken.SettingsManagermay read legacy JSON fields only for one-time migration; new writes must go throughGatewayRegistry. - Active gateway records live in
%APPDATA%\OpenClawTray\gateways.json; per-gateway identity files live under%APPDATA%\OpenClawTray\gateways\<gateway-id>\device-key-ed25519.json. - Credential precedence is device token, then shared gateway token, then bootstrap token. Do not downgrade a paired device from its stored device token back to a bootstrap/shared token.
GatewayConnectionManagerowns operator/node connection state. UI surfaces should observe it or call its reconnect/disconnect APIs instead of constructing parallel gateway clients.- Chat/canvas/tray actions must visibly route users to Connection settings when pairing is incomplete or credentials are missing; avoid silent no-ops.
- MCP-only mode (
EnableMcpServer=true,EnableNodeMode=false) must start localNodeServicewithout requiring a gateway credential.