feat: Claude Agent SDK backend + clean-room PostgresSessionStore (v2.7.5)
Lands the lean-SDK direction (boocode_code_review_v2 §1 #9) behind a flag. Adds @anthropic-ai/claude-agent-sdk@0.3.159 (Commercial Terms, runtime dep). - PostgresSessionStore: clean-room impl of the SDK's real SessionStore type over a new claude_session_entries table. Typechecks against the SDK type; 8 DB-integration tests. - ClaudeSdkBackend (implements AgentBackend): one warm query() per (chat,claude) in streaming-input mode via a pushable async-iterable pump, sessionStore + resume continuity, pure mapSdkMessage->AgentEvent, session_id from init, usage/cost onto agent_sessions (backend CHECK gains 'claude_sdk'). - Routing env-gated by CLAUDE_SDK_BACKEND (default off) -> PTY path UNCHANGED. - Built against real SDK 0.3.159 types (install paid off: partial=stream_event needing includePartialMessages, MessageParam, result error arm). - Fix latent test-infra deadlock: serialize DB suites (fileParallelism:false). Coder 269 passing default / 290 with DB; tsc clean vs SDK types; builds clean. LIVE pump + resume + actual claude turn need a host smoke (CLAUDE_SDK_BACKEND=1 + claude binary + auth). zod peer-dep wants ^4 (workspace 3.25). Builds on v2.7.4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,12 @@ export const PROVIDERS: ProviderDef[] = [
|
||||
},
|
||||
{
|
||||
name: 'claude',
|
||||
// transport stays 'pty' — the DEFAULT dispatch path (one-shot `claude
|
||||
// --output-format stream-json`). claude-sdk-sessionstore #9 (Part 2) adds a warm
|
||||
// Claude-Agent-SDK backend (services/backends/claude-sdk.ts) routed ONLY when the
|
||||
// `CLAUDE_SDK_BACKEND` env flag is truthy AND the task is a chat tab; with the flag
|
||||
// off (production default) claude always uses this PTY path, so the transport label
|
||||
// is left unchanged. Flip the env var on a host (after a live smoke) to opt in.
|
||||
label: 'Claude Code',
|
||||
transport: 'pty',
|
||||
modelSource: 'static',
|
||||
|
||||
Reference in New Issue
Block a user