diff options
author | sharkiecodes <lanyi_stroud@brown.edu> | 2025-07-23 15:39:10 -0400 |
---|---|---|
committer | sharkiecodes <lanyi_stroud@brown.edu> | 2025-07-23 15:39:10 -0400 |
commit | 5ff1281bc54ecc424f362cfc1fb4fdd19c0761ea (patch) | |
tree | c6e833ba88c0a7ba8285054e42c7a25704d290d9 | |
parent | 7f49356b9460d46a06e7b7d67c369c4bb1d4bbe5 (diff) |
canvas tool now intentionally skips dashboard/tab documents
-rw-r--r-- | src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts index 090b9f5c9..cd4d223ec 100644 --- a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts +++ b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts @@ -238,6 +238,25 @@ export class CanvasDocsTool extends BaseTool<typeof parameterRules> { return false; } + // Skip dashboard/tab container documents - they shouldn't be exposed to canvas tool + if (doc._type_collection === 'docking') { + console.log(`[CanvasDocsTool] Skipped document from ${source}: docking collection (dashboard/tab) ${doc.title || docId}`); + return false; + } + + // Skip generic collection containers without specific types + if (doc.type === 'collection' && !doc._type_collection) { + console.log(`[CanvasDocsTool] Skipped document from ${source}: generic collection container ${doc.title || docId}`); + return false; + } + + // Skip documents with titles that indicate they are UI infrastructure (tabs, chats, dashboards) + const title = doc.title || ''; + if (title.startsWith('Untitled Tab') || title.startsWith('Untitled Chat') || title.startsWith('Dashboard ')) { + console.log(`[CanvasDocsTool] Skipped document from ${source}: UI infrastructure document "${title}"`); + return false; + } + canvasDocs.push(doc); console.log(`[CanvasDocsTool] Added document from ${source}: ${doc.title || 'Untitled'} (${doc.type || 'unknown'})`); return true; |