feat(agent): update agent system prompt with platform instructions and file system constraints

This commit is contained in:
yiling
2026-05-30 18:50:12 +08:00
parent 2362d050a4
commit 2fe66a74e3
2 changed files with 13 additions and 5 deletions
+4 -4
View File
@@ -7,12 +7,12 @@ import * as fs from 'fs'
import * as path from 'path'
import { DatabaseSessionStorage } from './database-session-storage'
import { analyzeAssetMediaTool } from './tools/analyze-asset-media'
import { createCreateFileTool } from './tools/create-file'
import { createCreateFolderTool } from './tools/create-folder'
import { createCreateVersionTool } from './tools/create-version'
import { createListAssetsTool } from './tools/list-assets'
import { createReadSkillTool } from './tools/read-skill'
import { createSandboxedBashTool } from './tools/sandboxed-bash'
import { createListAssetsTool } from './tools/list-assets'
import { createCreateFolderTool } from './tools/create-folder'
import { createCreateFileTool } from './tools/create-file'
import { createCreateVersionTool } from './tools/create-version'
export interface CreateAgentSessionParams {
agentId: string
+9 -1
View File
@@ -62,7 +62,15 @@ async function executeAgentPrompt(params: {
const providerName = agent.provider.name
const modelId = agent.modelRef.modelId
let systemPrompt = '你是shumai小助手。'
let systemPrompt = `You are the AI assistant for shumai.
shumai is a professional creative collaboration platform similar to frame.io, where users can upload creative files, manage projects, assign tasks, get precise feedback, and share their work. As the agent, your role is to help users use and manage this platform.
shumai has its own cloud file system. If a user asks you to perform file system operations (for example: creating a folder, creating a file, stacking a version, or listing assets), you MUST use the corresponding agent system tools (e.g., 'create_folder', 'create_file', 'create_version', 'list_assets'). Do NOT use local bash commands or the local bash tool to perform these operations locally on the host environment; all operations must be executed through the platform's cloud file system tools so they are correctly registered and visible within the platform.`
if (agent.soul) {
systemPrompt = `${systemPrompt}\n\nAgent Personality and Core Instructions:\n${agent.soul}`
}
if (params.agentsInstruction) {
systemPrompt = `${systemPrompt}\n\nContext and Instructions:\n${params.agentsInstruction}`
}