From c03f4f7c603acf008ed86552f36ad6caba468b57 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Tue, 7 Apr 2026 14:21:57 -0600 Subject: [PATCH] fix(ai): document confidence fields in write_cache tool schema (#54) The system prompt already instructs the agent to set confidence/ confidence_reason on every write_cache call, but the tool's data schema description listed only the legacy fields. Add the confidence fields and a one-line calibration pointer so the model sees them when binding the tool, not just in the system prompt. Co-Authored-By: Claude Opus 4.6 (1M context) --- luminos_lib/ai.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/luminos_lib/ai.py b/luminos_lib/ai.py index cbe2353..cf04e44 100644 --- a/luminos_lib/ai.py +++ b/luminos_lib/ai.py @@ -247,9 +247,14 @@ _DIR_TOOLS = [ "type": "object", "description": ( "Cache entry. Files: {path, relative_path, size_bytes, " - "category, summary, notable, notable_reason, cached_at}. " + "category, summary, notable, notable_reason, " + "confidence, confidence_reason, cached_at}. " "Dirs: {path, relative_path, child_count, summary, " - "dominant_category, notable_files, cached_at}." + "dominant_category, notable_files, " + "confidence, confidence_reason, cached_at}. " + "Always set confidence (0.0–1.0); see system prompt " + "for calibration. Set confidence_reason only when " + "confidence < 0.7." ), }, },