mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
added new line to regex of diff blocks
This commit is contained in:
parent
a4ddac4f2c
commit
4a6898bbda
@ -519,7 +519,7 @@ class RuntimeClient:
|
||||
|
||||
async def edit(self, action: FileEditAction) -> Observation:
|
||||
diff_blocks = re.search(
|
||||
f'(.*){HEAD}(.*){DIVIDER}(.*){TAIL}', action.diff_block, re.DOTALL
|
||||
f'(.*){HEAD}\n(.*)\n{DIVIDER}\n(.*)\n{TAIL}', action.diff_block, re.DOTALL
|
||||
)
|
||||
if not diff_blocks or len(diff_blocks.groups()) < 3:
|
||||
return ErrorObservation(
|
||||
@ -527,8 +527,8 @@ class RuntimeClient:
|
||||
)
|
||||
|
||||
path = diff_blocks.group(1).strip()
|
||||
search_block = diff_blocks.group(2).strip()
|
||||
replace_block = diff_blocks.group(3).strip()
|
||||
search_block = diff_blocks.group(2)
|
||||
replace_block = diff_blocks.group(3)
|
||||
|
||||
working_dir = self._get_working_directory()
|
||||
filepath = self._resolve_path(path, working_dir)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user