Skip to content

Fix frontend data extraction from console logs#1

Open
JordanJamesJA wants to merge 2 commits intomainfrom
claude/fix-frontend-extraction-NiIAO
Open

Fix frontend data extraction from console logs#1
JordanJamesJA wants to merge 2 commits intomainfrom
claude/fix-frontend-extraction-NiIAO

Conversation

@JordanJamesJA
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits January 8, 2026 06:03
Problem:
- AI was returning facts as a single object instead of an array
- Frontend expected arrays but received empty data
- Transformation failed silently

Solution:
- Add robust validation to ensure facts is always an array
- Convert single fact objects to arrays automatically
- Filter out null/invalid facts
- Improve AI prompt to explicitly require array format
- Add detailed warning logs for debugging

Fixes the issue where console shows all safe arrays with 0 items.
Problem:
- AI returning invalid type values like "sushi", "hiking" instead of valid types
- Nonsensical values like "/here" being processed
- Frontend still receiving raw AI response (backend not restarted)

Solution:
- Add validation to filter out nonsensical values ("/here", too short)
- Normalize invalid types to "note" automatically
- Improve AI prompt with explicit examples of correct/incorrect outputs
- Add detailed logging to transformation function for debugging

Changes:
- Enhanced fact filtering to remove invalid values
- Map invalid types to valid ones with warning logs
- Clearer AI prompt emphasizing the 4 valid types only
- Added transform function entry logging
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 9, 2026

Deploy Preview for contextassistant canceled.

Name Link
🔨 Latest commit 3b45195
🔍 Latest deploy log https://app.netlify.com/projects/contextassistant/deploys/69605a86cf88bd0007aec03f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants