Files
deepseek-harness/packages/client/ui-question/tests/node-plugin.spec.ts
T

32 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Context } from '@deepseek-ai/cordis'
2026-07-22 23:39:50 +08:00
import { afterEach, describe, expect, it } from 'vitest'
import ToolRegistry from '@deepseek-ai/dsh-tools'
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
import UserInteractionService from '@deepseek-ai/dsh-user-interaction'
import { apply } from '../src/index.ts'
2026-07-22 23:39:50 +08:00
let ctx: Context | undefined
afterEach(async () => {
await ctx?.fiber.dispose()
ctx = undefined
})
describe('ui-question node plugin', () => {
it('mounts no model-facing tool', async () => {
2026-07-22 23:39:50 +08:00
ctx = new Context()
await ctx.plugin(SystemPrompt)
await ctx.plugin(ToolRegistry)
await ctx.plugin(UserInteractionService)
await ctx.plugin({ apply }).await()
// Selecting the Web question FEATURE must not hand every agent the tool.
// `ctx.tools.register` on an unscoped host context files into the global
// layer, which merges into every agent's view regardless of the preset
// that composed it — so a two-tool benchmark preset would really present
// three. The `tool-ask-user` row belongs to the presets that want it.
2026-07-22 23:39:50 +08:00
expect(ctx.tools.get('ask_user_question')).toBeUndefined()
})
})