Merged
Conversation
Add prompt-driven heartbeat checks that can be created and managed via conversation or REST API, running alongside permanent built-in checks. New files: - nous/heartbeat/dynamic.py: DynamicCheck (BaseCheck subclass with LLM prompt execution, cron scheduling, tool allowlist) + DynamicCheckLoader (DB sync, CRUD, run stats tracking) - sql/migrations/027_dynamic_checks.sql: nous_system.dynamic_checks table - tests/test_heartbeat_dynamic.py: 51 tests covering all components Modified files: - nous/api/runner.py: Add tool_filter param to run_turn() and _tool_loop() for restricting available tools per-turn (sensor-only enforcement) - nous/api/tools.py: Register heartbeat_check_create and heartbeat_check_manage tools - nous/api/rest.py: 5 REST endpoints at /heartbeat/checks/dynamic/* - nous/heartbeat/runner.py: DynamicCheckLoader integration with periodic sync, token budget tracking, and DB run stats - nous/main.py: Wire DynamicCheckLoader into heartbeat startup - nous/storage/models.py: DynamicCheckModel ORM class - nous/config.py: heartbeat_max_dynamic_checks, heartbeat_dynamic_sync_ticks - nous/heartbeat/schemas.py: tokens_used field on CheckResult - nous/heartbeat/__init__.py: Export new classes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- CLAUDE.md: Add F034.5 to shipped table, 2 env vars, 5 REST endpoints, 2 agent tools, dynamic.py in project structure, update table count to 28 - INDEX.md: Add F034.5 to Proactive Autonomy section and Implementation Specs table, update stats (28 tables, 23 tools, 62 endpoints) - F034.5 spec: Update status from PROPOSED to SHIPPED Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_filterparam onAgentRunner.run_turn()restricts dynamic checks to sensor-only tools (web_search, web_fetch, recall_deep, recall_recent, bash, read_file)New Components
DynamicCheckDynamicCheckLoaderDynamicCheckModelnous_system.dynamic_checksdynamic_checkstable with UUID PK, agent_id scoping, composite unique constraintTools
heartbeat_check_create— create dynamic checks from conversationheartbeat_check_manage— list/enable/disable/delete/update checksREST Endpoints
GET /heartbeat/checks/dynamic— list allPOST /heartbeat/checks/dynamic— createPATCH /heartbeat/checks/dynamic/{name}— updateDELETE /heartbeat/checks/dynamic/{name}— deletePOST /heartbeat/checks/dynamic/{name}/trigger— force-runArchitecture Review
3-agent review team found 5 P1s in the spec (phantom file paths, missing tool_filter API, broken croniter usage, _id_to_name bug, missing token tracking). All resolved before implementation.
Implementation Review
2-agent review found 0 P1, 7 P2 (all fixed): runtime state preservation on re-sync, type validation on updates, empty name/prompt rejection, interval validation on cron removal, trigger_check DB stat tracking, empty summary filtering.
Test plan
test_heartbeat_dynamic.pycovering init, scheduling, execution, parsing, loader sync, CRUD, run stats, runner integration, tool filtering🤖 Generated with Claude Code