insight-chat: code-review polish on the days_radius fix
- Bind effective_radius once in fetch_messages_for_contact so the log output and window math share a single source of truth for the clamp. - Clamp tool-supplied days_radius to [1, 30] at the tool boundary so a runaway LLM value can't produce a thousand-day window. - Split the negative-input test into a real negative-input case alongside the zero-input case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1812,7 +1812,8 @@ Return ONLY the summary, nothing else."#,
|
||||
let days_radius = args
|
||||
.get("days_radius")
|
||||
.and_then(|v| v.as_i64())
|
||||
.unwrap_or(4);
|
||||
.unwrap_or(4)
|
||||
.clamp(1, 30);
|
||||
let limit = args
|
||||
.get("limit")
|
||||
.and_then(|v| v.as_i64())
|
||||
|
||||
Reference in New Issue
Block a user