Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 2a1d3da

Browse files
Merge pull request #55 from runbasehq/dev
Release/0.4.1
2 parents 57c8eee + 0f86d94 commit 2a1d3da

File tree

8 files changed

+22
-80
lines changed

8 files changed

+22
-80
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
⚠️ It's not usable yet, but docs and a stable release are coming in the next few weeks. Stay tuned.
33

44
<p align="center">
5-
<a href="https://x.com/fveiras_">
5+
<a href="https://www.npmjs.com/package/mcp-check">
66
<img width="1033" height="204" alt="ascii-art-image (1)" src="https://github.com/user-attachments/assets/e77a1383-c0af-4c04-92f6-ed4b941043a3" />
77
</a>
88
</p>

packages/mcp-check/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# mcp-testing-library
22

3+
## 0.4.1
4+
5+
### Patch Changes
6+
7+
- fix chunk duplication
8+
39
## 0.4.0
410

511
### Minor Changes

packages/mcp-check/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mcp-check",
33
"module": "dist/src/index.js",
4-
"version": "0.4.0",
4+
"version": "0.4.1",
55
"type": "module",
66
"main": "dist/src/index.js",
77
"types": "dist/src/index.d.ts",

packages/mcp-check/src/agents/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AgentsClient<T extends ModelName = ModelName> {
3131
constructor(mcpServer: McpServer, models: T[], config: ProviderConfig = {}) {
3232
this.models = models;
3333
this.mcpServer = mcpServer;
34-
this.config = config;
34+
this.config = { silent: true, ...config };
3535
}
3636

3737
/**

packages/mcp-check/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export class AgentsClient<T extends ModelName = ModelName> {
295295
this.models = models;
296296
this.mcpServer = mcpServer;
297297
this._scorers = scorers || [];
298-
this.config = config;
298+
this.config = { silent: true, ...config };
299299
}
300300

301301
prompt(text: string): Promise<AgentsResult<T>> {

packages/mcp-check/src/providers/anthropic.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -368,33 +368,7 @@ export class AnthropicProvider extends Provider {
368368
protected async processNormalizedChunk(
369369
normalizedChunk: NormalizedChunk,
370370
): Promise<void> {
371-
// Handle Anthropic-specific chunk types
372-
if (normalizedChunk.originalChunk?.type === "content_block_delta") {
373-
const handlers = this.getChunkHandlers();
374-
if (handlers.anthropic?.onContentBlockDelta) {
375-
await handlers.anthropic.onContentBlockDelta(
376-
normalizedChunk.originalChunk,
377-
);
378-
}
379-
}
380-
381-
if (normalizedChunk.originalChunk?.type === "content_block_start") {
382-
const handlers = this.getChunkHandlers();
383-
if (handlers.anthropic?.onContentBlockStart) {
384-
await handlers.anthropic.onContentBlockStart(
385-
normalizedChunk.originalChunk,
386-
);
387-
}
388-
}
389-
390-
if (normalizedChunk.originalChunk?.type === "content_block_stop") {
391-
const handlers = this.getChunkHandlers();
392-
if (handlers.anthropic?.onContentBlockStop) {
393-
await handlers.anthropic.onContentBlockStop(
394-
normalizedChunk.originalChunk,
395-
);
396-
}
397-
}
371+
// Provider-specific handlers are invoked centrally by the normalizer
398372

399373
// Handle text delta accumulation
400374
if (normalizedChunk.type === "text_delta") {

packages/mcp-check/src/providers/openai.ts

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,10 @@ export class OpenAIProvider extends Provider {
277277
protected async processNormalizedChunk(
278278
normalizedChunk: NormalizedChunk,
279279
): Promise<void> {
280-
await super.processNormalizedChunk(normalizedChunk);
281-
282-
// Backward compatibility
280+
// Backward compatibility: keep logs but avoid duplicating state updates
283281
if (normalizedChunk.type === "tool_call_start") {
284282
const toolName = normalizedChunk.data.toolName;
285283
if (toolName) {
286-
this.usedTools.push(toolName);
287-
288284
if (!this.config.silent) {
289285
process.stdout.write(
290286
JSON.stringify({
@@ -294,55 +290,21 @@ export class OpenAIProvider extends Provider {
294290
}) + "\n"
295291
);
296292
}
297-
298-
if (!this.toolCalls[toolName]) {
299-
this.toolCalls[toolName] = [];
300-
}
301-
302-
this.toolCalls[toolName].push({
303-
args: normalizedChunk.data.toolArgs || {},
304-
result: null,
305-
});
306293
}
307294
} else if (normalizedChunk.type === "tool_call_done") {
308295
const toolName = normalizedChunk.data.toolName;
309-
if (
310-
toolName &&
311-
this.toolCalls[toolName] &&
312-
this.toolCalls[toolName].length > 0
313-
) {
314-
const lastCall =
315-
this.toolCalls[toolName][this.toolCalls[toolName].length - 1];
316-
if (lastCall) {
317-
lastCall.result = { id: `result_${Date.now()}`, status: "completed" };
318-
319-
if (!this.config.silent) {
320-
process.stdout.write(
321-
JSON.stringify({
322-
type: "model_stream",
323-
model: this.currentModel,
324-
text: `Tool ${toolName} completed\n`,
325-
}) + "\n"
326-
);
327-
}
328-
}
296+
if (!this.config.silent && toolName) {
297+
process.stdout.write(
298+
JSON.stringify({
299+
type: "model_stream",
300+
model: this.currentModel,
301+
text: `Tool ${toolName} completed\n`,
302+
}) + "\n"
303+
);
329304
}
330305
}
331306

332-
// Handle OpenAI-specific chunk types
333-
if (normalizedChunk.originalChunk?.type === "response.output_item.added") {
334-
const handlers = this.getChunkHandlers();
335-
if (handlers.openai?.onResponseOutputItemAdded) {
336-
await handlers.openai.onResponseOutputItemAdded(normalizedChunk.originalChunk);
337-
}
338-
}
339-
340-
if (normalizedChunk.originalChunk?.type === "response.output_item.done") {
341-
const handlers = this.getChunkHandlers();
342-
if (handlers.openai?.onResponseOutputItemDone) {
343-
await handlers.openai.onResponseOutputItemDone(normalizedChunk.originalChunk);
344-
}
345-
}
307+
// Provider-specific handlers are invoked centrally by the normalizer
346308

347309
// Handle text delta accumulation
348310
if (normalizedChunk.type === "text_delta") {

packages/mcp-check/src/providers/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export abstract class Provider {
4848
constructor(mcpServer: McpServer, promptText: string, config: ProviderConfig = {}) {
4949
this.mcpServer = mcpServer;
5050
this.promptText = promptText;
51-
this.config = config;
51+
this.config = { silent: true, ...config };
5252
}
5353

5454
/**

0 commit comments

Comments
 (0)