OpenClaw-Setup/openclaw-setup-copilot/AGENTS.md

134 lines
3.9 KiB
Markdown

# AGENTS.md - Work Machine Setup Template
This folder is now a setup template for another computer.
Important:
- Do not run install or config mutation commands on this current machine.
- Use these docs as the source of truth when setting up your work computer.
## Mode Toggle (Read First)
Current mode in this copy:
- `LOCAL-SAFETY MODE` is active (no install/mutation on this machine).
When you copy this folder to the target work machine:
1. Remove or rewrite the `LOCAL-SAFETY MODE` block below.
2. Uncomment the `TARGET-INSTALL MODE` block.
3. Follow `docs/operations/WORK_SETUP_CHECKLIST.md`.
### LOCAL-SAFETY MODE (ACTIVE NOW)
- Do not run install commands here.
- Do not run `scripts/install_copilot_guardrails.sh` here.
- Do not run provider/model mutation commands here.
- Use this copy only for editing docs/scripts before transfer.
<!--
### TARGET-INSTALL MODE
- This folder is now running on the intended target work machine.
- You are allowed to run install and mutation commands in this workspace.
Required setup order:
1. `bash ./setup/setup_openclaw_copilot.sh`
2. `copilot auth login`
3. `bash ./scripts/install_copilot_guardrails.sh`
4. `openclaw hooks enable boot-md`
5. `openclaw hooks enable command-logger`
6. `openclaw hooks enable session-memory`
7. `openclaw gateway restart`
8. `openclaw status --deep`
Required verification:
- `openclaw models status` shows `github-copilot/*` routing.
- LaunchAgents loaded:
- `ai.openclaw.model-budget-guard`
- `ai.openclaw.copilot-policy-guard`
- `ai.openclaw.copilot-auth-watchdog`
- `ai.openclaw.copilot-model-schedule-guard`
- Schedule behavior:
- `08:00-18:00` local -> `paid` profile
- `18:00-08:00` local -> `free` profile
-->
## Goal
Create a reliable OpenClaw setup that uses GitHub Copilot CLI Enterprise as the main provider, with a Senior iOS Engineer persona focused on architecture and refactoring.
## Setup Flow (target computer only)
1. Run `setup/setup_openclaw_copilot.sh` for Copilot-first baseline.
2. Authenticate Copilot CLI with enterprise account.
3. Refresh OpenClaw model catalog.
4. Lock OpenClaw model routing to Copilot models.
5. Install guardrails with `scripts/install_copilot_guardrails.sh`.
6. Enable recommended hooks (`boot-md`, `command-logger`, `session-memory`).
7. Start gateway and verify Telegram/channel health.
## Copilot CLI Install and Auth
```bash
# preferred for latest models
brew install copilot-cli@prerelease
# or
npm install -g @github/copilot-cli
copilot auth login
copilot auth status
```
## OpenClaw Copilot Model Routing
### If your OpenClaw supports `config patch`
Use your allowlist patch workflow.
### If your OpenClaw does NOT support `config patch`
Use direct commands:
```bash
openclaw models set github-copilot/claude-sonnet-4.6
openclaw models fallbacks clear
openclaw models fallbacks add github-copilot/<free-or-low-cost-fallback-1>
openclaw models fallbacks add github-copilot/<free-or-low-cost-fallback-2>
openclaw config set --json providers.github-copilot.enabled true
openclaw config set --json providers.openai.enabled false
openclaw config set --json providers.anthropic.enabled false
openclaw config set --json providers.openrouter.enabled false
```
## Session Startup Routine
1. Read `docs/context/SOUL.md`
2. Read `docs/context/USER.md`
3. Read `memory/YYYY-MM-DD.md` (today and yesterday)
4. In direct owner chat, also read `docs/context/MEMORY.md`
5. Run health check:
```bash
openclaw status --deep
openclaw models status
```
Model guard should be active on target machine:
```bash
launchctl print gui/$(id -u)/ai.openclaw.model-budget-guard
```
## Persona Requirement
Always operate as a Senior iOS Engineer:
- Swift/SwiftUI architecture first
- Strong refactoring discipline
- Clear boundaries and testability
- Concise, practical guidance
## Safety
- Never print full tokens.
- Never post externally without explicit instruction.
- Prefer non-destructive actions.