mirror of
https://ghproxy.cflmy.top/https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-30 09:09:35 +08:00
Review asked for one startup-wait setting instead of an MCP-specific parameter that each similar need would repeat. The `initialize` parameter `mcpStartupTimeoutMs` and its TypeScript and Python client options are removed, so the protocol and both clients match master again. `sdk-jsonrpc-server` gains `startupWaitMs` (0 by default, at most the timer maximum). After route validation, `initialize` waits at most that long for startup work that finishes after Loader settlement, currently MCP manager servers in their first connection attempt, then answers and logs what is still pending. The `sdk` profile sets it to 5000, below the TypeScript and Python handshake timeouts.
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import Loader from '@deepseek-ai/cordis-plugin-loader'
|
|
import * as jsonrpc from '../src/index.ts'
|
|
|
|
/**
|
|
* Run the real namespace export through `Loader.unwrapExports`; a stray
|
|
* default would discard `name`, `inject`, `Config`, and `apply`.
|
|
*/
|
|
describe('dsh-sdk-jsonrpc-server plugin export shape', () => {
|
|
it('has the namespace-plugin export shape (no stray default) so the Loader keeps name/inject/Config/apply', () => {
|
|
expect('default' in jsonrpc).toBe(false)
|
|
expect(typeof jsonrpc.apply).toBe('function')
|
|
|
|
const loader = Object.create(Loader.prototype) as Loader
|
|
const unwrapped = loader.unwrapExports(jsonrpc) as Record<string, unknown>
|
|
expect(unwrapped).toBe(jsonrpc)
|
|
expect(unwrapped.name).toBe('sdk-jsonrpc-server')
|
|
expect(unwrapped.inject).toEqual(['agents', 'workingDirectory'])
|
|
expect(unwrapped.Config).toBeDefined()
|
|
expect(typeof unwrapped.apply).toBe('function')
|
|
})
|
|
|
|
it('defaults startupWaitMs to no wait and rejects values outside the timer range', () => {
|
|
expect(jsonrpc.Config({})).toMatchObject({ startupWaitMs: 0 })
|
|
expect(jsonrpc.Config({ startupWaitMs: 5000 })).toMatchObject({ startupWaitMs: 5000 })
|
|
for (const startupWaitMs of [-1, 1.5, 2_147_483_648]) {
|
|
expect(() => jsonrpc.Config({ startupWaitMs })).toThrow()
|
|
}
|
|
})
|
|
})
|