OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

instruct the agent to comment less

Open rbren opened this issue 1 year ago • 2 comments

End-user friendly description of the problem this fixes or functionality that this introduces

  • [x] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below CHANGELOG: modified agent instructions to include fewer redundant comments in the code it generates

Give a summary of what the PR does, explaining any non-trivial design decisions

OpenHands constantly puts comments like this:

// greet the user with console.log
console.log('hello!');

These sorts of comments are almost always unhelpful, and they quickly fall out of sync with the code, creating confusion.

Even worse, it'll do stuff like this when editing existing code

// greet the user with console.log
console.log('greetings!');  // our new message instead of 'hello'

This PR instructs the agent to comment less. Not quite sure how to validate, other than manual testing. I'm also slightly concerned it might muck with the LLM-based editing strategy


Link of any specific issues this addresses


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:622c622-nikolaik   --name openhands-app-622c622   ghcr.io/all-hands-ai/runtime:622c622

rbren avatar Nov 01 '24 12:11 rbren

Is this intended with (a few) function calling LLMs we currently support, or with most LLMs? With function calling, the prompt in use is here.

enyst avatar Nov 01 '24 13:11 enyst

^^ @enyst is correct - we should probably look into the function calling SYSTEM prompt

xingyaoww avatar Nov 01 '24 19:11 xingyaoww

@rbren good to merge?

mamoodi avatar Nov 07 '24 15:11 mamoodi

OK fixed the function calling prompt to match

rbren avatar Nov 07 '24 21:11 rbren