OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Editing Error "No replacement was performed" is not informative enough

Open xingyaoww opened this issue 1 year ago • 3 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Describe the bug and reproduction steps

The agent got this error:

ERROR:
No replacement was performed. Multiple occurrences of old_str `            output_path = Path.joinpath(self._output_dir, "recipe_state.pt")
            torch.save(state_dict, output_path)
            logger.info(
                "Recipe checkpoint of size "
                f"{os.path.getsize(output_path) / 1000**3:.2f} GB "
                f"saved to {output_path}"
            )` in lines []. Please ensure it is unique.

in lines []. Please ensure it is unique. does look right? Should we give out the specific line number?

Full trajectory: https://www.all-hands.dev/share?share_id=7c05665906ffb699d93426129b1ee8c50c3cc5c7dcb5e164de9c54f6468e7876

cc @ryanhoangt

OpenHands Installation

Docker command in README

OpenHands Version

No response

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

xingyaoww avatar Dec 02 '24 14:12 xingyaoww

Just to note for the record, this is from Anthropic's error strings for the LLM

When I saw the LLM do many of these, and fail because of max iterations, I had to use this prompt: https://github.com/All-Hands-AI/OpenHands/pull/5223#issuecomment-2495653514

It worked so well I had to jump for joy (no, really 😅)

You're good! Your choice to run bash scripts was brilliant! You fixed the rest of the documentation for human users in only 4 steps this time.

enyst avatar Dec 02 '24 15:12 enyst

But we have a problem. You're good, but you were not allowed to use the "str_replace_editor" tool when "old_str" is not unique in the file, so many of your attempted replacements were not performed. You had to go back and include more context. Then they were performed, but you ran out of time.

🤣

xingyaoww avatar Dec 02 '24 15:12 xingyaoww

Fixing PR raised: https://github.com/All-Hands-AI/openhands-aci/pull/17

ryanhoangt avatar Dec 03 '24 07:12 ryanhoangt

Occurs again in 0.17 with GPT-4o: image

avi12 avatar Dec 26 '24 22:12 avi12

Apparently as of commenting, OpenAI has a major outage image

avi12 avatar Dec 26 '24 22:12 avi12

I still face this error as of https://github.com/All-Hands-AI/OpenHands/commit/d46d99a35e37ae08ee68ffdf045caea30f020c07, this time running a local LLM via LM Studio https://www.all-hands.dev/share?share_id=164c9bfb4ea578240d33e698145c1fbffa250977c11d86e6f9718611ffcb12ce

avi12 avatar Feb 13 '25 16:02 avi12