From 0065ded9258a104496aa7c224600fddf0b065c06 Mon Sep 17 00:00:00 2001 From: thzxx Date: Fri, 24 Apr 2026 14:02:56 +0800 Subject: [PATCH] fix: replace 'any' type with ChatDB for state.get(KEYS.DB) The DB state variable in agent-engine.ts was typed as 'any', bypassing type checking for getSetting() calls. Replaced with proper ChatDB type import and null-safe typing. --- src/renderer/services/agent-engine.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/services/agent-engine.ts b/src/renderer/services/agent-engine.ts index 073f405..4dc3035 100644 --- a/src/renderer/services/agent-engine.ts +++ b/src/renderer/services/agent-engine.ts @@ -5,6 +5,7 @@ */ import { OllamaAPI } from '../api/ollama.js'; +import { ChatDB } from '../db/chat-db.js'; import { state, KEYS } from '../state/state.js'; import { executeTool, @@ -443,7 +444,7 @@ export async function runAgentLoop( } // v4.2 注入用户画像 - const db = state.get(KEYS.DB); + const db = state.get(KEYS.DB); if (db) { try { const userProfile = await db.getSetting('user_profile', null);