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>
This commit is contained in:
Xia Zhenhua
2024-05-09 21:04:02 +08:00
committed by GitHub
parent 780db1e906
commit 4a72e83938
11 changed files with 10 additions and 18 deletions

View File

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

View File

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

View File

@@ -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.

View File

@@ -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 }}

View File

@@ -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`.

View File

@@ -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`.

View File

@@ -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:

View File

@@ -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.

View File

@@ -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.',

View File

@@ -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();

View File

@@ -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.
"""