Feature/heartbeat#460
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reduce LLM calls by: - Skipping LLM when HEARTBEAT.md mtime+content unchanged - Doubling interval after consecutive skips (up to 4x base) - Making interval configurable via BotConfig.heartbeat_interval_s Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add heartbeat_interval_s to BotConfig load/save so it's configurable via bot config.yaml instead of hardcoded - Downgrade adaptive interval logs from info to debug - Add old->new interval values to reset/extend log messages - Add UTC timestamp to ConsoleFormatter output Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…heartbeat - Add _has_active_tasks() to locally parse HEARTBEAT.md and skip LLM when no real task content exists under ## Active Tasks - Remove content-change / mtime / staleness detection (not needed) - Persist heartbeat_interval_s to config.yaml and reload via reload_heartbeat() without restart - Downgrade adaptive interval logs to debug level Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Keep only: configurable interval via heartbeat_interval_s config, active-tasks pre-check to skip LLM when no real tasks exist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…terval_s Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cover _has_active_tasks parsing, heartbeat_interval_s config roundtrip, and reload_heartbeat hot-update. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
smoke tests failed for some tests not touched in this feature
|
… tests The tests were patching only PathService._instance but SQLiteSessionStore calls get_path_service() which delegates to get_current_path_service(). That function uses a separate _path_services cache keyed by user.scope.cache_key, creating a second distinct PathService instance that wasn't being patched. Fix by: - Patching PathService._instance to the service being modified - Clearing _path_services cache - Pre-registering the patched service at the real admin scope cache key This ensures both the singleton and the multi-user cache resolve to the same patched PathService, so get_path_service() returns the patched path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ensures PRs and pushes on feature/heartbeat trigger the full CI pipeline. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
question_notebook uses get_sqlite_session_store (imported from services.session module), while sessions uses get_session_store. The fixture was patching the wrong symbols causing AttributeError at test setup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Description
Problems Solved
Changes
HeartbeatService (deeptutor/tutorbot/heartbeat/service.py)
TutorBotManager (deeptutor/services/tutorbot/manager.py)
Related Issues
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.Additional Notes
Add any other context or screenshots about the pull request here.