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):