- Create troubleshoot_sessions table in D1 - Replace KV session storage with D1 - Unify field names to snake_case (user_id, collected_info, created_at, updated_at, expires_at) - Add __PASSTHROUGH__/__SESSION_END__ marker support - Change handler signature to match domain/deposit pattern - Extract system prompt to constant TROUBLESHOOT_EXPERT_PROMPT - Add hasTroubleshootSession() for routing - Update openai-service.ts to use new D1-based functions - Update troubleshoot-tool.ts to use D1 instead of KV - Add TroubleshootSessionStatus type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
495 B
SQL
15 lines
495 B
SQL
-- Troubleshoot Agent Sessions (D1)
|
|
-- 기존 KV 세션을 D1로 마이그레이션
|
|
|
|
CREATE TABLE IF NOT EXISTS troubleshoot_sessions (
|
|
user_id TEXT PRIMARY KEY,
|
|
status TEXT NOT NULL CHECK(status IN ('gathering', 'diagnosing', 'suggesting', 'completed')),
|
|
collected_info TEXT,
|
|
messages TEXT,
|
|
created_at INTEGER NOT NULL,
|
|
updated_at INTEGER NOT NULL,
|
|
expires_at INTEGER NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_troubleshoot_sessions_expires ON troubleshoot_sessions(expires_at);
|