feat(page-data): add validation suggestions, repair path, and thinking fixes
Memind CI / Test, build, and release guards (push) Failing after 3m18s

Map Page Data failure codes to Chinese remediation hints, trigger one-shot
goosed repair for remediable cases, and recover poisoned thinking sessions.
Route local DeepSeek through the no-think proxy via host.docker.internal so
tool rounds no longer hit reasoning_content 400; document gate and case-study
scenarios for event registration repair.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-25 23:01:55 +08:00
parent 6b6f9ed01c
commit 8ccf2db05c
28 changed files with 1652 additions and 154 deletions
+53 -1
View File
@@ -212,6 +212,52 @@ test('create custom relay profile registers goosed custom provider', async () =>
assert.equal(rows[0].provider_kind, 'custom');
});
test('deleteKey treats a missing TKMind custom provider as already deleted', async () => {
const row = {
id: 'key-relay',
provider_id: CUSTOM_PROVIDER_ID,
provider_kind: 'custom',
goosed_provider_id: 'custom_relay_buyer_ollama',
name: 'Relay Buyer Ollama',
status: 'active',
is_selected: 0,
};
let deleted = false;
const pool = {
async query(sql, params = []) {
if (sql.includes('SELECT * FROM h5_llm_provider_keys WHERE id = ?')) {
return [[params[0] === row.id ? row : null].filter(Boolean)];
}
if (sql.includes('DELETE FROM h5_llm_provider_keys WHERE id = ?')) {
deleted = params[0] === row.id;
return [[]];
}
throw new Error(`Unexpected SQL: ${sql}`);
},
};
const mockFetch = async (_url, init = {}) => {
assert.equal(init.method, 'DELETE');
return {
ok: false,
status: 500,
text: async () => JSON.stringify({
message: 'Provider not found: custom_relay_buyer_ollama',
}),
};
};
const service = createLlmProviderService(pool, {
apiTarget: 'https://127.0.0.1:18006',
apiSecret: 'secret',
encryptionKey: 'unit-test-secret',
apiFetchImpl: mockFetch,
});
const result = await service.deleteKey(row.id);
assert.equal(result.ok, true);
assert.equal(deleted, true);
});
test('selectKey rejects disabled profile', async () => {
const row = {
id: 'key-1',
@@ -774,7 +820,13 @@ test('syncProfileToGoosed routes local DeepSeek through the no-thinking proxy',
init.method === 'PUT'
&& href.includes(`/config/custom-providers/${MEMIND_DEEPSEEK_NO_THINK_PROVIDER_ID}`)
) {
return { ok: false, status: 404, text: async () => '' };
return {
ok: false,
status: 500,
text: async () => JSON.stringify({
message: `Provider not found: ${MEMIND_DEEPSEEK_NO_THINK_PROVIDER_ID}`,
}),
};
}
if (init.method === 'POST' && href.endsWith('/config/custom-providers')) {
return {