Improve MCP safeStringify, OIDC error messages, and catalog model reference config

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2026-05-19 18:45:06 +02:00
parent ca8951ae87
commit 3f5e7ec2b4
10 changed files with 98 additions and 63 deletions
@@ -219,7 +219,7 @@ describe('McpService', () => {
text: JSON.stringify({ output: 'test' }),
},
]);
expect((result as any).structuredContent).toEqual({ output: 'test' });
expect(result).toHaveProperty('structuredContent', { output: 'test' });
const histogram = mockMetrics.createHistogram.mock.results[0]?.value;
expect(histogram.record).toHaveBeenCalledTimes(1);
@@ -37,7 +37,7 @@ import { FilterRule, McpServerConfig } from '../config';
function safeStringify(value: unknown): string {
try {
return JSON.stringify(value);
return JSON.stringify(value) ?? String(value);
} catch {
return String(value);
}
@@ -245,7 +245,7 @@ export class McpService {
content: [
{
type: 'text',
text: JSON.stringify(output),
text: safeStringify(output),
},
],
structuredContent: output,