fix: avoid opencode structured output session breakage
Replace server-enforced structured output with local JSON parsing for Git generation Render generated commit and PR JSON responses as compact chat cards Tighten generation prompts while preserving active session context
This commit is contained in:
@@ -6,6 +6,8 @@ import type { ContentChangeReason } from '@/hooks/useChatAutoFollow';
|
||||
import { useStreamingTextThrottle } from '../../hooks/useStreamingTextThrottle';
|
||||
import { resolveAssistantDisplayText, shouldRenderAssistantText } from './assistantTextVisibility';
|
||||
import { streamPerfCount, streamPerfObserve } from '@/stores/utils/streamDebug';
|
||||
import { GeneratedJsonResultCard } from './GeneratedJsonResultCard';
|
||||
import { parseGeneratedJsonResult } from './generatedJsonResult';
|
||||
|
||||
type PartWithText = Part & { text?: string; content?: string; value?: string; time?: { start?: number; end?: number } };
|
||||
|
||||
@@ -71,6 +73,18 @@ const AssistantTextPart: React.FC<AssistantTextPartProps> = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
const generatedResult = !isStreaming && isFinalized ? parseGeneratedJsonResult(displayTextContent) : null;
|
||||
if (generatedResult) {
|
||||
return (
|
||||
<div
|
||||
className={`group/assistant-text relative break-words ${chatRenderMode === 'live' ? 'my-1' : ''}`}
|
||||
key={part.id || `${messageId}-text`}
|
||||
>
|
||||
<GeneratedJsonResultCard result={generatedResult} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`group/assistant-text relative break-words ${chatRenderMode === 'live' ? 'my-1' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user