Skip to content

Commit f61edde

Browse files
fix(workflows): encode VFS folder aliases
1 parent 4361d9d commit f61edde

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/sim/lib/copilot/tools/handlers/vfs-mutate.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ describe('vfs mv/cp', () => {
588588
input: {
589589
workspaceId: 'ws-1',
590590
path: '/Q1',
591-
destinationPath: '/Archive/Q1 2026',
591+
destinationPath: '/Archive/Q1%202026',
592592
},
593593
})
594594
)
@@ -648,14 +648,14 @@ describe('vfs mv/cp', () => {
648648
})
649649

650650
it('creates a workflow folder through the workflow application operation', async () => {
651-
const result = await executeVfsMkdir({ paths: ['workflows/Archive'] }, context)
651+
const result = await executeVfsMkdir({ paths: ['workflows/Project Plans'] }, context)
652652

653653
expect(mocks.createWorkflowFolder).toHaveBeenCalledWith(
654-
expect.objectContaining({ input: { workspaceId: 'ws-1', path: '/Archive' } })
654+
expect.objectContaining({ input: { workspaceId: 'ws-1', path: '/Project%20Plans' } })
655655
)
656656
expect(result.success).toBe(true)
657657
expect(result.output).toMatchObject({
658-
results: [{ to: 'workflows/Archive', kind: 'workflow_folder', id: 'fold-new' }],
658+
results: [{ to: 'workflows/Project%20Plans', kind: 'workflow_folder', id: 'fold-new' }],
659659
})
660660
})
661661

apps/sim/lib/copilot/tools/handlers/vfs-mutate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
import { asOrchestrationError } from '@/lib/core/orchestration/types'
3131
import { PlatformEvents } from '@/lib/core/telemetry'
3232
import { generateRequestId } from '@/lib/core/utils/request'
33+
import { buildFolderPath } from '@/lib/folders/paths'
3334
import {
3435
deleteKnowledgeBaseOperation,
3536
listKnowledgeBases,
@@ -630,7 +631,7 @@ function makeWorkflowFolderEnsurer(
630631
parentId = existing
631632
continue
632633
}
633-
const path = `/${segments.slice(0, position + 1).join('/')}`
634+
const path = buildFolderPath(segments.slice(0, position + 1))
634635
const created = await executeCopilotWorkflowUseCase(context, createWorkflowFolder, {
635636
workspaceId,
636637
path,
@@ -800,7 +801,7 @@ async function mutateWorkflows(
800801
await executeCopilotWorkflowUseCase(context, relocateWorkflowFolder, {
801802
workspaceId,
802803
path: sourcePath,
803-
destinationPath: `/${[...dest.folderSegments, finalLeaf].join('/')}`,
804+
destinationPath: buildFolderPath([...dest.folderSegments, finalLeaf]),
804805
})
805806
outcomes.push({
806807
from: ref.source,

0 commit comments

Comments
 (0)