fix: align DeepSeek canary tool rounds with gate
Memind CI / Test, build, and release guards (pull_request) Successful in 1m32s

This commit is contained in:
john
2026-07-26 23:49:32 +08:00
parent 046704816f
commit fb6865638a
19 changed files with 519 additions and 20 deletions
+21
View File
@@ -1,6 +1,7 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {
DEEPSEEK_COMPAT_CONTRACT_VERSION,
decodedUpstreamResponseHeaders,
deepseekDisableThinkingEnabled,
flattenLocalJsonSchemaRefs,
@@ -10,6 +11,7 @@ import {
resolveDeepseekNoThinkProxyBaseUrl,
resolveMoonshotCompatProxyBaseUrl,
sanitizeMoonshotToolSchemas,
startDeepseekNoThinkProxy,
} from './deepseek-no-think-proxy.mjs';
test('injectDeepseekThinkingDisabled adds thinking.disabled when absent', () => {
@@ -168,3 +170,22 @@ test('decodedUpstreamResponseHeaders drops stale compression metadata', () => {
'content-type': 'text/event-stream',
});
});
test('compatibility proxy health identifies the enforced production contract', async (t) => {
const server = await startDeepseekNoThinkProxy({
host: '127.0.0.1',
port: 0,
logger: { info() {}, warn() {}, error() {} },
});
t.after(() => new Promise((resolve) => server.close(resolve)));
const address = server.address();
const response = await fetch(`http://127.0.0.1:${address.port}/health`);
assert.equal(response.status, 200);
assert.deepEqual(await response.json(), {
ok: true,
contractVersion: DEEPSEEK_COMPAT_CONTRACT_VERSION,
deepseekThinking: 'disabled',
upstream: 'https://api.deepseek.com',
moonshotUpstream: 'https://api.moonshot.cn',
});
});