Skip to content

Commit 7eac22e

Browse files
cezudasCopilot
andauthored
Include user_facing_reasoning when repairing malformed JSON string by generateObject AI-SDK call (#1544)
Fixes OPS-2950. --------- Co-authored-by: Copilot <[email protected]>
1 parent 3e2180b commit 7eac22e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/server/api/src/app/ai/mcp/llm-query-router.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ const repairText = (text: string): string | null => {
211211
query_classification:
212212
findFirstKeyInObject(parsedText, 'query_classification') || [],
213213
reasoning: findFirstKeyInObject(parsedText, 'reasoning') || '',
214+
user_facing_reasoning:
215+
findFirstKeyInObject(parsedText, 'user_facing_reasoning') || '',
214216
});
215217
} catch (error) {
216218
return null;

packages/ui-components/src/components/assistant-ui/thread/reasoning-part.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ type ReasoningPartProps = {
77
};
88

99
export const ReasoningPart: FC<ReasoningPartProps> = ({ text }) => {
10+
if (!text) {
11+
return null;
12+
}
13+
1014
return (
1115
<div className="my-2">
1216
<ExpandableContent

0 commit comments

Comments
 (0)