test(e2e): align keyless expectations with the shipped config and scope keys

The acp escalation smoke advertises the shipped deepseek-v4-pro; the
workspace-context e2e asserts the per-candidate scope key. The PTY harness
drops COLORTERM (deterministic banner) and gains configArgs/prepare/inspect
for the dsh CLI scenarios.
This commit is contained in:
Turtle
2026-07-22 14:48:34 +08:00
parent a58229187f
commit f1f35ccaef
4 changed files with 30 additions and 23 deletions

View File

@@ -12,6 +12,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent'
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
import * as WorkspaceContext from '@deepseek-ai/dsh-workspace-context'
import { candidateScopeKey } from '../src/render.ts'
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
import * as ToolFs from '@deepseek-ai/dsh-tool-fs'
import type { SessionEvent } from '@deepseek-ai/dsh-session'
@@ -112,7 +113,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('workspace context e2e: real mode
&& !Array.isArray(event.data.meta)
&& event.data.meta.kind === 'workspace-instructions')
expect(update?.type === 'context/message' && update.data.meta).toMatchObject({
changes: [{ action: 'replace', scope: '.', path: 'AGENTS.md' }],
changes: [{ action: 'replace', scope: candidateScopeKey('.', 'AGENTS.md'), path: 'AGENTS.md' }],
})
const updateText = update?.type === 'context/message'
? update.data.content.filter(block => block.type === 'text').map(block => block.text).join('')

View File

@@ -1,5 +1,5 @@
import { chmod, mkdtemp, mkdir, rm, stat, symlink, utimes, writeFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { dirname, join, resolve } from 'node:path'
import { tmpdir } from 'node:os'
import { describe, expect, it, vi } from 'vitest'
import { Context } from 'cordis'
@@ -383,20 +383,6 @@ describe('workspace context instruction discovery', () => {
}
})
it('loads through a FileSystem provider without a cancellation signal', async () => {
// Direct-library callers may omit `signal`; the fs-backed probe must pass
// no options object rather than `{ signal: undefined }`.
const ctx = new Context()
await ctx.plugin(RecordingFileSystem)
const fs = ctx.fs as RecordingFileSystem
fs.entries.set('/repo/.git', { type: 'directory' })
fs.entries.set('/repo/AGENTS.md', { type: 'file', content: 'signalless rule' })
const rendered = await loadBaselineInstructions({ cwd: '/repo', maxBytes: 65536 }, fs)
expect(rendered?.text).toContain('signalless rule')
expect(fs.signals).toHaveLength(0)
await ctx.fiber.dispose()
})
it('skips a file that becomes unreadable after discovery without failing the request', async () => {
const root = await tempRepo()
const home = await tempRepo()