diff --git a/packages/connector/notion/package.json b/packages/connector/notion/package.json index 929c86b688..539d2c817c 100644 --- a/packages/connector/notion/package.json +++ b/packages/connector/notion/package.json @@ -68,6 +68,7 @@ "@deepseek-ai/dsh-system-prompt": "workspace:*", "@deepseek-ai/dsh-client-locale": "workspace:*", "@deepseek-ai/dsh-client-ui-mcp-account": "workspace:*", - "@deepseek-ai/dsh-client-ui-slots": "workspace:*" + "@deepseek-ai/dsh-client-ui-slots": "workspace:*", + "@deepseek-ai/dsh-tool-testkit": "workspace:*" } } diff --git a/packages/connector/notion/tests/plugin.spec.ts b/packages/connector/notion/tests/plugin.spec.ts index d1caef0a53..95e82c1291 100644 --- a/packages/connector/notion/tests/plugin.spec.ts +++ b/packages/connector/notion/tests/plugin.spec.ts @@ -5,6 +5,7 @@ import type { Context } from '@deepseek-ai/cordis' import type { Agent } from '@deepseek-ai/dsh-agent' import { parseCredentialKey } from '@deepseek-ai/dsh-credentials' import { ToolCallId } from '@deepseek-ai/dsh-llm' +import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit' import type { McpManagedServerStatus } from '@deepseek-ai/dsh-mcp-manager' import McpResources from '@deepseek-ai/dsh-mcp-resources' import { createScope } from '@deepseek-ai/dsh-scope' @@ -27,7 +28,7 @@ async function fixture(servers: Record = {}) { } const mount = (config: Partial = {}) => world.ctx.plugin(Notion, { url: world.origin + '/mcp', ...config }) const prompt = async () => renderPrompt(await world.ctx.systemPrompt.assemble()) - const ping = () => world.ctx.tools.execute({ + const ping = () => executeToolFixture(world.ctx, { callId: ToolCallId('notion-ping'), name: 'mcp__notion__ping', arguments: {}, signal: new AbortController().signal, }) const grant = async () => (await world.ctx.credentials.describeRecord(parseCredentialKey('mcp-client/notion'))).configured @@ -86,7 +87,7 @@ it('keeps Notion tools hidden from an agent until it loads them, unless loading await b.authorize() expect(b.ctx.tools.get('mcp__notion__ping', agent)).toBeUndefined() expect(b.ctx.tools.get('mcp__notion__load_tools', agent)).toBeDefined() - expect(await b.ctx.tools.execute({ + expect(await executeToolFixture(b.ctx, { callId: ToolCallId('notion-load'), name: 'mcp__notion__load_tools', arguments: { tools: ['ping'] }, signal: new AbortController().signal, agent, })).toMatchObject({ isError: false, value: 'Loaded: mcp__notion__ping.' }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5806deed6d..1b4a30f9cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7446,6 +7446,9 @@ importers: '@deepseek-ai/dsh-system-prompt': specifier: workspace:* version: link:../../core/system-prompt + '@deepseek-ai/dsh-tool-testkit': + specifier: workspace:* + version: link:../../test-support/tool-testkit packages/context/agent-instructions: dependencies: diff --git a/snapshots/session/notion-plugin/system-prompt.expected.md b/snapshots/session/notion-plugin/system-prompt.expected.md index 1c7367df3f..1b056dde37 100644 --- a/snapshots/session/notion-plugin/system-prompt.expected.md +++ b/snapshots/session/notion-plugin/system-prompt.expected.md @@ -27,7 +27,7 @@ create_goal may infer goal intent from a direct human request in any language. A Use the workflow tool ONLY when the user explicitly asks for a workflow or for large multi-agent orchestration: you write a JavaScript script (the tool description documents the exact format) that fans work out across many subagents with phases and structured results. For one or two delegations, prefer plain subagent calls. -Start independent delegations with `subagent` or `subagent_fork` together in one assistant message and continue useful work while they run. +Start independent delegations with `subagent` or `subagent_fork` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn. ## MCP resource servers diff --git a/snapshots/session/notion-plugin/tool-schemas.expected.json b/snapshots/session/notion-plugin/tool-schemas.expected.json index 4e5e9d557c..f47e927b07 100644 --- a/snapshots/session/notion-plugin/tool-schemas.expected.json +++ b/snapshots/session/notion-plugin/tool-schemas.expected.json @@ -107,22 +107,6 @@ ] } }, - { - "name": "exit_plan_mode", - "description": "Use only in plan mode. Present your plan for the user's review and, on approval, leave plan mode. The user may approve (carry out the plan from your next step) or keep planning — their feedback comes back in the tool result; revise and present again.", - "parameters": { - "type": "object", - "properties": { - "plan": { - "type": "string", - "description": "The complete plan, as markdown, starting with a # heading that names it." - } - }, - "required": [ - "plan" - ] - } - }, { "name": "get_goal", "description": "Read the current session goal, including the id and revision that update_goal requires.",