Method
remember_tool_signature
(
&mut self,
tool_name: &str,
args: &Value,
is_error: bool,
)
Source from the content-addressed store, hash-verified
| 164 | } |
| 165 | |
| 166 | pub(super) fn remember_tool_signature( |
| 167 | &mut self, |
| 168 | tool_name: &str, |
| 169 | args: &Value, |
| 170 | is_error: bool, |
| 171 | ) { |
| 172 | self.recent_tool_signatures.push(format!( |
| 173 | "{}:{} => {}", |
| 174 | tool_name, |
| 175 | serde_json::to_string(args).unwrap_or_default(), |
| 176 | if is_error { "error" } else { "ok" } |
| 177 | )); |
| 178 | |
| 179 | if self.recent_tool_signatures.len() > RECENT_TOOL_SIGNATURE_LIMIT { |
| 180 | let overflow = self.recent_tool_signatures.len() - RECENT_TOOL_SIGNATURE_LIMIT; |
| 181 | self.recent_tool_signatures.drain(0..overflow); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | pub(super) fn should_inject_continuation( |
| 186 | &mut self, |