Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions github/server/lib/mcp-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ export function buildUpstreamTools(
name: toolDef.name,
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Non-JSON tool responses still throw Failed to parse instead of falling back to raw text/null.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At github/server/lib/mcp-proxy.ts, line 189:

<comment>Non-JSON tool responses still throw `Failed to parse` instead of falling back to raw text/null.</comment>

<file context>
@@ -185,11 +186,10 @@ export function buildUpstreamTools(
           const parsed = safeJsonParse(msg);
-          if (parsed) {
-            return parsed;
+          if (!parsed) {
+            throw new Error(`Failed to parse: ${msg}`);
           }
</file context>
Fix with Cubic

arguments: context as Record<string, unknown>,
});
console.log(
`[mcp-proxy] callTool result for ${toolDef.name}:`,
JSON.stringify(result, null, 2),
);
const contents = result.content as
| Array<{ type: string; text?: string }>
| undefined;
Expand Down
Loading