mirror of
https://github.com/dtzp555-max/olp.git
synced 2026-07-21 21:15:10 +00:00
Final Phase 4 substantive D-day group. 3 D-days bundled per Iron Rule 11 IDR (plugin consumes existing endpoints; integration docs reference plugin + olp CLI + olp-connect together; README index links all). After this PR merges, Phase 4 has shipped all 5 D-day groups (D60 charter + port / D61-D63 SSE heartbeat+ring+/status / D64-D67 olp CLI+doctor / D68-D70 olp-connect+anonymous-key+ADR0011 / D71-D73 plugin+docs). The v0.4.0 close PR is maintainer-triggered per CLAUDE.md release_kit overlay. ## D71 — olp-plugin/ (OpenClaw gateway plugin) Port OCP ocp-plugin/index.js (311 lines) → OLP olp-plugin/index.js (482 lines) as the /olp Telegram+Discord slash command, but MINUS mutations (no /olp keys keygen, no /olp keys revoke, no /olp restart, no /olp logs — all of these require SSH out of chat for security). Plugin shape: - olp-plugin/index.js — registers /olp command via OpenClaw api.registerCommand - olp-plugin/openclaw.plugin.json — manifest, apiKey REQUIRED, proxyUrl default http://127.0.0.1:4567 (matches D60) - olp-plugin/package.json — minimal: name/version/type:module + OpenClaw discovery block - olp-plugin/README.md — install + configure + use docs; documents the "no mutations from chat" security stance and the dedicated-bot-key pattern (don't share maintainer's personal key with the bot) Subcommand parity with olp CLI (D64-D67): - /olp status → GET /v0/management/status (owner-only) - /olp health → GET /health (public-ok) - /olp usage → GET /v0/management/dashboard-data (owner-only) - /olp models → GET /v1/models (public-ok) - /olp cache → GET /cache/stats (owner-only) - /olp providers → local cross-ref (public-ok) - /olp chain show [<model>] → local (public-ok, advisory if no FS access — defer to ssh + olp chain show) - /olp doctor → informational (HTTP doctor endpoint deferred; advisory to ssh + olp doctor for live use) - /olp help → usage text Port resolution: OLP_PROXY_URL env → OLP_PORT env → plugin config proxyUrl → http://127.0.0.1:4567. Output: Telegram/Discord monospace code block with status icons (🟢🟡🔴). Long responses truncated for the 4096-char message limit. No npm deps. OpenClaw provides Telegram/Discord transport; plugin uses fetch + node builtins only. ## D72 — docs/integrations/*.md (6 IDE pages + index) Per the Phase 4 brainstorm prior-art survey + ADR 0010 § Out-of-scope posture for Claude Code: - continue.md ✅ — config.yaml (NOT config.json); apiBase; requestOptions.headers - cline.md ✅ — "OpenAI Compatible" provider; Cline #7128 base-URL UI bug warning - cursor.md ⚠️ — known base-URL fragility; only enable models OLP serves - aider.md ✅ — OPENAI_API_BASE env + openai/ prefix; .env support - claude-code.md ❌ — explicitly NOT supported per ADR 0010 § /v1/messages defer rationale; recommended alternative: Cline + OLP - openclaw.md ✅ — install olp-plugin via CLI or symlink; configure apiKey; restart gateway Each ~60-120 lines: status / quick setup / known issues / OLP-specific notes / test-it command. docs/integrations/README.md is the index. ## D73 — README cross-references - New § "IDE Setup" links to docs/integrations/README.md - New § "Telegram / Discord Usage" — install + configure + restart + use - Quick Start mentions olp-connect <ip> as family-onboarding command - package.json `files` field extended to include olp-plugin/ so the published tarball ships the plugin ## Test count 672 → 696 (+24 D71-D73 tests in Suite 35: helpers / formatters / dispatch / error paths). All 696 pass locally. ## Scope discipline - server.mjs UNTOUCHED (plugin consumes EXISTING endpoints) - No new npm deps (no Telegram or Discord SDK — OpenClaw provides transport) - No /v1/messages (out of Phase 4 per ADR 0010) - No CHANGELOG / package.json version bump (Phase 4 close handles versioning; only package.json `files` extended for olp-plugin/ publication) ## Implementor flagged for reviewer 1. /olp doctor returns SSH advisory (no HTTP doctor endpoint yet). When future phase exposes /v0/management/doctor, swap advisory branch for real fetchJSON + fmtDoctor (already implemented + tested). 2. /olp providers + chain show have no FS access (plugin runs in OpenClaw gateway process); registry read via lazy-imported models-registry.json from repo root. For live enabled-state visibility users still need /olp status (owner-tier) or ssh + olp providers / olp chain show. 3. No live-server wire test in Suite 35 — existing Suites 31/32 already cover the integration path against the same endpoints; mock-fetch in Suite 35 is sufficient signal for the plugin layer. ## Authority - ADR 0010 § Phase 4 D-day plan D71-D73 line - OCP ocp-plugin/index.js (port reference) - ADR 0010 § Out-of-Phase-4-scope (claude-code.md ❌ rationale) - 2026-05-26 brainstorm (Top OCP inheritance candidates + prior-art survey IDE-specific quirks for cline/cursor/continue docs) Co-authored-by: dtzp555 <dtzp555@gmail.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
96 lines
3.4 KiB
Markdown
96 lines
3.4 KiB
Markdown
# Continue.dev + OLP
|
|
|
|
[Continue.dev](https://continue.dev) is an open-source autocomplete +
|
|
chat extension for VS Code and JetBrains IDEs. It speaks OpenAI's
|
|
`/v1/chat/completions` wire format, so it works against OLP with no
|
|
shim layer.
|
|
|
|
**Status:** ✅ Supported.
|
|
|
|
**Tested against:** Continue.dev v0.10.x (`config.yaml` schema). The
|
|
older `config.json` schema (≤ v0.8) is **not** documented here — Continue
|
|
deprecated it in late 2025 and emits a one-shot migration warning.
|
|
|
|
## Quick setup
|
|
|
|
Edit `~/.continue/config.yaml` (or open the Continue config from the IDE's
|
|
extension panel and paste this in):
|
|
|
|
```yaml
|
|
models:
|
|
- name: olp-chat
|
|
provider: openai
|
|
model: claude-sonnet-4-5
|
|
apiBase: http://127.0.0.1:4567/v1
|
|
apiKey: olp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
roles:
|
|
- chat
|
|
requestOptions:
|
|
headers:
|
|
# Optional: pin which routing chain key applies. If omitted, OLP
|
|
# looks up the chain via the model name above.
|
|
X-OLP-Chain: claude-sonnet-4-5
|
|
- name: olp-autocomplete
|
|
provider: openai
|
|
model: claude-haiku-4-5
|
|
apiBase: http://127.0.0.1:4567/v1
|
|
apiKey: olp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
roles:
|
|
- autocomplete
|
|
```
|
|
|
|
Replace the API key with the plaintext token printed by `olp-keys keygen
|
|
--name=continue-dev`. Family members on the LAN should substitute the OLP
|
|
host's IP for `127.0.0.1` (or use `olp-connect <ip>` to do this for them
|
|
automatically).
|
|
|
|
## Known issues
|
|
|
|
- **`apiBase`, NOT `baseURL`.** Continue's YAML schema uses `apiBase` (no
|
|
`URL` casing). The older `config.json` `baseURL` key was renamed during the
|
|
v0.10 schema cut. If you copy a snippet from a 2024 blog post and it
|
|
silently routes to api.openai.com, this is why.
|
|
- **Trailing `/v1` matters.** OLP's chat-completions endpoint is at
|
|
`/v1/chat/completions`; Continue appends `/chat/completions` to whatever
|
|
`apiBase` resolves to. Set `apiBase: http://host:4567/v1` (with `/v1`),
|
|
not the bare host.
|
|
- **Provider stays `openai`.** Continue's `provider: anthropic` would send
|
|
Anthropic-shape requests to `/v1/messages`, which OLP does not implement
|
|
(see [`claude-code.md`](./claude-code.md) for the rationale).
|
|
|
|
## OLP-specific notes
|
|
|
|
Continue's `requestOptions.headers` lets you pin OLP-specific routing
|
|
behaviour without altering the model name itself. Useful headers:
|
|
|
|
- `X-OLP-Chain: <chain-key>` — explicitly select the routing chain.
|
|
- `X-OLP-Bypass-Cache: true` — force a fresh spawn for the next request
|
|
(debugging cache-poisoning suspicions).
|
|
|
|
OLP's response headers (`X-OLP-Provider-Used`, `X-OLP-Cache`, etc.) are
|
|
visible via VS Code's `Developer: Toggle Developer Tools` → Network panel
|
|
when Continue runs the request.
|
|
|
|
## Test it
|
|
|
|
After config save, open the Continue chat panel and send a one-word
|
|
message ("ok"). Then on the terminal:
|
|
|
|
```bash
|
|
curl -sI -X POST http://127.0.0.1:4567/v1/chat/completions \
|
|
-H "Authorization: Bearer olp_XXXXXX" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"ok"}],"max_tokens":5}' \
|
|
| grep -i x-olp
|
|
```
|
|
|
|
Expect `X-OLP-Provider-Used: anthropic` (or whichever provider your chain
|
|
routes haiku to) and `X-OLP-Cache: miss` on first request, `hit` on the
|
|
second.
|
|
|
|
## Cross-references
|
|
|
|
- Continue.dev config reference: https://docs.continue.dev/customization/models
|
|
- [`olp-connect`](../../bin/olp-connect) automates the Continue.dev branch
|
|
of this setup.
|