From b1fa8221ef8f7e3248d2a8e61262decbfc997762 Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:39:58 -0700 Subject: [PATCH] fix(mcp): fix three correctness issues from Codex review parsers.ts: the early-return guard for empty content was firing before the synthetic UIResource block, so tools returning only structuredContent (no content items) never produced an app resource. Now the guard skips the early return when a synthetic app is expected. Also, the synthetic block was not appending the \ui{resourceId} marker to the text, leaving the LLM without an ID to place; fixed by mirroring the marker lines that the non-synthetic resource handler already emits. ToolCall / MCPUIResource: "Loading interactive view..." was a hardcoded string; replaced with com_ui_loading_interactive_view from the localization layer in both components, per project convention. --- client/src/components/Chat/Messages/Content/ToolCall.tsx | 3 ++- client/src/components/MCPUIResource/MCPUIResource.tsx | 2 +- client/src/locales/en/translation.json | 1 + packages/api/src/mcp/parsers.ts | 7 ++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/components/Chat/Messages/Content/ToolCall.tsx b/client/src/components/Chat/Messages/Content/ToolCall.tsx index a713d60da2..dc95a98722 100644 --- a/client/src/components/Chat/Messages/Content/ToolCall.tsx +++ b/client/src/components/Chat/Messages/Content/ToolCall.tsx @@ -29,6 +29,7 @@ const MCPAppView = React.memo(function MCPAppView({ app: UIResource; args: string | Record; }) { + const localize = useLocalize(); const iframeRef = useRef(null); const [height, setHeight] = useState(undefined); const [loaded, setLoaded] = useState(false); @@ -82,7 +83,7 @@ const MCPAppView = React.memo(function MCPAppView({ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" /> - Loading interactive view... + {localize('com_ui_loading_interactive_view')} )}