feat: Stream-Error-Info für Debugging bei unexpected_end / max_tokens

- chains Tabelle: neue Spalte stream_error_info (TEXT)
- ChainRecord: neues Property StreamErrorInfo
- AnthropicService/ProcessStream: sammelt Debug-Infos bei problematischen
  stop_reasons (unexpected_end, max_tokens) und API error-Events
- FinalizeChain: speichert stream_error_info in DB
- SSE done-Event: enthält streamErrorInfo für Client-seitiges Debugging
This commit is contained in:
Meleki committed 2026-03-03 09:14:04 +01:00
1 parent dc87bf802a
commit 99914bd343
3 files changed
+60 -9

No files matched your search

+2
View File
@@ -140,6 +140,7 @@ public class DatabaseService
conn.Execute("UPDATE agents SET auto_commit = 'enforce' WHERE auto_commit = '1' OR auto_commit = 1");
}
catch { /* already migrated */ }
TryAddColumn(conn, "chains", "stream_error_info", "TEXT");
TryAddColumn(conn, "agents", "use_soul", "INTEGER NOT NULL DEFAULT 1");
TryAddColumn(conn, "agents", "use_identity", "INTEGER NOT NULL DEFAULT 1");
TryAddColumn(conn, "agents", "use_user_info", "INTEGER NOT NULL DEFAULT 1");
@@ -459,6 +460,7 @@ public class DatabaseService
cache_read_tokens = @CacheReadTokens,
iterations = @Iterations,
stop_reason = @StopReason,
stream_error_info = @StreamErrorInfo,
duration_ms = @DurationMs
WHERE chain_id = @ChainId
", chain);