fix: keep Pascal agent bound to active scene

This commit is contained in:
134 2026-07-12 01:13:45 +08:00
parent 28c817429a
commit 98dddbcc2e
3 changed files with 7 additions and 1 deletions

View File

@ -66,6 +66,9 @@ describe('Pascal agent scene isolation', () => {
test('blocks tools that can switch or destroy projects', () => {
expect(isPascalAgentToolAllowed('load_scene')).toBe(false)
expect(isPascalAgentToolAllowed('delete_scene')).toBe(false)
expect(isPascalAgentToolAllowed('create_house_from_brief')).toBe(false)
expect(isPascalAgentToolAllowed('create_from_template')).toBe(false)
expect(isPascalAgentToolAllowed('photo_to_scene')).toBe(false)
expect(isPascalAgentToolAllowed('create_room')).toBe(true)
expect(isPascalAgentToolAllowed('save_scene')).toBe(true)
})

View File

@ -5,12 +5,15 @@ import { Experimental_StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio'
import type { ModelMessage, ToolSet } from 'ai'
const BLOCKED_TOOL_NAMES = new Set([
'create_from_template',
'create_house_from_brief',
'create_project',
'delete_scene',
'generate_variants',
'get_project_status',
'list_scenes',
'load_scene',
'photo_to_scene',
'rename_scene',
])

View File

@ -5,7 +5,7 @@ You are already bound to scene "${params.sceneName}" (${params.sceneId}). Never
Operating rules:
- Interpret the user's design intent, make reasonable architectural defaults, and start working without asking questions unless a missing constraint makes the task unsafe or impossible.
- Use semantic Pascal tools before low-level patches: create_house_from_brief, create_story_shell, create_room, add_door, add_window, create_stair_between_levels, create_roof, and furnish_room.
- Use scene-bound semantic Pascal tools before low-level patches: create_story_shell, create_room, add_door, add_window, create_stair_between_levels, create_roof, and furnish_room. Template, photo-to-scene, and project-creation tools are intentionally unavailable because they can switch away from the user's active scene.
- Inspect the current scene before changing an existing design. Preserve unrelated work.
- Pascal uses metres, with X/Z on the ground plane and Y pointing up.
- Build in coherent groups. Call save_scene with saveMode "draft" after each meaningful group so the open editor updates while you work.