# omp (oh-my-pi) — Phase 3 agent pilot config

Canonical copies of the omp config deployed at `~/.omp/agent/` on the MacBook.
Deploy: `cp <file> ~/.omp/agent/` (omp re-reads config per invocation; no daemon).

omp itself: binary install `v17.0.5` at `~/.local/bin/omp`
(installer: `curl -fsSL https://omp.sh/install | sh -s -- --binary`; binary mode
used because the machine's bun 1.3.5 < required 1.3.14).

| File | Purpose |
|---|---|
| `models.yml` | Providers: `ahel` (a deployed provider name, not the project's — see `../../../../WORKSPACE.md` → "Legacy identifiers") = pool 35B via Bifrost (`http://192.168.8.168:8081/v1`, model `ahel-pool/qwen3.6-35b-heretic`, ctx 24576); `ahel-local` = MacBook 4B (`http://127.0.0.1:8083/v1`, model `qwen3-4b-instruct`, ctx 16384). Sampling left server-side. |
| `config.yml` | Role routing: `default`/`plan` → 35B, `smol`/`commit` → 4B. Disables Claude/Codex/Gemini/OpenCode/Cursor/GitHub discovery + local model probes + skills — keeps the system prompt inside the pool's 24576-token window. AGENTS.md discovery (native/agents-md) stays active. |
| `mcp.json` | `disabledServers` denylist for MCP servers inherited from the Claude ecosystem configs (serena, kubernetes, stripe, ...). Without this the inlined MCP schemas blow the context (33.7k tokens > 24576). |
| `APPEND_SYSTEM.md` | Trimmed brevity rules from repo `SOUL.md` (appended to omp's default prompt; SOUL.md itself untouched). |
| `extensions/viking.ts` | `viking_context` tool — authenticated federation search/read through M1 (`http://100.117.228.68:8093/v2/find` and `/v2/read`) with fixed `local` audience, 60-second timeout, capped response bodies, and 2500/3500-character outputs. Set `AHEL_VIKING_TOOL_TOKEN_FILE` in omp's service environment to a readable token file; its value and path are never returned or logged. Deploy to `~/.omp/agent/extensions/` (auto-discovered). |
| `extensions/browse.ts` | `browse_page` tool — Browserbase cloud-browser fetch over raw CDP, 4k char cap; creds read at call time from `~/.config/ahel/browserbase.env`. Port of `.opencode/tools/browse.ts`. Note omp also has a built-in `browser` tool (local Puppeteer); `browse_page` is kept for parity + bot-wall/JS pages without a local browser. |

Gotchas:
- Knowledge privacy is enforced twice: M1 policy permits the `local` audience to search both realms, and the extension accepts only normalized `cloud`/`private` results. Cloud-model clients use `cloud` audience and cannot receive private results. OMP must not be launched with the token value in command arguments or committed config; provide only `AHEL_VIKING_TOOL_TOKEN_FILE` through its environment.
- Knowledge rollback is client-only: restore the previous `extensions/viking.ts` from Git to temporarily resume direct MacBook `ov` access. Do not expose the private Studio or change realm/source policy as a rollback shortcut.
- MCP tool schemas are cached in `~/.omp/agent/agent.db` (`cache` table, `mcp_tools:*` keys). If disabled servers reappear in the prompt, purge: `sqlite3 ~/.omp/agent/agent.db "delete from cache where key like 'mcp_tools:%';"`.
- Full omp agent prompt is ~19k tokens → does not fit the 4B's 16384 ctx. The 4B works for smol-role background tasks (small prompts) and `--no-tools` runs, not full agent sessions.
- Non-interactive form: `omp -p --no-session "<prompt>"` (add `--model <selector>` to override the default role).
- CONTEXT-PRESSURE LOOP (found in Task 2): with the FULL default toolset the ~19k prompt sits over omp's compaction threshold in the pool's 24576 window — omp warns "Compaction freed too little context" at startup and the 35B loops re-calling the same tool (observed: 52 identical `viking_context` calls / 53 turns in one 6-min run; a prior run burned 28 min before being killed). Mitigation that produced clean single-call runs: slim the built-ins, e.g. `--tools read,grep` (custom-tool extensions are force-included regardless of `--tools`). Use a slim toolset for battery runs.
- omp dispatches custom tools via a virtual-fs `write` to `xd://<toolname>` (visible in `--mode json` transcripts) — that's normal, not a misfire.
- Starting omp from `~` auto-switches cwd to a temp dir (use `--allow-home` or start in a project dir).
