fix(cortex): integrate intake intents into full chat + artifact flow
Fixes 4 bugs preventing intake blocks from working: 1. Chat API validation: Add 'nudge' to message type enum, allow empty content for streaming messages 2. AI chat recognition: Add P3 intake intents (intake_status, risico_query, diagnose_query, intake_navigeer) to system prompt with triggers, entities, and JSON examples 3. Artifact rendering: Add intake block imports and switch cases to artifact-container.tsx 4. API 400 error: Convert null to undefined for optional Zod params (searchParams.get returns null, Zod .optional() expects undefined) Also adds: - Testplan for E2E testing (60+ test cases) - Session log with lessons learned and new intent checklist Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,10 @@ export async function sendChatMessage(
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({ error: response.statusText }));
|
||||
// Log validation details for debugging
|
||||
if (errorData.details) {
|
||||
console.error('Validation details:', errorData.details);
|
||||
}
|
||||
throw new Error(errorData.error || 'API request failed');
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,14 @@ export function useBlockData<T>({
|
||||
setData(result);
|
||||
} catch (err) {
|
||||
const statusCode = (err as any)?.statusCode;
|
||||
const details = (err as any)?.details;
|
||||
console.error('[useBlockData] Error:', {
|
||||
operation: operationName,
|
||||
statusCode,
|
||||
message: (err as Error)?.message,
|
||||
details,
|
||||
});
|
||||
|
||||
const errorInfo = getErrorInfo(err, {
|
||||
operation: operationName,
|
||||
statusCode,
|
||||
|
||||
Reference in New Issue
Block a user