-
Notifications
You must be signed in to change notification settings - Fork 0
ACP Integration
The single most important — and highest-risk — subsystem. Read before touching
core/acp/.
Vellum runs on first-party, sanctioned paths only:
-
Claude →
claude-code-acp, drawing from the Agent-SDK credit bundled in the user's Pro/Max plan (official since 2026-06-15). -
Codex →
codex-acp, drawing from the user's ChatGPT plan (Codex sign-in).
Banned: bridging subscription OAuth tokens into a third-party harness.
Anthropic prohibited this (Feb 2026) and actively blocks it (since Apr 2026).
This is why tools like OpenCode/Cline had to fall back to API keys. Vellum must
never attempt an OAuth bridge or a raw ANTHROPIC_API_KEY / OPENAI_API_KEY
path. If the sanctioned adapter can't authenticate, that's a user-side CLI
sign-in problem — surface it, don't work around it.
Reality check to set expectations: this is plan-bundled credit, not infinite free AI. Heavy synthesis can exhaust it. Surface usage where sensible.
Vellum is an ACP client; each backend is an ACP server subprocess spoken
to over stdio via JSON-RPC (session/new, session/prompt, streaming updates,
tool-call + permission events). This mirrors how Zed runs Claude Agent + Codex +
Gemini concurrently.
Contract: core/acp/client.ts (AcpClient, AcpSession, AcpBackend,
AcpPromptRequest, AcpUpdate).
StdioAcpClient shipped in PR #1, hardened in PR #8. Realities found:
-
Dep: the canonical lib is
@agentclientprotocol/sdk(v1.2.1). The older@zed-industries/agent-client-protocolname is deprecated / renamed to it — verify on npm, don't use the old name. -
Claude backend: VERIFIED on-plan.
npm run smoke:acp -- claudestreamed a real reply ending indoneagainst the signed-in plan. The full ingest loop (arXiv 1706.03762) ran agent extraction on-plan successfully. -
Codex backend: UNVERIFIED.
@zed-industries/codex-acp@0.16.0is too old for the current Codex CLI model (gpt-5.6-luna requires a newer version of Codex). User-side upgrade needed, thennpm run smoke:acp -- codex. Not a Vellum bug — surface adapter/CLI version gaps, don't work around them. -
Two gotchas handled in PR #8: (1)
claude-code-acprefuses to launch whenCLAUDECODEis set (nested Claude Code session) — the client stripsCLAUDECODE/CLAUDE_CODE_SSE_PORTfrom the adapter's child env. (2) A stalled turn used to hang forever — now bounded by 60s handshake/turn timeouts. -
Cold start is slow:
session/newforclaude-code-acptakes ~16s (loads a large skill/command set), so timeouts must stay generous.
First tasks (in order — see Phase-1-MVP)
-
Pick the ACP dep. Check npm for the current canonical ACP TypeScript
client lib (likely
@zed-industries/agent-client-protocol— verify, don't guess). Add topackage.json. -
Implement
StdioAcpClient. Spawn the adapter subprocess, speak ACP over stdio, map events ontoAcpUpdate. - Smoke test both backends respond over stdio on the local signed-in plan, in isolation, before any UI wiring. This de-risks the whole project.
No RAG. Chat passes the paper's data/papers/<slug>/paper.md path as a context
file; the agent reads/greps it with its own tools. Single papers fit in context
directly; corpus questions let the agent grep across data/papers/.