Просмотр исходного кода

fix: AgentThinkAction deleted caused bug. (#1662)

* fix: AgentThinkAction deleted caused bug.

* fix: AgentThinkAction deleted caused bug in plannerAgent.

* fix: plan content-not-changed caused frontend crash bug.

---------

Co-authored-by: aaren.xzh <aaren.xzh@antfin.com>
Xia Zhenhua 1 год назад
Родитель
Сommit
4a72e83938

+ 2 - 0
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 record

+ 0 - 2
agenthub/micro/_instructions/actions/think.md

@@ -1,2 +0,0 @@
-* `think` - make a plan, set a goal, or record your thoughts. Arguments:
-  * `thought` - the thought to record

+ 1 - 1
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.

+ 1 - 1
agenthub/micro/postgres_agent/prompt.md

@@ -11,7 +11,7 @@ You must:
 
 ## Actions
 You may take any of the following actions:
-{{ instructions.actions.think }}
+{{ instructions.actions.message }}
 {{ instructions.actions.read }}
 {{ instructions.actions.write }}
 {{ instructions.actions.run }}

+ 1 - 1
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`.

+ 1 - 1
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`.

+ 1 - 1
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:

+ 1 - 1
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.

+ 1 - 1
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.',

+ 1 - 1
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();

+ 0 - 8
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.
     """