From d6b208342edf97bafa5b1dcc986b782f9879d141 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Thu, 21 May 2026 17:30:08 +0900 Subject: feat: SQLite database for all credentials, keys, wake schedule, and usage cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add SQLite database at ~/.local/share/dispatch/dispatch.db with tables: credentials, api_keys, wake_schedule, usage_cache - Store Claude OAuth credentials in DB with import button in Model Status UI - Store OpenCode/Copilot API keys in DB with paste-to-import modal - Store OpenCode cookie and workspace IDs in DB - Migrate wake schedule from .wake-schedule.json to DB - Migrate usage cache from in-memory Map + localStorage to DB - Remove all env var and file fallbacks — DB is the single source of truth - Add seed scripts: bin/import-credentials.ts, bin/seed-opencode-keys.ts - Docker: container runs as host UID/GID with matching home directory - Clean up dispatch.toml: remove env fields, update comments - Progress bar time markers for usage cycle tracking --- dispatch.toml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'dispatch.toml') diff --git a/dispatch.toml b/dispatch.toml index 7e6fa5a..6789e95 100644 --- a/dispatch.toml +++ b/dispatch.toml @@ -1,11 +1,8 @@ # Dispatch — Model & Key Configuration -# Keys reference env var names in .env.dispatch +# Credentials and API keys are stored in the SQLite database. +# Use the Model Status panel to import credentials, or run bin/import-credentials.ts. # ─── Fallback Order (highest priority first) ──────────────────── -# Exhaust claude-max first, then opencode-1, then opencode-2, then copilot. -# When all keys are exhausted the agent enters wait-for-refresh. -# Must be declared BEFORE any [[keys]] / [[models]] blocks. - fallback = ["claude-pro", "claude-max", "opencode-1", "opencode-2", "copilot"] # ─── API Keys ─────────────────────────────────────────────────── @@ -14,30 +11,27 @@ fallback = ["claude-pro", "claude-max", "opencode-1", "opencode-2", "copilot"] id = "claude-pro" provider = "anthropic" base_url = "https://api.anthropic.com/v1" -credentials_file = "/root/.claude/.credentials-1.json" +credentials_file = "/home/tradam/.claude/.credentials-1.json" [[keys]] id = "claude-max" provider = "anthropic" base_url = "https://api.anthropic.com/v1" -credentials_file = "/root/.claude/.credentials-2.json" +credentials_file = "/home/tradam/.claude/.credentials-2.json" [[keys]] id = "opencode-1" provider = "opencode-go" -env = "OPENCODE_KEY_1" base_url = "https://opencode.ai/zen/go/v1" [[keys]] id = "opencode-2" provider = "opencode-go" -env = "OPENCODE_KEY_2" base_url = "https://opencode.ai/zen/go/v1" [[keys]] id = "copilot" provider = "github-copilot" -env = "COPILOT_TOKEN" base_url = "https://api.githubcopilot.com" # ─── Models ───────────────────────────────────────────────────── -- cgit v1.2.3