mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-20 01:31:42 +02:00
Merge commit '34af94cd9ab277632e27caeec2d41de2fd091b31' into concedo_experimental
# Conflicts: # .github/workflows/docker.yml # .github/workflows/make-release.yml # .github/workflows/release.yml # .pi/gg/SYSTEM.md # CMakeLists.txt # build-xcframework.sh # docs/development/HOWTO-add-model.md # docs/ops.md # docs/ops/SYCL.csv # docs/speculative.md # examples/sycl/update-ops-doc.sh # ggml/CMakeLists.txt # ggml/src/ggml-sycl/cpy.cpp # ggml/src/ggml-sycl/ggml-sycl.cpp # scripts/make-release-checks.sh # scripts/sync-ggml.last # tests/test-chat-auto-parser.cpp # tests/test-chat.cpp # tests/test-jinja.cpp # tests/test-llama-archs.cpp # tests/testing.h # tools/llama-bench/llama-bench.cpp # tools/server/README.md
This commit is contained in:
@@ -2,7 +2,7 @@ import { Client } from '@modelcontextprotocol/sdk/client';
|
||||
import { CORS_PROXY } from '$lib/constants';
|
||||
import { MCPConnectionPhase, MCPTransportType } from '$lib/enums';
|
||||
import { MCPService } from '$lib/services/mcp.service';
|
||||
import type { MCPConnectionLog, MCPServerConfig } from '$lib/types';
|
||||
import type { MCPConnection, MCPConnectionLog, MCPServerConfig } from '$lib/types';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
type DiagnosticFetchFactory = (
|
||||
@@ -329,4 +329,21 @@ describe('MCPService', () => {
|
||||
)
|
||||
).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('falls back to structuredContent when content array is empty', async () => {
|
||||
const connection = {
|
||||
client: {
|
||||
callTool: vi.fn().mockResolvedValue({
|
||||
content: [],
|
||||
structuredContent: { accounts: [{ id: 1 }], total: 1 }
|
||||
})
|
||||
},
|
||||
requestTimeoutMs: 9000,
|
||||
serverName: 'test-server'
|
||||
} as unknown as MCPConnection;
|
||||
const result = await MCPService.callTool(connection, { arguments: {}, name: 'tool' });
|
||||
|
||||
expect(result.isError).toBe(false);
|
||||
expect(result.content).toBe('{"accounts":[{"id":1}],"total":1}');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { SETTINGS_CHAT_SECTIONS, SETTINGS_KEYS } from '$lib/constants';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('checkApiKeyField', () => {
|
||||
it('should have isPrivate set to true', () => {
|
||||
const fields = SETTINGS_CHAT_SECTIONS.flatMap((section) => section.fields);
|
||||
const apiKeyField = fields.find((field) => field?.key === SETTINGS_KEYS.API_KEY);
|
||||
|
||||
expect(apiKeyField).toBeDefined();
|
||||
expect(apiKeyField?.isPrivate).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user