Skip to content

feat(phomy): refactor intent handlers and improve json parsing#32

Merged
joeVenner merged 5 commits intomainfrom
feat/phomy-improvements
Mar 1, 2026
Merged

feat(phomy): refactor intent handlers and improve json parsing#32
joeVenner merged 5 commits intomainfrom
feat/phomy-improvements

Conversation

@joeVenner
Copy link
Contributor

No description provided.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Greptile Summary

Refactored Phomy intent handling for better code maintainability by extracting six intent handlers (handle_recency_intent, handle_time_window_intent, handle_recall_last_intent, handle_global_summary_intent, handle_action_items_intent, handle_specific_query_intent) from a single large function into separate, focused functions. Improved JSON parsing robustness by adding fallback logic to extract JSON objects from LLM responses that may contain surrounding text. Fixed test assertion in specs to correctly expect "large" model recommendation for 8-core/16GB systems.

Key improvements:

  • Better separation of concerns with dedicated handler functions
  • More maintainable and testable code structure
  • Robust JSON parsing with fallback extraction
  • Added unit tests for PhomyIntent parsing
  • Corrected model recommendation test expectations

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Clean refactoring that improves code organization without changing logic, adds defensive JSON parsing, includes unit tests, and fixes a test assertion to match correct behavior
  • No files require special attention

Important Files Changed

Filename Overview
src-tauri/src/commands.rs Refactored phomy_ask intent routing into separate handler functions for better code organization
src-tauri/src/llm/mod.rs Improved JSON parsing with fallback extraction logic and added unit tests
src-tauri/src/specs/mod.rs Fixed test assertion to expect "large" model for 8-core/16GB system

Last reviewed commit: bcc0c71

@joeVenner joeVenner merged commit 17f8f42 into main Mar 1, 2026
5 of 6 checks passed
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