|
|
@@ -6,24 +6,32 @@ import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-l
|
|
|
|
|
|
const fixtureRoot = new URL('../../../../../../packages/mcp/mcp-client/tests/fixtures/', import.meta.url)
|
|
|
const configPath = fileURLToPath(new URL('repeated-cursor.patch.yml', fixtureRoot))
|
|
|
+const headlessOverlayPath = fileURLToPath(new URL('./fixtures/headless-profile.patch.yml', import.meta.url))
|
|
|
const expectedPath = fileURLToPath(new URL('./expected/mcp-pagination/stderr-cause.txt', import.meta.url))
|
|
|
|
|
|
-it('reports a repeated MCP discovery cursor and exits before starting a turn', async () => {
|
|
|
+it('warns about a repeated MCP discovery cursor and completes the headless task', async () => {
|
|
|
const { stdout, stderr } = await runLoaderSmoke({
|
|
|
label: 'MCP discovery pagination cycle',
|
|
|
tempDirPrefix: 'dsh-mcp-pagination-',
|
|
|
binScript: fileURLToPath(new URL('../../../../src/bin.ts', import.meta.url)),
|
|
|
libBinScript: fileURLToPath(new URL('../../../../lib/bin.js', import.meta.url)),
|
|
|
configPath,
|
|
|
- binArgs: ['--profile', 'headless', '--patch', configPath, 'unreachable task'],
|
|
|
+ binArgs: [
|
|
|
+ '--profile', 'headless',
|
|
|
+ '--patch', headlessOverlayPath,
|
|
|
+ '--patch', configPath,
|
|
|
+ 'Complete the task without the failed MCP server.',
|
|
|
+ ],
|
|
|
tsconfigPath: fileURLToPath(new URL('../../../../../../tsconfig.json', import.meta.url)),
|
|
|
- expectedExitCode: 1,
|
|
|
env: {
|
|
|
DSH_MCP_PAGINATION_FIXTURE: fileURLToPath(new URL('repeated-cursor-server.ts', fixtureRoot)),
|
|
|
+ DSH_PERMISSION_MODE: 'danger-full-access',
|
|
|
DSH_TELEMETRY_DISABLED: '1',
|
|
|
},
|
|
|
})
|
|
|
- expect(stdout).toBe('')
|
|
|
+ expect(stdout).toBe('CLI tool round trip complete: CLI_TOOL_ROUND_TRIP\n')
|
|
|
+ expect(stderr).toContain('dsh: warning: 1 entry did not activate')
|
|
|
+ expect(stderr).toContain('mcp-pagination-cycle (@deepseek-ai/dsh-mcp-client)')
|
|
|
expect(stderr).toContain('initial connection or tool synchronization failed')
|
|
|
const cause = stderr.split('\n').find(line => line.startsWith('Error: mcp-client(pagination-cycle):'))
|
|
|
await expect(`${cause}\n`).toMatchFileSnapshot(expectedPath)
|