From e4ccd4057dcc0525537ea15b14229bd97eec8d0b Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Wed, 19 Mar 2025 17:09:51 -0400 Subject: [PATCH] misc: tweak frontend prompt to prevent agent push to a different branch & update app prompt (#7357) --- frontend/src/components/features/chat/action-suggestions.tsx | 4 ++-- openhands/agenthub/codeact_agent/prompts/additional_info.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/features/chat/action-suggestions.tsx b/frontend/src/components/features/chat/action-suggestions.tsx index ec0917e49e..020835645b 100644 --- a/frontend/src/components/features/chat/action-suggestions.tsx +++ b/frontend/src/components/features/chat/action-suggestions.tsx @@ -40,7 +40,7 @@ export function ActionSuggestions({ suggestion={{ label: "Push to Branch", value: - "Please push the changes to a remote branch on GitHub, but do NOT create a pull request.", + "Please push the changes to a remote branch on GitHub, but do NOT create a pull request. Please use the exact SAME branch name as the one you are currently on.", }} onClick={(value) => { posthog.capture("push_to_branch_button_clicked"); @@ -51,7 +51,7 @@ export function ActionSuggestions({ suggestion={{ label: "Push & Create PR", value: - "Please push the changes to GitHub and open a pull request.", + "Please push the changes to GitHub and open a pull request. Please use the exact SAME branch name as the one you are currently on.", }} onClick={(value) => { posthog.capture("create_pr_button_clicked"); diff --git a/openhands/agenthub/codeact_agent/prompts/additional_info.j2 b/openhands/agenthub/codeact_agent/prompts/additional_info.j2 index 902800b48d..f7e7ff9495 100644 --- a/openhands/agenthub/codeact_agent/prompts/additional_info.j2 +++ b/openhands/agenthub/codeact_agent/prompts/additional_info.j2 @@ -19,7 +19,7 @@ each of which has a corresponding port: When starting a web server, use the corresponding ports. You should also set any options to allow iframes and CORS requests, and allow the server to be accessed from any host (e.g. 0.0.0.0). -For example, if you are using vite.config.js, you should set server.host to 0.0.0.0, server.port to the port assigned to you, and allowedHosts to ['*']. +For example, if you are using vite.config.js, you should set server.host to 0.0.0.0, server.port to the port assigned to you, and allowedHosts to the host assigned to you. {% endif %} {% if runtime_info.additional_agent_instructions %} {{ runtime_info.additional_agent_instructions }}