feat: atomic extract-and-connect + stale PR monitor + response audit #4

Merged
m3taversal merged 70 commits from epimetheus/atomic-connect-and-stale-monitor into main 2026-03-30 11:03:35 +00:00
Showing only changes of commit e1934b30ae - Show all commits

View file

@ -39,8 +39,8 @@ def call_llm(prompt: str, max_tokens: int = 4096) -> str | None:
"""Call OpenRouter API."""
api_key = os.environ.get("OPENROUTER_API_KEY", "")
if not api_key:
# Try reading from file
key_file = Path("/opt/teleo-eval/.openrouter-key")
# Try reading from file (same location as openrouter-extract-v2.py)
key_file = Path("/opt/teleo-eval/secrets/openrouter-key")
if key_file.exists():
api_key = key_file.read_text().strip()
if not api_key:
@ -99,7 +99,7 @@ def parse_frontmatter(path: Path) -> tuple[dict | None, str]:
return None, text
body = text[end + 4:].strip()
return fm, body
except yaml.YAMLError:
except Exception:
return None, text
@ -109,7 +109,10 @@ def find_proposal_sources() -> list[Path]:
"""Find all unprocessed proposal sources in archive."""
sources = []
for md_file in sorted(ARCHIVE_DIR.rglob("*.md")):
fm, _ = parse_frontmatter(md_file)
try:
fm, _ = parse_frontmatter(md_file)
except Exception:
continue
if not fm:
continue
if fm.get("event_type") == "proposal" and fm.get("status") in ("unprocessed", None):