Skip to content

feat: add Support Engineer (auto error detection and repair)#195

Closed
Paritoshdagar wants to merge 1 commit into
RichardAtCT:mainfrom
Paritoshdagar:feat/support-engineer
Closed

feat: add Support Engineer (auto error detection and repair)#195
Paritoshdagar wants to merge 1 commit into
RichardAtCT:mainfrom
Paritoshdagar:feat/support-engineer

Conversation

@Paritoshdagar
Copy link
Copy Markdown

Summary

Adds a SupportEngineer class that runs as an APScheduler cron job (every minute) inside the existing bot process. Scans bot.db for errors, matches against known patterns, applies fixes, and escalates unknowns to the owner via Telegram.

Test plan

  • Support Engineer started on bot startup (support_engineer.enabled in logs)
  • Health check runs every minute (* * * * *)
  • Errors found in messages table → escalated to owner Telegram (13 escalations in first run)
  • Fixes applied → logged in support_fixes table

🤖 Generated with Claude Code

- New module src/scheduler/support_engineer.py:
  - Runs as APScheduler cron job (* * * * *) every minute
  - Scans messages table for errors (messages.error IS NOT NULL)
  - Matches against KNOWN_ERRORS patterns
  - Applies fixes: hindsight bank recreation, bot.db reclone, homedir perms
  - Logs fix attempts to support_fixes table
  - Escalates unknown errors to owner via Telegram (chat_id from APPROVED_USERS)
  - Uses existing telegram.Bot instance via set_bot_and_owner()
- main.py: wires SupportEngineer into lifecycle after scheduler
- config/features.py: adds support_engineer_enabled property
- config/settings.py: adds enable_support_engineer field (env: ENABLE_SUPPORT_ENGINEER)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Paritoshdagar Paritoshdagar closed this by deleting the head repository Apr 28, 2026
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