>> Why do sessions often end with "I believe...
# slackbot-chatter
c
> Why do sessions often end with "I believe the task was completed partially"? I am not clear which part was not complete.
@nutritious-balloon-65098 We should stop displaying "I believe the task was XX" in the frontend UI based on the agent's finish action argument. Please help me remove that from frontend
n
I'm on it! Xingyao Wang can track my progress here.
l
Kept happening with gemini flash. The agent said it called the function with partial because it wasn't sure if I needed something else, but I didn't look further into it.
n
I've successfully removed the "I believe the task was completed partially" message (and similar completion status messages) from the frontend UI. Here's what I did: 1. Identified the source of the message in the frontend code: ◦ Found that the message was being displayed in the
getFinishActionContent
function in
frontend/src/components/features/chat/event-content-helpers/get-action-content.ts
◦ The function was appending different messages based on the
task_completed
parameter from the agent's finish action 2. Modified the code: ◦ Simplified the
getFinishActionContent
function to only return the agent's final thought without appending any task completion status message ◦ This change removes all three variants of the message: "completed successfully", "not completed", and "completed partially" 3. Verified the changes: ◦ Successfully ran the frontend linting and build process to ensure the changes were valid ◦ Committed the changes with a descriptive commit message Now when an agent uses the finish action, the UI will only display the agent's final thought without appending any additional message about the task completion status. This addresses the user's request to stop displaying "I believe the task was XX" in the frontend UI based on the agent's finish action argument.
c
@nutritious-balloon-65098 please open a new PR for it
n
I'm on it! Xingyao Wang can continue tracking my progress here.
I've successfully addressed your request to remove the "I believe the task was XX" messages from the frontend UI. Here's a summary of what I did: 1. Identified the source of these messages in the frontend code: ◦ Found that they were being added in the
getFinishActionContent
function in
frontend/src/components/features/chat/event-content-helpers/get-action-content.ts
◦ These messages were based on the
task_completed
parameter from the agent's finish action 2. Made the necessary code changes: ◦ Modified the
getFinishActionContent
function to only return the final thought without appending any task completion status message ◦ The change was minimal and focused only on removing the unwanted messages 3. Verified the changes: ◦ Successfully built the frontend to ensure there were no build errors ◦ Ran linting to ensure code quality 4. Created a pull request: ◦ Created a new branch called
remove-task-completion-message
◦ Pushed the changes to GitHub ◦ Created PR #9977 (https://github.com/All-Hands-AI/OpenHands/pull/9977) The PR is currently in draft status. Once reviewed and approved, this change will prevent the "I believe that the task was completed partially/successfully/not completed" messages from appearing at the end of conversations in the OpenHands UI.
l
This is the message from the LLM (task_completed = true)
Copy code
{
  "text": "function=finish
parameter=message
I have created three test text files: `/workspace/test1.txt`, `/workspace/test2.txt`, and `/workspace/test3.txt`.
/parameter
parameter=task_completed
true
/parameter"
}
This is the function description (says true/false):
Copy code
_FINISH_DESCRIPTION = """Signals the completion of the current task or conversation.

Use this tool when:
- You have successfully completed the user's requested task
- You cannot proceed further due to technical limitations or missing information

The message should include:
- A clear summary of actions taken and their results
- Any next steps for the user
- Explanation if you're unable to complete the task
- Any follow-up questions if more information is needed

The task_completed field should be set to True if you believed you have completed the task, and False otherwise.
"""
This, however, is what I found in get-action-content.ts:
Copy code
let content = event.args.final_thought;

  switch (event.args.task_completed) {
    case "success":
      content += `\n\n\n${i18n.t("FINISH$TASK_COMPLETED_SUCCESSFULLY")}`;
      break;
    case "failure":
      content += `\n\n\n${i18n.t("FINISH$TASK_NOT_COMPLETED")}`;
      break;
    case "partial":
    default:
      content += `\n\n\n${i18n.t("FINISH$TASK_COMPLETED_PARTIALLY")}`;
      break;
  }

  return content.trim();
};
So, the LLM is instructed to report true/false, while the check expects success/failure/partial? Or maybe I didn't look up the code correctly (I just did a quick text search).
c
We’re thinking to remove this strange ‘partial’