The largest architecture change since launch. v1.0.13 replaces the Vercel AI SDK unified executor with direct OpenCode server integration, consolidates all non-CLI providers under a single runtime, adds a full local model discovery pipeline, and introduces 900+ lines of new tool tests.Documentation Index
Fetch the complete documentation index at: https://ade-app.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
OpenCode Runtime Integration
This is PR #142 — the headline change of this release. It touches 250 files across +19,400 / -10,500 lines.
Unified provider system
The previous architecture maintained separate execution paths: CLI-wrapped providers (Claude CLI, Codex CLI) spawned as subprocesses, while API-key and local models ran through an in-process Vercel AI SDK executor with per-provider adapters (@ai-sdk/anthropic, @ai-sdk/openai, etc.). This split required ADE to manage SDK versions, adapter quirks, and streaming behavior for each provider independently.
v1.0.13 replaces the in-process SDK path with the OpenCode server — a local model routing server that handles all non-CLI providers through a single runtime. The ModelProviderGroup type is now "claude" | "codex" | "opencode" | "cursor", replacing the previous "unified" group.
Removed modules:
providerResolver.tsand its test suite — 650+ lines of per-provider adapter wiringunifiedExecutor.ts— 600-line Vercel AI SDK executorunifiedSessionProcessor.ts— 388-line session processorunifiedToolLoopGovernor.ts— tool loop governor (rewritten into providerTaskRunner)middleware.ts— 458-line Vercel AI SDK middleware layeradeProviderRegistry.ts— per-provider registrytools/index.ts— static tool index (tools are now composed dynamically)verify-ai-sdks.cjs— SDK verification script
providerTaskRunner.ts— 306-line provider-routed task runner with Claude, Codex, Cursor, and OpenCode paths, each with proper timeout enforcement and permission mode mappingopencode/openCodeRuntime.ts— OpenCode SDK client for streaming sessions, text prompts, and server lifecycle managementopencode/openCodeInventory.ts— Provider inventory probing with shared server pooling, idle TTL, and deduped in-flight requestsopencode/openCodeModelCatalog.ts— Dynamic model catalog parsing from OpenCode CLI output with verbose JSON and plain-text fallbackopencode/openCodeBinaryManager.ts— Binary resolution with user-installed and bundled fallback paths, cached across process lifetime
Model catalog and dynamic discovery
ADE now discovers available models at runtime by querying the OpenCode server’s provider and model inventory. TheenrichModelRegistry function merges discovered models into the static registry, and replaceDynamicOpenCodeModelDescriptors swaps placeholder entries for real model descriptors with accurate context windows, output limits, and reasoning tier metadata.
The model registry (modelRegistry.ts) gained new fields:
openCodeProviderId— upstream provider identifier for OpenCode server routingopenCodeModelId— model identifier as reported by OpenCode (may contain/)encodeOpenCodeRegistryId/decodeOpenCodeRegistryId— stable encoding for registry IDs that contain provider/model path separators
Tool exposure policy
NewtoolExposurePolicy.ts module implements score-based heuristics for deciding which tools to expose to the model based on prompt content. Frontend repository discovery tools (findRoutingFiles, findPageComponents, findAppEntryPoints, summarizeFrontendStructure) are only exposed when the prompt scores >= 2 on a weighted signal system:
- High-confidence signals (score +2 each): “website”, “web app”, “frontend”, “react”, “tsx/jsx”, “ui”, “navbar”, “sidebar”, “layout”, “css/html”
- Supporting signals (score +1 each): “page”, “screen”, “component”, “route”, “navigation”, “menu”, “header/footer”, “button/form/modal”
Permission mode mapping
TheproviderTaskRunner maps ADE’s AgentPermissionMode to each provider’s native permission scheme:
| ADE Mode | Claude CLI | Codex CLI | Cursor CLI | OpenCode |
|---|---|---|---|---|
full-auto | bypassPermissions | danger-full-access | (default) | ade-full-auto profile |
edit | acceptEdits | workspace-write | (default) | ade-edit profile |
read-only / plan | plan | read-only | ask mode | ade-plan profile |
Runtime message types
NewruntimeMessageTypes.ts decouples ADE’s internal message representation from provider-specific SDK types:
CLI ADE CLI config normalization
NewcliMcpConfig.ts normalizes ADE CLI configuration between Claude (type field) and Codex (transport field) formats, ensuring consistent ADE CLI wiring regardless of which CLI provider is executing.
New Tool System
globSearch, grepSearch, readFileRange overhaul
All three core file-access tools were rewritten with hardened input validation, path containment checks, and proper error handling. Each tool now uses theexecutableTool pattern (typed with Zod schemas) and integrates with the project root containment system.
900+ lines of new tool tests
globSearch.test.ts— 219 lines covering pattern matching, symlink traversal prevention, and empty resultsgrepSearch.test.ts— 276 lines covering regex search, binary file filtering, and match context extractionreadFileRange.test.ts— 197 lines covering range reads, boundary conditions, and encoding edge casesuniversalTools.test.ts— expanded by 364 lines with new coverage for tool composition, permission gating, and sandbox configuration
Compaction engine tests
New 526-linecompactionEngine.test.ts covering transcript persistence, compaction triggering, summary generation, and token accounting.
Local model discovery tests
New 486-linelocalModelDiscovery.test.ts covering endpoint probing for Ollama and LM Studio, model capability inference, harness profile assignment, and cache invalidation.
Local AI Runtime
Local provider discovery pipeline
New end-to-end local provider detection system (localModelDiscovery.ts, expanded from 80 to 381 lines):
- Endpoint probing — HTTP health checks against Ollama (
localhost:11434) and LM Studio (localhost:1234) with configurable endpoints per project config - Model inspection — Queries
/v1/modelsor/api/tagsto enumerate loaded models with metadata (context window, capabilities, loaded/installed state) - Capability inference — Infers
ModelCapabilities(tools, vision, reasoning, streaming) from model name heuristics and provider metadata - Harness profile assignment — Assigns
verified,guarded, orread_onlyprofiles based on model trust level - TTL-based caching — 30-second cache with generation-based invalidation and explicit reset
Runtime connections
AiIntegrationStatus now includes runtimeConnections describing all available connection types:
cli— Claude/Codex/Cursor CLI with subscription authapi-key— Direct API key providers (Anthropic, OpenAI, Google, etc.)local— Ollama/LM Studio endpoints with model inventoryopenrouter— OpenRouter aggregated access
Structured prompts for local models
Local model sessions now receive structured system prompts tuned for models with smaller context windows and varying tool capabilities. The harness profile (verified/guarded/read_only) determines which tools are exposed and what permission boundaries are enforced.
Agent Chat Service
Chat runtime management
The agent chat service (agentChatService.ts, net +2,284/-2,284 lines restructured) now manages chat runtimes per provider group. Runtime selection is determined at session creation based on the selected model’s provider group, and the session tracks its runtime throughout its lifecycle.
Terminal session signals
terminalSessionSignals.ts expanded with new signal types for terminal session lifecycle management, enabling tighter integration between chat sessions and their associated terminal processes.
Session list cache invalidation
Cross-tab session list cache is now invalidated when creating new sessions, preventing stale session lists in multi-window scenarios.Fixes
- Claude stream idle timeout removed — Previously, Claude streaming sessions had a 75-second idle timeout that was increased to 300 seconds, then removed entirely. Long-running tool calls (builds, test suites) no longer risk timeout mid-execution
- Session list cache cross-tab sync — Creating a session in one window now invalidates the session list cache in all other windows, preventing stale or missing entries
- Local model banner merge — CLI and local runtime banners in the chat pane are now merged instead of stacking, reducing visual noise when multiple provider types are detected
- Permission mode reset — Unified permission mode is now reset when the harness profile recommendation changes due to model switching, preventing stale permission grants
- Auth detector hardening —
authDetector.tsgained 41 lines of new tests and improved error handling for edge cases in CLI auth detection
Changed
- Model registry —
ProviderFamilytype expanded with"opencode"family.ModelProviderGroupchanged from"claude" | "codex" | "unified" | "cursor"to"claude" | "codex" | "opencode" | "cursor". AllisCliWrapped: falsemodels now route through the OpenCode server instead of in-process SDK adapters - AI integration service — Imports
clearOpenCodeInventoryCache,probeOpenCodeProviderInventory,resolveOpenCodeBinaryfor runtime discovery.detectAllAuthand model resolution updated to use OpenCode inventory results. Dynamic model descriptors replaced viareplaceDynamicOpenCodeModelDescriptors - Agent executor — Simplified to delegate to
providerTaskRunnerinstead of maintaining per-provider executor classes - Compaction engine — Now uses
runOpenCodeTextPromptfor compaction summaries instead of the removed Vercel AI SDK path - CTO identity — Updated version and identity file structure
- Test setup — Global test setup files updated with new mocks for OpenCode modules and removed Vercel AI SDK mocks
- Package dependencies — Removed
@ai-sdk/anthropic,@ai-sdk/google,@ai-sdk/openai,ai(Vercel AI SDK). Added@opencode-ai/sdk
Removed
- Vercel AI SDK dependency —
@ai-sdk/anthropic,@ai-sdk/google,@ai-sdk/openai, and the coreaipackage removed frompackage.json(-320 lines from lockfile) verify-ai-sdks.cjs— Build-time SDK verification script (89 lines)adeProviderRegistry.ts— Per-provider adapter registry (31 lines)providerResolver.tsand tests — Provider resolution layer (446 + 237 lines)unifiedExecutor.tsand tests — Vercel AI SDK executor (600 + 75 lines)unifiedSessionProcessor.tsand tests — Session processing layer (388 + 67 lines)unifiedToolLoopGovernor.tstests — Governor tests (130 lines, governor rewritten)middleware.tsand tests — Vercel AI SDK middleware (458 + 115 lines)tools/index.ts— Static tool index (35 lines)