π OpenHands: AI-Driven Development
fix: AgentThinkAction deleted caused bug. (#1662)
Xia Zhenhua4a72e8393816
diff --git a/agenthub/micro/_instructions/actions/message.md b/agenthub/micro/_instructions/actions/message.mdnew file mode 100644index 0000000000..0e72029c64--- /dev/null+++ b/agenthub/micro/_instructions/actions/message.md@@ -0,0 +1,2 @@+* `message` - make a plan, set a goal, or record your thoughts. Arguments:+ * `content` - the thought to recorddiff --git a/agenthub/micro/_instructions/actions/think.md b/agenthub/micro/_instructions/actions/think.mddeleted file mode 100644index 435bb6e97f..0000000000--- a/agenthub/micro/_instructions/actions/think.md+++ /dev/null@@ -1,2 +0,0 @@-* `think` - make a plan, set a goal, or record your thoughts. Arguments:- * `thought` - the thought to recorddiff --git a/agenthub/micro/coder/prompt.md b/agenthub/micro/coder/prompt.mdindex 3e6028c944..ca39eca61d 100644--- a/agenthub/micro/coder/prompt.md+++ b/agenthub/micro/coder/prompt.md@@ -14,7 +14,7 @@ Here's a summary of the codebase, as it relates to this task:{{ instructions.actions.run }}{{ instructions.actions.write }}{{ instructions.actions.read }}-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.finish }}Do NOT finish until you have completed the tasks.diff --git a/agenthub/micro/postgres_agent/prompt.md b/agenthub/micro/postgres_agent/prompt.mdindex 835867a765..79acd530f1 100644--- a/agenthub/micro/postgres_agent/prompt.md+++ b/agenthub/micro/postgres_agent/prompt.md@@ -11,7 +11,7 @@ You must:## ActionsYou may take any of the following actions:-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.read }}{{ instructions.actions.write }}{{ instructions.actions.run }}diff --git a/agenthub/micro/repo_explorer/prompt.md b/agenthub/micro/repo_explorer/prompt.mdindex ddd8239cf1..ccf421c9ff 100644--- a/agenthub/micro/repo_explorer/prompt.md+++ b/agenthub/micro/repo_explorer/prompt.md@@ -10,7 +10,7 @@ of the codebase, including:## Available Actions{{ instructions.actions.run }}{{ instructions.actions.read }}-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.finish }}You should ONLY `run` commands that have no side-effects, like `ls` and `grep`.diff --git a/agenthub/micro/study_repo_for_task/prompt.md b/agenthub/micro/study_repo_for_task/prompt.mdindex 4612b4aa5f..820898e003 100644--- a/agenthub/micro/study_repo_for_task/prompt.md+++ b/agenthub/micro/study_repo_for_task/prompt.md@@ -8,7 +8,7 @@ the information needed to complete this task:## Available Actions{{ instructions.actions.run }}{{ instructions.actions.read }}-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.finish }}You must ONLY `run` commands that have no side-effects, like `ls` and `grep`.diff --git a/agenthub/micro/typo_fixer_agent/prompt.md b/agenthub/micro/typo_fixer_agent/prompt.mdindex 7352ecbd4f..0f33348131 100644--- a/agenthub/micro/typo_fixer_agent/prompt.md+++ b/agenthub/micro/typo_fixer_agent/prompt.md@@ -8,7 +8,7 @@ You are a proofreader tasked with fixing typos in the files in your current work{{ instructions.actions.read }}{{ instructions.actions.write }}{{ instructions.actions.run }}-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.finish }}To complete this task:diff --git a/agenthub/micro/verifier/prompt.md b/agenthub/micro/verifier/prompt.mdindex b3b897d9e6..1a43f8600c 100644--- a/agenthub/micro/verifier/prompt.md+++ b/agenthub/micro/verifier/prompt.md@@ -9,7 +9,7 @@ Your goal is to verify that the changes are correct and bug-free.## Available Actions{{ instructions.actions.run }}{{ instructions.actions.read }}-{{ instructions.actions.think }}+{{ instructions.actions.message }}{{ instructions.actions.finish }}You must ONLY `run` commands that have no side-effects, like `ls`, `grep`, and test scripts.diff --git a/agenthub/planner_agent/prompt.py b/agenthub/planner_agent/prompt.pyindex 36568714a0..6ae0ed851a 100644--- a/agenthub/planner_agent/prompt.py+++ b/agenthub/planner_agent/prompt.py@@ -114,7 +114,7 @@ def get_hint(latest_action_id: str) -> str:ActionType.READ: 'You should think about the file you just read, what you learned from it, and how that affects your plan.',ActionType.WRITE: 'You just changed a file. You should think about how it affects your plan.',ActionType.BROWSE: 'You should think about the page you just visited, and what you learned from it.',- ActionType.THINK: "Look at your last thought in the history above. What does it suggest? Don't think anymore--take action.",+ ActionType.MESSAGE: "Look at your last thought in the history above. What does it suggest? Don't think anymore--take action.",ActionType.RECALL: 'You should think about the information you just recalled, and how it should affect your plan.',ActionType.ADD_TASK: 'You should think about the next action to take.',ActionType.MODIFY_TASK: 'You should think about the next action to take.',diff --git a/frontend/src/services/planService.ts b/frontend/src/services/planService.tsindex 7fd31a71fc..b910c3c2e8 100644--- a/frontend/src/services/planService.ts+++ b/frontend/src/services/planService.ts@@ -25,7 +25,7 @@ export async function getPlan(): Promise<Plan | undefined> {Authorization: `Bearer ${localStorage.getItem("token")}`,});const res = await fetch("/api/plan", { headers });- if (res.status !== 200) {+ if (res.status !== 200 && res.status !== 204) {return undefined;}const data = await res.json();diff --git a/opendevin/core/schema/action.py b/opendevin/core/schema/action.pyindex 784867c1fb..b1d19373b0 100644--- a/opendevin/core/schema/action.py+++ b/opendevin/core/schema/action.py@@ -44,14 +44,6 @@ class ActionTypeSchema(BaseModel):"""Searches long-term memory"""- THINK: str = Field(default='think')- """Allows the agent to make a plan, set a goal, or record thoughts- """-- TALK: str = Field(default='talk')- """Allows the agent to respond to the user.- """-DELEGATE: str = Field(default='delegate')"""Delegates a task to another agent."""