feat(agent): refactor database session storage to normalized DAG entries and lazy thread sync

This commit is contained in:
yiling
2026-07-28 11:21:31 +08:00
parent b876af464e
commit 4e2694e2d9
21 changed files with 930 additions and 252 deletions
+10 -2
View File
@@ -20,6 +20,7 @@ import { createCreateVersionTool } from './tools/create-version'
import { createListAssetsTool } from './tools/list-assets'
import { createReadPdfPagesTool } from './tools/read-pdf-pages'
import { createReadSkillTool } from './tools/read-skill'
import { createReadThreadTool } from './tools/read-thread'
import { createSandboxedBashTool } from './tools/sandboxed-bash'
import { createScreenshotTool } from './tools/screenshot'
@@ -264,8 +265,15 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
})
const agentConfig = agent?.config as PrismaJson.AgentConfig | null | undefined
const deniedTools = agentConfig?.deniedTools || []
const allTools = [...mediaTools, readSkill, sandboxedBash, ...systemTools, ...customTools]
const readThread = createReadThreadTool()
const allTools = [
...mediaTools,
readSkill,
readThread,
sandboxedBash,
...systemTools,
...customTools,
]
const enabledTools = allTools.filter((tool) => !deniedTools.includes(tool.name))
const harness = new AgentHarness({