Add report_issue tool and planner agent for self-improvement tracking
- New report_issue tool logs bugs/improvements to memory/improvement_requests.md - Planner agent (Sonnet via OpenRouter) for architecture and debugging tasks - Heartbeat checks for pending improvement requests to surface to Bryan Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>cora-start
parent
30757b5bcf
commit
ab2c313baa
|
|
@ -0,0 +1,64 @@
|
|||
"""Tool for logging bugs and improvement requests that need Claude Code to fix."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
from . import tool
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@tool(
|
||||
"report_issue",
|
||||
"Log a bug or improvement that needs Claude Code to fix. "
|
||||
"Creates a structured entry in memory/improvement_requests.md.",
|
||||
category="system",
|
||||
)
|
||||
def report_issue(
|
||||
title: str,
|
||||
description: str,
|
||||
affected_files: str = "",
|
||||
suggested_fix: str = "",
|
||||
ctx: dict | None = None,
|
||||
) -> str:
|
||||
"""Append a structured improvement request and index it in memory."""
|
||||
now = datetime.now(UTC)
|
||||
timestamp = now.strftime("%Y-%m-%d %H:%M UTC")
|
||||
|
||||
entry_lines = [
|
||||
f"\n## {title}",
|
||||
f"**Reported:** {timestamp} ",
|
||||
f"**Status:** pending\n",
|
||||
description,
|
||||
]
|
||||
|
||||
if affected_files:
|
||||
entry_lines.append(f"\n**Affected files:** {affected_files}")
|
||||
|
||||
if suggested_fix:
|
||||
entry_lines.append(f"\n**Suggested Claude Code prompt:**\n> {suggested_fix}")
|
||||
|
||||
entry_lines.append("\n---")
|
||||
entry = "\n".join(entry_lines)
|
||||
|
||||
# Write to the improvement requests file
|
||||
requests_path = Path("memory/improvement_requests.md")
|
||||
requests_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if requests_path.exists():
|
||||
content = requests_path.read_text(encoding="utf-8")
|
||||
else:
|
||||
content = "# Improvement Requests\n\nItems here need Claude Code (with codebase access) to fix.\n"
|
||||
|
||||
content += entry + "\n"
|
||||
requests_path.write_text(content, encoding="utf-8")
|
||||
|
||||
# Also index into semantic memory for searchability
|
||||
if ctx and ctx.get("memory"):
|
||||
ctx["memory"].log_daily(f"Reported issue: {title} — {description}")
|
||||
|
||||
log.info("Logged improvement request: %s", title)
|
||||
return f"Logged improvement request: **{title}**. Bryan will see it on the next heartbeat."
|
||||
|
|
@ -112,3 +112,9 @@ agents:
|
|||
display_name: Link Builder
|
||||
tools: [run_link_building, run_cora_backlinks, blm_ingest_cora, blm_generate_batch, scan_cora_folder, delegate_task, remember, search_memory]
|
||||
memory_scope: ""
|
||||
|
||||
- name: planner
|
||||
display_name: Planner
|
||||
model: "anthropic/claude-sonnet-4.6"
|
||||
tools: [delegate_task, remember, search_memory, report_issue, web_search]
|
||||
memory_scope: ""
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@ Things to proactively check on each heartbeat cycle:
|
|||
- Check if any scheduled tasks failed and need retry
|
||||
- Review memory for any pending reminders that are due
|
||||
- Check disk space (warn if < 10% free)
|
||||
- Check memory/improvement_requests.md for pending items and notify Bryan with a summary
|
||||
|
|
|
|||
Loading…
Reference in New Issue