1
0

Compare commits

...

1 Commits

Author SHA1 Message Date
kimi
b6948f0454 feat: make perception_cache confidence threshold configurable
Move hardcoded 0.85 threshold from perception_cache.py to config.py
as perception_confidence_threshold setting with default 0.85.

Fixes #1259
2026-03-23 21:34:41 -04:00
2 changed files with 7 additions and 1 deletions

View File

@@ -455,6 +455,10 @@ class Settings(BaseSettings):
# Background meditation interval in seconds (0 = disabled).
scripture_meditation_interval: int = 0
# ── Perception Cache ───────────────────────────────────────────────
# Minimum confidence threshold for template matching in perception cache.
perception_confidence_threshold: float = 0.85
def _compute_repo_root(self) -> str:
"""Auto-detect repo root if not set."""
if self.repo_root:

View File

@@ -8,6 +8,8 @@ from typing import Any
import cv2
import numpy as np
from config import settings
@dataclass
class Template:
@@ -43,7 +45,7 @@ class PerceptionCache:
best_match_confidence = max_val
best_match_name = template.name
if best_match_confidence > 0.85: # TODO: Make this configurable per template
if best_match_confidence > settings.perception_confidence_threshold:
return CacheResult(
confidence=best_match_confidence, state={"template_name": best_match_name}
)