From e1934b30ae4d3575721322ba1e3de049c3bcb9fe Mon Sep 17 00:00:00 2001 From: m3taversal Date: Mon, 23 Mar 2026 17:59:11 +0000 Subject: [PATCH] fix: API key path + YAML error handling in decision extractor Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70> --- extract-decisions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extract-decisions.py b/extract-decisions.py index 8d32760..a2f7020 100644 --- a/extract-decisions.py +++ b/extract-decisions.py @@ -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):