Add heartbeat integration, planning phase, and auto-repair

- Add HeartbeatConfig for proactive periodic execution with channel notifications
- Add use_planning option to Worker for ActionPlan generation before tool execution
- Implement tool failure tracking in database (V3 migration)
- Add auto-repair via Builder for broken WASM tools in self_repair.rs
- Record tool failures in Worker for self-repair tracking
- Update .env.example with new configuration options

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
Illia Polosukhin
2026-02-03 09:32:01 -08:00
co-authored by Claude Opus 4.5
parent 2df4a4f5f0
commit 235f6aae18
11 changed files with 551 additions and 127 deletions
+20
View File
@@ -0,0 +1,20 @@
-- Track tool execution failures for self-repair
-- Tools that fail repeatedly can be automatically repaired by the builder
CREATE TABLE IF NOT EXISTS tool_failures (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tool_name VARCHAR(255) NOT NULL,
error_message TEXT,
error_count INTEGER DEFAULT 1,
first_failure TIMESTAMPTZ DEFAULT NOW(),
last_failure TIMESTAMPTZ DEFAULT NOW(),
-- Store BuildResult for repair context
last_build_result JSONB,
repaired_at TIMESTAMPTZ,
repair_attempts INTEGER DEFAULT 0,
UNIQUE(tool_name)
);
CREATE INDEX idx_tool_failures_name ON tool_failures(tool_name);
CREATE INDEX idx_tool_failures_count ON tool_failures(error_count DESC);
CREATE INDEX idx_tool_failures_unrepaired ON tool_failures(tool_name) WHERE repaired_at IS NULL;