Skip to content

Commit bbb7ca7

Browse files
j15zclaude
andcommitted
test(copilot): cover directory-scoped docs grep at the handler level
The vfs handler test still pinned the retired single-page restriction; directory grep now succeeds with a parallel page fan-out, and an invalid path (neither page nor directory) is the remaining rejection. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5c7fc0f commit bbb7ca7

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ describe('vfs handlers docs corpus routing', () => {
611611
expect(fetchMock).not.toHaveBeenCalled()
612612
})
613613

614-
it('greps exactly one docs page and rejects multi-page scopes verbatim', async () => {
614+
it('greps one docs page or a docs directory without touching the workspace VFS', async () => {
615615
fetchMock.mockResolvedValue({
616616
ok: true,
617617
status: 200,
@@ -621,9 +621,16 @@ describe('vfs handlers docs corpus routing', () => {
621621
const single = await executeVfsGrep({ pattern: 'cron', path: DOCS_PAGE }, GREP_CTX)
622622
expect(single.success).toBe(true)
623623

624-
const multi = await executeVfsGrep({ pattern: 'cron', path: 'docs/workflows' }, GREP_CTX)
625-
expect(multi.success).toBe(false)
626-
expect(multi.error).toContain('single page')
624+
const multi = await executeVfsGrep(
625+
{ pattern: 'cron', path: 'docs/workflows', maxResults: 10_000 },
626+
GREP_CTX
627+
)
628+
expect(multi.success).toBe(true)
629+
expect(fetchMock.mock.calls.length).toBeGreaterThan(1)
630+
631+
const invalid = await executeVfsGrep({ pattern: 'cron', path: 'docs/not-a-page.mdx' }, GREP_CTX)
632+
expect(invalid.success).toBe(false)
633+
expect(invalid.error).toContain('not a docs page or directory')
627634
expect(getOrMaterializeVFS).not.toHaveBeenCalled()
628635
})
629636

0 commit comments

Comments
 (0)