Files
optimclaw/migrations/V3__tool_failures.sql
Illia PolosukhinandClaude Opus 4.5 235f6aae18 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]>
2026-02-03 09:32:01 -08:00

21 lines
806 B
SQL

-- 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;