fix(agent): disable tools for session naming and make naming non-blocking

This commit is contained in:
yiling
2026-07-29 16:31:24 +08:00
parent b49adf8ff1
commit f1c0f4e50d
4 changed files with 36 additions and 17 deletions
+9 -1
View File
@@ -110,6 +110,7 @@ export interface CreateAgentSessionParams {
userCommentId?: string | null
customTools?: AgentTool[]
thinkingLevel?: string
disableTools?: boolean
providers: DbProviderInfo[]
}
@@ -127,6 +128,7 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
userCommentId: passedUserCommentId,
customTools = [],
thinkingLevel,
disableTools = false,
} = params
const storage = await DatabaseSessionStorage.create({
@@ -278,7 +280,9 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
...systemTools,
...customTools,
]
const enabledTools = allTools.filter((tool) => !deniedTools.includes(tool.name))
const enabledTools = disableTools
? []
: allTools.filter((tool) => !deniedTools.includes(tool.name))
const harness = new AgentHarness({
env: new NodeExecutionEnv({ cwd: process.cwd() }),
@@ -288,6 +292,10 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
systemPrompt: async () => {
let prompt = systemPrompt
if (disableTools) {
return prompt
}
// Sandbox environment restrictions
prompt +=
'\n\n' +