Skip to content

[Code] Optimize hck_gpt/ modules #17

@HuckleR2003

Description

@HuckleR2003

Milestone: v1.7.1

Target files:

  • hck_gpt/chat_handler.py (~400 lines)
  • hck_gpt/insights.py (~300 lines)
  • hck_gpt/panel.py (~250 lines)

Changes:

  • Consolidate command routing (stats, alerts, insights share similar logic)
  • Remove duplicate greeting messages
  • Extract hardcoded responses to config/responses.json
  • Better pattern detection caching (don't recompute 7-day patterns every 30s)
  • Type hints + docstrings

Performance:

  • Current: insights ticker runs every 30s
  • Optimize: Only compute if data actually changed
  • Cache pattern results for 5min

Success:

  • 950 -> 700 lines total
  • Insights lag < 100ms (currently ~200ms)
  • Easier to add new commands
  • Polish language responses stay working

Metadata

Metadata

Assignees

Labels

Projects

Status

Ready

Relationships

None yet

Development

No branches or pull requests

Issue actions