Files
53afea47ca feat+test+docs: D71+D72+D73 — olp-plugin/ (OpenClaw /olp Telegram+Discord) + docs/integrations/*.md + README cross-refs (#44)
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>
2026-05-26 09:35:23 +10:00

3.9 KiB

Claude Code + OLP

Claude Code is Anthropic's official terminal-native agent. It speaks the Anthropic /v1/messages wire format and cannot be configured to use an OpenAI-compatible chat-completions endpoint.

Status: Not supported.

Why

OLP serves only the OpenAI /v1/chat/completions wire format. Adding /v1/messages (the Anthropic shape) was explicitly considered for Phase 4 and rejected, per ADR 0010 § Out of Phase 4 scope.

The short version of the rationale:

  • No billing benefit. After Anthropic's 2026-06-15 split, claude -p / Agent SDK / third-party agent traffic moves out of the Pro/Max subscription pool and into a separate paid Agent SDK Credit pool. OLP's fallback discipline ("when one provider's quota runs out, try the next") does not save money for this traffic — it just routes the same paid request to a different paid backend. The subscription leverage that makes OLP valuable for OpenAI-shape traffic does not exist for Anthropic-shape traffic.

  • Degrades worse on fallback. When OLP's primary chain entry (Anthropic) is exhausted, the fallback hop is typically OpenAI Codex or Mistral Vibe. Those providers speak OpenAI tool-calling schema; OLP would have to translate Anthropic's /v1/messages tool shape into OpenAI tool shape on every fallback. That translation is lossy and is what ADR 0010 calls out as "net non-positive under P0 failure".

  • Same outcome reachable via the recommended alternative. Cline, Cursor, Aider, and Continue.dev all speak OpenAI's wire format and have parity with Claude Code on the "AI edits files in my repo" use case. OLP serves them today.

What to use instead

Recommended: Cline. It's an in-IDE autonomous coder that operates on the same loop Claude Code does (read files, propose edits, run tools, iterate). The "OpenAI Compatible" provider points cleanly at OLP's /v1/chat/completions endpoint. You get OLP's full fallback chain (Anthropic → OpenAI Codex → Mistral) instead of being pinned to one provider.

For terminal users specifically:

  • Aider if you want the Claude-Code-style git-aware pair programmer in the terminal.
  • OpenClaw if you want Telegram/Discord-driven access to the fallback chain (see openclaw.md).

Re-open trigger

ADR 0010 documents the conditions under which OLP would reconsider /v1/messages:

(a) ADR 0009 P0 confirms interactive-mode billing classification as subscription (≥ 2026-07-15) AND (b) maintainer explicitly opens Phase 5 "Anthropic-shape hub" scope with the name of at least one family member who wants CC access.

Until both conditions fire, OLP intentionally does not implement /v1/messages. The decision is recorded in ADR 0010 § "Out of Phase 4 scope" and ADR 0009 (Anthropic interactive-mode path placeholder).

If you absolutely must use Claude Code

Point Claude Code at api.anthropic.com directly. OLP cannot proxy that traffic. You will:

  • Burn against the Anthropic Pro/Max OAuth subscription (pre-2026-06-15) or the Agent SDK Credit pool (≥ 2026-06-15).
  • Lose every fallback property OLP provides — when Anthropic's quota is exhausted, Claude Code stops working until the quota resets.
  • Lose OLP's response headers (X-OLP-Provider-Used etc.), audit log entries, cache hits, and /health visibility.

This is documented here only so the trade-off is explicit, not as a recommendation.

Cross-references

  • ADR 0010 § "Out of Phase 4 scope" — full defer rationale.
  • ADR 0009 — Anthropic 2026-06-15 billing split and re-open trigger.
  • cline.md — the recommended alternative for Claude-Code-style workflows.