Skip to content

Commit fd66ae1

Browse files
committed
Fix parsing of boolean values and single line tool calls without new lines
1 parent f0e292e commit fd66ae1

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

aider/coders/navigator_coder.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def _process_tool_commands(self, content):
13101310
max_calls = self.max_tool_calls
13111311

13121312
# Check if there's a '---' separator and only process tool calls after the LAST one
1313-
separator_marker = "\n---\n"
1313+
separator_marker = "---"
13141314
content_parts = content.split(separator_marker)
13151315

13161316
# If there's no separator, treat the entire content as before the separator
@@ -1508,8 +1508,16 @@ def _process_tool_commands(self, content):
15081508
value = value[1:]
15091509
if value.endswith('\n'):
15101510
value = value[:-1]
1511-
elif isinstance(value_node, ast.Name): # Handle unquoted values like True/False/None or variables (though variables are unlikely here)
1512-
value = value_node.id
1511+
elif isinstance(value_node, ast.Name): # Handle unquoted values like True/False/None or variables
1512+
id_val = value_node.id.lower()
1513+
if id_val == 'true':
1514+
value = True
1515+
elif id_val == 'false':
1516+
value = False
1517+
elif id_val == 'none':
1518+
value = None
1519+
else:
1520+
value = value_node.id # Keep as string if it's something else
15131521
# Add more types if needed (e.g., ast.List, ast.Dict)
15141522
else:
15151523
# Attempt to reconstruct the source for complex types, or raise error

0 commit comments

Comments
 (0)