MCPcopy Create free account
hub / github.com/AI45Lab/Code / record_parse_error

Method record_parse_error

core/src/agent/execution_state.rs:136–156  ·  view source on GitHub ↗
(
        &mut self,
        parse_error: &str,
        max_parse_retries: u32,
    )

Source from the content-addressed store, hash-verified

134 }
135
136 pub(super) fn record_parse_error(
137 &mut self,
138 parse_error: &str,
139 max_parse_retries: u32,
140 ) -> ParseErrorOutcome {
141 self.parse_error_count += 1;
142 let output = format!("Error: {}", parse_error);
143 let fatal_message = (self.parse_error_count > max_parse_retries).then(|| {
144 format!(
145 "LLM produced malformed tool arguments {} time(s) in a row \
146 (max_parse_retries={}); giving up",
147 self.parse_error_count, max_parse_retries
148 )
149 });
150
151 ParseErrorOutcome {
152 output,
153 count: self.parse_error_count,
154 fatal_message,
155 }
156 }
157
158 pub(super) fn reset_parse_errors(&mut self) {
159 self.parse_error_count = 0;

Calls

no outgoing calls