Skip to content

fix: resolve query_habits crash and make AI proactive - #132

Merged
thomasluizon merged 2 commits into
mainfrom
fix/chat-query-habits-crash
Apr 5, 2026
Merged

fix: resolve query_habits crash and make AI proactive#132
thomasluizon merged 2 commits into
mainfrom
fix/chat-query-habits-crash

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • QueryHabits crash fix: string.Contains(value, StringComparison.OrdinalIgnoreCase) cannot be translated to SQL by EF Core/Npgsql, causing every query_habits tool call to throw InvalidOperationException. Replaced with .ToLower().Contains() which translates to LOWER() in PostgreSQL.
  • AI proactivity fix: Updated prompt rule Stop AI from judging user habit content #4 so the AI immediately calls query_habits to check for duplicates instead of asking the user for permission to check first.

Test plan

  • All 29 QueryHabits unit tests pass
  • Verify chat AI can successfully search habits by name
  • Verify chat AI proactively checks for existing habits when user asks to create one

🤖 Generated with Claude Code

thomasluizon and others added 2 commits April 5, 2026 16:05
StringComparison.OrdinalIgnoreCase in LINQ cannot be translated to SQL
by EF Core/Npgsql, causing query_habits to throw on every call.
Replaced with ToLower().Contains() which translates to LOWER() in SQL.

Also updated AI prompt rule #4 so the AI immediately searches for
existing habits instead of asking the user for permission to check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit 79043ca into main Apr 5, 2026
2 of 3 checks passed
@thomasluizon
thomasluizon deleted the fix/chat-query-habits-crash branch April 5, 2026 19:08
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.

1 participant