diff --git a/agenthub/README.md b/agenthub/README.md index a6f6f1ce9e..1d406916d3 100644 --- a/agenthub/README.md +++ b/agenthub/README.md @@ -33,7 +33,6 @@ Here is a list of available Actions, which can be returned by `agent.step()`: - [`FileReadAction`](../opendevin/events/action/files.py) - Reads the content of a file - [`FileWriteAction`](../opendevin/events/action/files.py) - Writes new content to a file - [`BrowseURLAction`](../opendevin/events/action/browse.py) - Gets the content of a URL -- [`AgentRecallAction`](../opendevin/events/action/agent.py) - Searches memory (e.g. a vector database) - [`AddTaskAction`](../opendevin/events/action/tasks.py) - Adds a subtask to the plan - [`ModifyTaskAction`](../opendevin/events/action/tasks.py) - Changes the state of a subtask. - [`AgentFinishAction`](../opendevin/events/action/agent.py) - Stops the control loop, allowing the user/delegator agent to enter a new task @@ -54,7 +53,6 @@ Here is a list of available Observations: - [`BrowserOutputObservation`](../opendevin/events/observation/browse.py) - [`FileReadObservation`](../opendevin/events/observation/files.py) - [`FileWriteObservation`](../opendevin/events/observation/files.py) -- [`AgentRecallObservation`](../opendevin/events/observation/recall.py) - [`ErrorObservation`](../opendevin/events/observation/error.py) - [`SuccessObservation`](../opendevin/events/observation/success.py) @@ -72,14 +70,3 @@ def step(self, state: "State") -> "Action" `step` moves the agent forward one step towards its goal. This probably means sending a prompt to the LLM, then parsing the response into an `Action`. - -### `search_memory` - -``` -def search_memory(self, query: str) -> list[str]: -``` - -`search_memory` should return a list of events that match the query. This will be used -for the `recall` action. - -You can optionally just return `[]` for this method, meaning the agent has no long-term memory. diff --git a/agenthub/browsing_agent/browsing_agent.py b/agenthub/browsing_agent/browsing_agent.py index 926d9c8338..f334fcf1e7 100644 --- a/agenthub/browsing_agent/browsing_agent.py +++ b/agenthub/browsing_agent/browsing_agent.py @@ -213,6 +213,3 @@ class BrowsingAgent(Agent): stop=[')```', ')\n```'], ) return self.response_parser.parse(response) - - def search_memory(self, query: str) -> list[str]: - raise NotImplementedError('Implement this abstract method') diff --git a/agenthub/codeact_agent/codeact_agent.py b/agenthub/codeact_agent/codeact_agent.py index 6a2eb05df2..d78ff5b1ed 100644 --- a/agenthub/codeact_agent/codeact_agent.py +++ b/agenthub/codeact_agent/codeact_agent.py @@ -208,9 +208,6 @@ class CodeActAgent(Agent): ) return self.action_parser.parse(response) - def search_memory(self, query: str) -> list[str]: - raise NotImplementedError('Implement this abstract method') - def _get_messages(self, state: State) -> list[dict[str, str]]: messages = [ {'role': 'system', 'content': self.system_message}, diff --git a/agenthub/codeact_swe_agent/codeact_swe_agent.py b/agenthub/codeact_swe_agent/codeact_swe_agent.py index c18041fdcd..7b361ef865 100644 --- a/agenthub/codeact_swe_agent/codeact_swe_agent.py +++ b/agenthub/codeact_swe_agent/codeact_swe_agent.py @@ -162,9 +162,6 @@ class CodeActSWEAgent(Agent): return self.response_parser.parse(response) - def search_memory(self, query: str) -> list[str]: - raise NotImplementedError('Implement this abstract method') - def _get_messages(self, state: State) -> list[dict[str, str]]: messages = [ {'role': 'system', 'content': self.system_message}, diff --git a/agenthub/delegator_agent/agent.py b/agenthub/delegator_agent/agent.py index f97c5e5096..e9560e39c4 100644 --- a/agenthub/delegator_agent/agent.py +++ b/agenthub/delegator_agent/agent.py @@ -82,6 +82,3 @@ class DelegatorAgent(Agent): ) else: raise Exception('Invalid delegate state') - - def search_memory(self, query: str) -> list[str]: - return [] diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index ea72e86e3c..e6cf291588 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -7,7 +7,6 @@ from opendevin.events.action import ( Action, AddTaskAction, AgentFinishAction, - AgentRecallAction, AgentRejectAction, BrowseInteractiveAction, BrowseURLAction, @@ -18,7 +17,6 @@ from opendevin.events.action import ( ModifyTaskAction, ) from opendevin.events.observation import ( - AgentRecallObservation, CmdOutputObservation, FileReadObservation, FileWriteObservation, @@ -91,12 +89,6 @@ class DummyAgent(Agent): ) ], }, - { - 'action': AgentRecallAction(query='who am I?'), - 'observations': [ - AgentRecallObservation('', memories=['I am a computer.']), - ], - }, { 'action': BrowseURLAction(url='https://google.com'), 'observations': [ @@ -152,6 +144,3 @@ class DummyAgent(Agent): hist_obs == expected_obs ), f'Expected observation {expected_obs}, got {hist_obs}' return self.steps[state.iteration]['action'] - - def search_memory(self, query: str) -> list[str]: - return ['I am a computer.'] diff --git a/agenthub/micro/agent.py b/agenthub/micro/agent.py index d4ed2ce8a3..7bf9eeeded 100644 --- a/agenthub/micro/agent.py +++ b/agenthub/micro/agent.py @@ -79,6 +79,3 @@ class MicroAgent(Agent): action_resp = resp['choices'][0]['message']['content'] action = parse_response(action_resp) return action - - def search_memory(self, query: str) -> list[str]: - return [] diff --git a/agenthub/monologue_agent/agent.py b/agenthub/monologue_agent/agent.py index 5aeec331cc..cb2e9f9ece 100644 --- a/agenthub/monologue_agent/agent.py +++ b/agenthub/monologue_agent/agent.py @@ -8,7 +8,6 @@ from opendevin.core.exceptions import AgentNoInstructionError from opendevin.core.schema import ActionType from opendevin.events.action import ( Action, - AgentRecallAction, BrowseURLAction, CmdRunAction, FileReadAction, @@ -17,7 +16,6 @@ from opendevin.events.action import ( NullAction, ) from opendevin.events.observation import ( - AgentRecallObservation, BrowserOutputObservation, CmdOutputObservation, FileReadObservation, @@ -103,8 +101,6 @@ class MonologueAgent(Agent): ) elif previous_action == ActionType.READ: observation = FileReadObservation(content=thought, path='') - elif previous_action == ActionType.RECALL: - observation = AgentRecallObservation(content=thought, memories=[]) elif previous_action == ActionType.BROWSE: observation = BrowserOutputObservation( content=thought, url='', screenshot='' @@ -128,10 +124,6 @@ class MonologueAgent(Agent): path = thought.split('READ ')[1] action = FileReadAction(path=path) previous_action = ActionType.READ - elif thought.startswith('RECALL'): - query = thought.split('RECALL ')[1] - action = AgentRecallAction(query=query) - previous_action = ActionType.RECALL elif thought.startswith('BROWSE'): url = thought.split('BROWSE ')[1] action = BrowseURLAction(url=url) @@ -192,21 +184,6 @@ class MonologueAgent(Agent): self.latest_action = action return action - def search_memory(self, query: str) -> list[str]: - """ - Uses VectorIndexRetriever to find related memories within the long term memory. - Uses search to produce top 10 results. - - Parameters: - - The query that we want to find related memories for - - Returns: - - A list of top 10 text results that matched the query - """ - if self.memory is None: - return [] - return self.memory.search(query) - def reset(self) -> None: super().reset() diff --git a/agenthub/monologue_agent/utils/prompts.py b/agenthub/monologue_agent/utils/prompts.py index ea76581262..ba885bd421 100644 --- a/agenthub/monologue_agent/utils/prompts.py +++ b/agenthub/monologue_agent/utils/prompts.py @@ -35,14 +35,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. @@ -92,15 +90,7 @@ INITIAL_THOUGHTS = [ 'It seems like I have some kind of short term memory.', 'Each of my thoughts seems to be stored in a JSON array.', 'It seems whatever I say next will be added as an object to the list.', - 'But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.', - 'Fortunately I have long term memory!', - 'I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!', - "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "Let's try it out!", - 'RECALL what it is I want to do', - "Here's what I want to do: $TASK", - 'How am I going to get there though?', - "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", 'RUN echo "hello world"', 'hello world', 'Cool! I bet I can write files too using the write action.', diff --git a/agenthub/planner_agent/agent.py b/agenthub/planner_agent/agent.py index 1f3d475cbd..2ee2874278 100644 --- a/agenthub/planner_agent/agent.py +++ b/agenthub/planner_agent/agent.py @@ -49,6 +49,3 @@ class PlannerAgent(Agent): messages = [{'content': prompt, 'role': 'user'}] resp = self.llm.completion(messages=messages) return self.response_parser.parse(resp) - - def search_memory(self, query: str) -> list[str]: - return [] diff --git a/agenthub/planner_agent/prompt.py b/agenthub/planner_agent/prompt.py index b14136a35e..95bdd43838 100644 --- a/agenthub/planner_agent/prompt.py +++ b/agenthub/planner_agent/prompt.py @@ -89,7 +89,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. @@ -109,7 +109,6 @@ def get_hint(latest_action_id: str) -> str: 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.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.', ActionType.SUMMARIZE: '', diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md index 6b41764520..48d90969ad 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md @@ -55,7 +55,6 @@ _Exemple de CodeActAgent avec `gpt-4-turbo-2024-04-09` effectuant une tâche de | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `__init__` | Initialise un agent avec `llm` et une liste de messages `list[Mapping[str, str]]` | | `step` | Effectue une étape en utilisant l'agent CodeAct. Cela inclut la collecte d'informations sur les étapes précédentes et invite le modèle à exécuter une commande. | -| `search_memory` | Pas encore implémenté | ### En cours de réalisation & prochaine étape @@ -77,7 +76,6 @@ La mémoire à court terme est stockée en tant qu'objet Monologue et le modèle `CmdRunAction`, `FileWriteAction`, `FileReadAction`, -`AgentRecallAction`, `BrowseURLAction`, `GithubPushAction`, `AgentThinkAction` @@ -88,7 +86,6 @@ La mémoire à court terme est stockée en tant qu'objet Monologue et le modèle `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### Méthodes @@ -99,7 +96,6 @@ La mémoire à court terme est stockée en tant qu'objet Monologue et le modèle | `_add_event` | Ajoute des événements au monologue de l'agent et condense avec un résumé automatiquement si le monologue est trop long | | `_initialize` | Utilise la liste `INITIAL_THOUGHTS` pour donner à l'agent un contexte pour ses capacités et comment naviguer dans le `/workspace` | | `step` | Modifie l'état actuel en ajoutant les actions et observations les plus récentes, puis invite le modèle à réfléchir à la prochaine action à entreprendre. | -| `search_memory` | Utilise `VectorIndexRetriever` pour trouver des souvenirs liés à la mémoire à long terme. | ## Agent Planificateur @@ -116,7 +112,6 @@ L'agent reçoit ses paires action-observation précédentes, la tâche actuelle, `GithubPushAction`, `FileReadAction`, `FileWriteAction`, -`AgentRecallAction`, `AgentThinkAction`, `AgentFinishAction`, `AgentSummarizeAction`, @@ -129,7 +124,6 @@ L'agent reçoit ses paires action-observation précédentes, la tâche actuelle, `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### Méthodes @@ -138,4 +132,3 @@ L'agent reçoit ses paires action-observation précédentes, la tâche actuelle, | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `__init__` | Initialise un agent avec `llm` | | `step` | Vérifie si l'étape actuelle est terminée, retourne `AgentFinishAction` si oui. Sinon, crée une incitation de planification et l'envoie au modèle pour inférence, en ajoutant le résultat comme prochaine action. | -| `search_memory` | Pas encore implémenté | diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/agents.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/agents.md index dff00ae43d..afa6368b80 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/agents.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/agents.md @@ -55,7 +55,6 @@ _CodeActAgent使用`gpt-4-turbo-2024-04-09`执行数据科学任务(线性回 | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | `__init__` | 使用`llm`和一系列信息`list[Mapping[str, str]]`初始化Agent | | `step` | 使用CodeAct Agent执行一步操作,包括收集前一步的信息并提示模型执行命令。 | -| `search_memory`| 尚未实现 | ### 进行中的工作 & 下一步 @@ -77,7 +76,6 @@ Monologue Agent利用长短期记忆来完成任务。 `CmdRunAction`, `FileWriteAction`, `FileReadAction`, -`AgentRecallAction`, `BrowseURLAction`, `GithubPushAction`, `AgentThinkAction` @@ -88,7 +86,6 @@ Monologue Agent利用长短期记忆来完成任务。 `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### 方法 @@ -99,7 +96,6 @@ Monologue Agent利用长短期记忆来完成任务。 | `_add_event` | 将事件附加到Agent的独白中,如独白过长自动与摘要一起压缩 | | `_initialize` | 使用`INITIAL_THOUGHTS`列表为agent提供其能力的上下文以及如何导航`/workspace` | | `step` | 通过添加最近的动作和观测修改当前状态,然后提示模型考虑其接下来的动作。 | -| `search_memory`| 使用`VectorIndexRetriever`在长期记忆中查找相关记忆。 | ## Planner Agent @@ -116,7 +112,6 @@ Planner agent利用特殊的提示策略为解决问题创建长期计划。 `GithubPushAction`, `FileReadAction`, `FileWriteAction`, -`AgentRecallAction`, `AgentThinkAction`, `AgentFinishAction`, `AgentSummarizeAction`, @@ -129,7 +124,6 @@ Planner agent利用特殊的提示策略为解决问题创建长期计划。 `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### 方法 @@ -138,4 +132,3 @@ Planner agent利用特殊的提示策略为解决问题创建长期计划。 | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `__init__` | 使用`llm`初始化Agent | | `step` | 检查当前步骤是否完成,如果是则返回`AgentFinishAction`。否则,创建计划提示并发送给模型进行推理,将结果作为下一步动作。 | -| `search_memory`| 尚未实现 | diff --git a/docs/modules/usage/agents.md b/docs/modules/usage/agents.md index 0d019d8223..f5723f10d7 100644 --- a/docs/modules/usage/agents.md +++ b/docs/modules/usage/agents.md @@ -55,7 +55,6 @@ _Example of CodeActAgent with `gpt-4-turbo-2024-04-09` performing a data science | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `__init__` | Initializes an agent with `llm` and a list of messages `list[Mapping[str, str]]` | | `step` | Performs one step using the CodeAct Agent. This includes gathering info on previous steps and prompting the model to make a command to execute. | -| `search_memory` | Not yet implemented | ## Monologue Agent @@ -72,7 +71,6 @@ Short term memory is stored as a Monologue object and the model can condense it `CmdRunAction`, `FileWriteAction`, `FileReadAction`, -`AgentRecallAction`, `BrowseURLAction`, `GithubPushAction`, `AgentThinkAction` @@ -83,7 +81,6 @@ Short term memory is stored as a Monologue object and the model can condense it `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### Methods @@ -94,7 +91,6 @@ Short term memory is stored as a Monologue object and the model can condense it | `_add_event` | Appends events to the monologue of the agent and condenses with summary automatically if the monologue is too long | | `_initialize` | Utilizes the `INITIAL_THOUGHTS` list to give the agent a context for its capabilities and how to navigate the `/workspace` | | `step` | Modifies the current state by adding the most recent actions and observations, then prompts the model to think about its next action to take. | -| `search_memory` | Uses `VectorIndexRetriever` to find related memories within the long term memory. | ## Planner Agent @@ -111,7 +107,6 @@ The agent is given its previous action-observation pairs, current task, and hint `GithubPushAction`, `FileReadAction`, `FileWriteAction`, -`AgentRecallAction`, `AgentThinkAction`, `AgentFinishAction`, `AgentSummarizeAction`, @@ -124,7 +119,6 @@ The agent is given its previous action-observation pairs, current task, and hint `NullObservation`, `CmdOutputObservation`, `FileReadObservation`, -`AgentRecallObservation`, `BrowserOutputObservation` ### Methods @@ -133,4 +127,3 @@ The agent is given its previous action-observation pairs, current task, and hint | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `__init__` | Initializes an agent with `llm` | | `step` | Checks to see if current step is completed, returns `AgentFinishAction` if True. Otherwise, creates a plan prompt and sends to model for inference, adding the result as the next action. | -| `search_memory` | Not yet implemented | diff --git a/docs/static/img/backend_architecture.puml b/docs/static/img/backend_architecture.puml index 083e4a3e36..8b51e49b15 100644 --- a/docs/static/img/backend_architecture.puml +++ b/docs/static/img/backend_architecture.puml @@ -14,15 +14,6 @@ class opendevin.observation.AgentMessageObservation { role: str observation: str } -class opendevin.action.agent.AgentRecallAction { - query: str - action: str -} -class opendevin.observation.AgentRecallObservation { - memories: List[str] - role: str - observation: str -} class opendevin.action.agent.AgentSummarizeAction { summary: str action: str @@ -173,8 +164,6 @@ class opendevin.server.session.Session { opendevin.action.base.ExecutableAction <|-- opendevin.action.agent.AgentEchoAction opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentFinishAction opendevin.observation.Observation <|-- opendevin.observation.AgentMessageObservation -opendevin.action.base.ExecutableAction <|-- opendevin.action.agent.AgentRecallAction -opendevin.observation.Observation <|-- opendevin.observation.AgentRecallObservation opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentSummarizeAction opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentThinkAction opendevin.action.base.Action <|-- opendevin.action.base.ExecutableAction diff --git a/frontend/src/types/ActionType.tsx b/frontend/src/types/ActionType.tsx index 95ab61b896..a8d469b1cb 100644 --- a/frontend/src/types/ActionType.tsx +++ b/frontend/src/types/ActionType.tsx @@ -26,9 +26,6 @@ enum ActionType { // Delegate a (sub)task to another agent. DELEGATE = "delegate", - // Searches long-term memory. - RECALL = "recall", - // If you're absolutely certain that you've completed your task and have tested your work, // use the finish action to stop working. FINISH = "finish", diff --git a/frontend/src/types/ObservationType.tsx b/frontend/src/types/ObservationType.tsx index ddc6a0d83b..26bad6d2cd 100644 --- a/frontend/src/types/ObservationType.tsx +++ b/frontend/src/types/ObservationType.tsx @@ -11,9 +11,6 @@ enum ObservationType { // The output of an IPython command RUN_IPYTHON = "run_ipython", - // The result of a search - RECALL = "recall", - // A message from the user CHAT = "chat", diff --git a/opendevin/controller/agent.py b/opendevin/controller/agent.py index ead7a024f1..eb3fe143c4 100644 --- a/opendevin/controller/agent.py +++ b/opendevin/controller/agent.py @@ -51,19 +51,6 @@ class Agent(ABC): """ pass - @abstractmethod - def search_memory(self, query: str) -> list[str]: - """ - Searches the agent's memory for information relevant to the given query. - - Parameters: - - query (str): The query to search for in the agent's memory. - - Returns: - - response (str): The response to the query. - """ - pass - def reset(self) -> None: """ Resets the agent's execution status and clears the history. This method can be used diff --git a/opendevin/core/schema/action.py b/opendevin/core/schema/action.py index cad6db2efa..b2cd267e21 100644 --- a/opendevin/core/schema/action.py +++ b/opendevin/core/schema/action.py @@ -40,10 +40,6 @@ class ActionTypeSchema(BaseModel): """Interact with the browser instance. """ - RECALL: str = Field(default='recall') - """Searches long-term memory - """ - DELEGATE: str = Field(default='delegate') """Delegates a task to another agent. """ diff --git a/opendevin/core/schema/observation.py b/opendevin/core/schema/observation.py index 3a2ec0e019..62f9503e82 100644 --- a/opendevin/core/schema/observation.py +++ b/opendevin/core/schema/observation.py @@ -22,10 +22,6 @@ class ObservationTypeSchema(BaseModel): """Runs a IPython cell. """ - RECALL: str = Field(default='recall') - """The result of a search - """ - CHAT: str = Field(default='chat') """A message from the user """ diff --git a/opendevin/events/action/__init__.py b/opendevin/events/action/__init__.py index cbb4a13452..3a4baacb22 100644 --- a/opendevin/events/action/__init__.py +++ b/opendevin/events/action/__init__.py @@ -2,7 +2,6 @@ from .action import Action, ActionConfirmationStatus from .agent import ( AgentDelegateAction, AgentFinishAction, - AgentRecallAction, AgentRejectAction, AgentSummarizeAction, ChangeAgentStateAction, @@ -22,7 +21,6 @@ __all__ = [ 'BrowseInteractiveAction', 'FileReadAction', 'FileWriteAction', - 'AgentRecallAction', 'AgentFinishAction', 'AgentRejectAction', 'AgentDelegateAction', diff --git a/opendevin/events/action/agent.py b/opendevin/events/action/agent.py index 294ef35684..c9d4ec6a3e 100644 --- a/opendevin/events/action/agent.py +++ b/opendevin/events/action/agent.py @@ -1,5 +1,4 @@ from dataclasses import dataclass, field -from typing import ClassVar from opendevin.core.schema import ActionType @@ -19,18 +18,6 @@ class ChangeAgentStateAction(Action): return f'Agent state changed to {self.agent_state}' -@dataclass -class AgentRecallAction(Action): - query: str - thought: str = '' - action: str = ActionType.RECALL - runnable: ClassVar[bool] = True - - @property - def message(self) -> str: - return f"Let me dive into my memories to find what you're looking for! Searching for: '{self.query}'. This might take a moment." - - @dataclass class AgentSummarizeAction(Action): summary: str @@ -54,7 +41,7 @@ class AgentFinishAction(Action): @property def message(self) -> str: - if self.thought != "": + if self.thought != '': return self.thought return "All done! What's next on the agenda?" diff --git a/opendevin/events/observation/__init__.py b/opendevin/events/observation/__init__.py index 67fa1ccacd..a6c7405ec3 100644 --- a/opendevin/events/observation/__init__.py +++ b/opendevin/events/observation/__init__.py @@ -6,7 +6,6 @@ from .empty import NullObservation from .error import ErrorObservation from .files import FileReadObservation, FileWriteObservation from .observation import Observation -from .recall import AgentRecallObservation from .reject import RejectObservation from .success import SuccessObservation @@ -18,7 +17,6 @@ __all__ = [ 'BrowserOutputObservation', 'FileReadObservation', 'FileWriteObservation', - 'AgentRecallObservation', 'ErrorObservation', 'AgentStateChangedObservation', 'AgentDelegateObservation', diff --git a/opendevin/events/observation/recall.py b/opendevin/events/observation/recall.py deleted file mode 100644 index 3ee65cd681..0000000000 --- a/opendevin/events/observation/recall.py +++ /dev/null @@ -1,20 +0,0 @@ -from dataclasses import dataclass - -from opendevin.core.schema import ObservationType - -from .observation import Observation - - -@dataclass -class AgentRecallObservation(Observation): - """ - This data class represents a list of memories recalled by the agent. - """ - - memories: list[str] - role: str = 'assistant' - observation: str = ObservationType.RECALL - - @property - def message(self) -> str: - return 'The agent recalled memories.' diff --git a/opendevin/events/serialization/action.py b/opendevin/events/serialization/action.py index 1f2101e345..f8051842ee 100644 --- a/opendevin/events/serialization/action.py +++ b/opendevin/events/serialization/action.py @@ -3,7 +3,6 @@ from opendevin.events.action.action import Action from opendevin.events.action.agent import ( AgentDelegateAction, AgentFinishAction, - AgentRecallAction, AgentRejectAction, ChangeAgentStateAction, ) @@ -25,7 +24,6 @@ actions = ( BrowseInteractiveAction, FileReadAction, FileWriteAction, - AgentRecallAction, AgentFinishAction, AgentRejectAction, AgentDelegateAction, diff --git a/opendevin/events/serialization/observation.py b/opendevin/events/serialization/observation.py index 97d167144c..1ff31f37fd 100644 --- a/opendevin/events/serialization/observation.py +++ b/opendevin/events/serialization/observation.py @@ -9,7 +9,6 @@ from opendevin.events.observation.empty import NullObservation from opendevin.events.observation.error import ErrorObservation from opendevin.events.observation.files import FileReadObservation, FileWriteObservation from opendevin.events.observation.observation import Observation -from opendevin.events.observation.recall import AgentRecallObservation from opendevin.events.observation.reject import RejectObservation from opendevin.events.observation.success import SuccessObservation @@ -20,7 +19,6 @@ observations = ( BrowserOutputObservation, FileReadObservation, FileWriteObservation, - AgentRecallObservation, AgentDelegateObservation, SuccessObservation, ErrorObservation, diff --git a/opendevin/runtime/client/runtime.py b/opendevin/runtime/client/runtime.py index 7881783263..7a7a299151 100644 --- a/opendevin/runtime/client/runtime.py +++ b/opendevin/runtime/client/runtime.py @@ -11,7 +11,6 @@ from opendevin.core.config import config from opendevin.core.logger import opendevin_logger as logger from opendevin.events import EventSource, EventStream, EventStreamSubscriber from opendevin.events.action import ( - AgentRecallAction, BrowseInteractiveAction, BrowseURLAction, CmdRunAction, @@ -257,9 +256,6 @@ class EventStreamRuntime(Runtime): async def browse_interactive(self, action: BrowseInteractiveAction) -> Observation: return await self.run_action(action) - async def recall(self, action: AgentRecallAction) -> Observation: - return await self.run_action(action) - ############################################################################ # Keep the same with other runtimes ############################################################################ @@ -273,25 +269,6 @@ class EventStreamRuntime(Runtime): 'This method is not implemented in the runtime client.' ) - # async def read(self, action: FileReadAction) -> Observation: - # working_dir = self.get_working_directory() - # return await read_file(action.path, working_dir, action.start, action.end) - - # async def write(self, action: FileWriteAction) -> Observation: - # working_dir = self.get_working_directory() - # return await write_file( - # action.path, working_dir, action.content, action.start, action.end - # ) - - # async def browse(self, action: BrowseURLAction) -> Observation: - # return await browse(action, self.browser) - - # async def browse_interactive(self, action: BrowseInteractiveAction) -> Observation: - # return await browse(action, self.browser) - - # async def recall(self, action: AgentRecallAction) -> Observation: - # return NullObservation('') - ############################################################################ # Initialization work inside sandbox image ############################################################################ @@ -363,13 +340,6 @@ async def test_event_stream(): await runtime.run_action(action_browse), extra={'msg_type': 'OBSERVATION'} ) - # Test recall - action_recall = AgentRecallAction(query='who am I?') - logger.info(action_recall, extra={'msg_type': 'ACTION'}) - logger.info( - await runtime.run_action(action_recall), extra={'msg_type': 'OBSERVATION'} - ) - if __name__ == '__main__': asyncio.run(test_event_stream()) diff --git a/opendevin/runtime/runtime.py b/opendevin/runtime/runtime.py index 9b3410b499..6355bce97c 100644 --- a/opendevin/runtime/runtime.py +++ b/opendevin/runtime/runtime.py @@ -8,7 +8,6 @@ from opendevin.events import EventStream, EventStreamSubscriber from opendevin.events.action import ( Action, ActionConfirmationStatus, - AgentRecallAction, BrowseInteractiveAction, BrowseURLAction, CmdRunAction, @@ -163,7 +162,3 @@ class Runtime: @abstractmethod async def browse_interactive(self, action: BrowseInteractiveAction) -> Observation: pass - - @abstractmethod - async def recall(self, action: AgentRecallAction) -> Observation: - pass diff --git a/opendevin/runtime/server/runtime.py b/opendevin/runtime/server/runtime.py index 57b671d4f6..de6ac9d7fb 100644 --- a/opendevin/runtime/server/runtime.py +++ b/opendevin/runtime/server/runtime.py @@ -1,6 +1,5 @@ from opendevin.core.config import config from opendevin.events.action import ( - AgentRecallAction, BrowseInteractiveAction, BrowseURLAction, CmdRunAction, @@ -12,7 +11,6 @@ from opendevin.events.observation import ( CmdOutputObservation, ErrorObservation, IPythonRunCellObservation, - NullObservation, Observation, ) from opendevin.events.stream import EventStream @@ -114,9 +112,6 @@ class ServerRuntime(Runtime): async def browse_interactive(self, action: BrowseInteractiveAction) -> Observation: return await browse(action, self.browser) - async def recall(self, action: AgentRecallAction) -> Observation: - return NullObservation('') - def _run_command(self, command: str) -> Observation: try: exit_code, output = self.sandbox.execute(command) diff --git a/opendevin/server/README.md b/opendevin/server/README.md index 1d4df15f01..fa4d6249e6 100644 --- a/opendevin/server/README.md +++ b/opendevin/server/README.md @@ -62,8 +62,6 @@ This list may grow over time. * `command` - the command to run * `browse` - opens a web page. * `url` - the URL to open -* `recall` - searches long-term memory - * `query` - the query to search for * `think` - Allows the agent to make a plan, set a goal, or record thoughts * `thought` - the thought to record * `finish` - agent signals that the task is completed @@ -87,6 +85,4 @@ This list may grow over time. * `run` - the output of a command * `command` - the command run * `exit_code` - the exit code of the command -* `recall` - the result of a search - * `query` - the query searched for * `chat` - a message from the user diff --git a/opendevin/server/listen.py b/opendevin/server/listen.py index b43eb785f0..8c1341f893 100644 --- a/opendevin/server/listen.py +++ b/opendevin/server/listen.py @@ -227,10 +227,6 @@ async def websocket_endpoint(websocket: WebSocket): ```json {"action": "browse", "args": {"url": "https://arxiv.org/html/2402.01030v2"}} ``` - - Search long-term memory: - ```json - {"action": "recall", "args": {"query": "past projects"}} - ``` - Add a task to the root_task: ```json {"action": "add_task", "args": {"task": "Implement feature X"}} diff --git a/tests/integration/mock/DelegatorAgent/test_edits/prompt_004.log b/tests/integration/mock/DelegatorAgent/test_edits/prompt_004.log index 33b09c670a..9ed6b4372f 100644 --- a/tests/integration/mock/DelegatorAgent/test_edits/prompt_004.log +++ b/tests/integration/mock/DelegatorAgent/test_edits/prompt_004.log @@ -11,14 +11,14 @@ Fix typos in bad.txt. Do not ask me for confirmation at any point. Here's a summary of the codebase, as it relates to this task: -The codebase contains a single file named 'bad.txt' which has some typos. The content of 'bad.txt' is: +The codebase contains a single file named 'bad.txt' which has some typos. The content of the file is: This is a stupid typoo. Really? No mor typos! Enjoy! -The engineering team needs to correct the typos in this file. +Engineers need to correct the typos in this file. ## Available Actions diff --git a/tests/integration/mock/DelegatorAgent/test_edits/prompt_005.log b/tests/integration/mock/DelegatorAgent/test_edits/prompt_005.log index a182233f5a..96361a1841 100644 --- a/tests/integration/mock/DelegatorAgent/test_edits/prompt_005.log +++ b/tests/integration/mock/DelegatorAgent/test_edits/prompt_005.log @@ -11,14 +11,14 @@ Fix typos in bad.txt. Do not ask me for confirmation at any point. Here's a summary of the codebase, as it relates to this task: -The codebase contains a single file named 'bad.txt' which has some typos. The content of 'bad.txt' is: +The codebase contains a single file named 'bad.txt' which has some typos. The content of the file is: This is a stupid typoo. Really? No mor typos! Enjoy! -The engineering team needs to correct the typos in this file. +Engineers need to correct the typos in this file. ## Available Actions diff --git a/tests/integration/mock/DelegatorAgent/test_edits/prompt_006.log b/tests/integration/mock/DelegatorAgent/test_edits/prompt_006.log index bff8bdd5ba..5074f30f1c 100644 --- a/tests/integration/mock/DelegatorAgent/test_edits/prompt_006.log +++ b/tests/integration/mock/DelegatorAgent/test_edits/prompt_006.log @@ -11,14 +11,14 @@ Fix typos in bad.txt. Do not ask me for confirmation at any point. Here's a summary of the codebase, as it relates to this task: -The codebase contains a single file named 'bad.txt' which has some typos. The content of 'bad.txt' is: +The codebase contains a single file named 'bad.txt' which has some typos. The content of the file is: This is a stupid typoo. Really? No mor typos! Enjoy! -The engineering team needs to correct the typos in this file. +Engineers need to correct the typos in this file. ## Available Actions diff --git a/tests/integration/mock/DelegatorAgent/test_edits/response_003.log b/tests/integration/mock/DelegatorAgent/test_edits/response_003.log index dd5629b6e5..2e200b3674 100644 --- a/tests/integration/mock/DelegatorAgent/test_edits/response_003.log +++ b/tests/integration/mock/DelegatorAgent/test_edits/response_003.log @@ -2,7 +2,7 @@ "action": "finish", "args": { "outputs": { - "summary": "The codebase contains a single file named 'bad.txt' which has some typos. The content of 'bad.txt' is:\n\nThis is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n\nThe engineering team needs to correct the typos in this file." + "summary": "The codebase contains a single file named 'bad.txt' which has some typos. The content of the file is:\n\nThis is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n\nEngineers need to correct the typos in this file." } } } diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_001.log index d992f863f8..e7f3798b35 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_001.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -349,14 +292,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_002.log index 1ae7016724..77061c0efc 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_002.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -368,14 +311,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_003.log index 62ee248ac4..0b52426184 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_003.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -387,14 +330,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_004.log index 03d6ac76fd..47f7e78fd7 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_004.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -395,14 +338,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_005.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_005.log index f66f36ecfe..d17dab1430 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_005.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_005.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -414,14 +357,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_006.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_006.log index 5c64143d92..0d245ff58c 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_006.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_006.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -422,14 +365,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_007.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_007.log index 17efe8a9a2..bbd77b69c0 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_007.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_007.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -441,14 +384,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_008.log b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_008.log index 84723709d2..51665b8a1e 100644 --- a/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_008.log +++ b/tests/integration/mock/MonologueAgent/test_write_simple_script/prompt_008.log @@ -70,64 +70,7 @@ This is your internal monologue, in JSON format: { "action": "message", "args": { - "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Fortunately I have long term memory!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Let's try it out!", - "wait_for_response": false - } - }, - { - "action": "recall", - "args": { - "query": "what it is I want to do", - "thought": "" - } - }, - { - "observation": "recall", - "content": "Here's what I want to do: Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.", - "extras": { - "memories": [], - "role": "assistant" - } - }, - { - "action": "message", - "args": { - "content": "How am I going to get there though?", - "wait_for_response": false - } - }, - { - "action": "message", - "args": { - "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", + "content": "It looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!", "wait_for_response": false } }, @@ -460,14 +403,12 @@ Here are the possible actions: * `owner` - the owner of the repo to push to * `repo` - the name of the repo to push to * `branch` - the name of the branch to push -* `recall` - recalls a past memory. Arguments: - * `query` - the query to search for * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments: * `content` - the message to record * `wait_for_response` - set to `true` to wait for the user to respond before proceeding * `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, browse, and push actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_001.log index eb04f05b8c..cab7b2af58 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_001.log @@ -93,7 +93,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_002.log index 635117e011..43a6379b3d 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_002.log @@ -139,7 +139,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_003.log index 078a2fdd91..10f93f52bf 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_003.log @@ -150,7 +150,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_004.log index aa24c743cb..7ab8c9e2e3 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_004.log @@ -169,7 +169,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_005.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_005.log index cd1c33370c..9644e55042 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_005.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_005.log @@ -177,7 +177,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_006.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_006.log index 055fe30bbf..c48dfa359f 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_006.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_006.log @@ -187,7 +187,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_007.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_007.log index fbb0d94e6b..ee79a05e8c 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_007.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_007.log @@ -206,7 +206,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_008.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_008.log index d42053d4b5..4f3d54d8e3 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_008.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_008.log @@ -214,7 +214,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_009.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_009.log index 755c513664..dbb9c21516 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_009.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_009.log @@ -224,7 +224,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_010.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_010.log index c3211d8b71..14f3733493 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_010.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_010.log @@ -243,7 +243,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_011.log b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_011.log index f576303ee1..c273bd8505 100644 --- a/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_011.log +++ b/tests/integration/mock/PlannerAgent/test_write_simple_script/prompt_011.log @@ -251,7 +251,7 @@ It must be an object, and it must contain two fields: * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. -You MUST take time to think in between read, write, run, browse, and recall actions--do this with the `message` action. +You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action. You should never act twice in a row without thinking. But if your last several actions are all `message` actions, you should consider taking a different action. diff --git a/tests/unit/test_action_serialization.py b/tests/unit/test_action_serialization.py index 969a3212d0..e36e80cbcd 100644 --- a/tests/unit/test_action_serialization.py +++ b/tests/unit/test_action_serialization.py @@ -3,7 +3,6 @@ from opendevin.events.action import ( Action, AddTaskAction, AgentFinishAction, - AgentRecallAction, AgentRejectAction, BrowseInteractiveAction, BrowseURLAction, @@ -70,14 +69,6 @@ def test_message_action_serialization_deserialization(): serialization_deserialization(original_action_dict, MessageAction) -def test_agent_recall_action_serialization_deserialization(): - original_action_dict = { - 'action': 'recall', - 'args': {'query': 'Test query.', 'thought': ''}, - } - serialization_deserialization(original_action_dict, AgentRecallAction) - - def test_agent_finish_action_serialization_deserialization(): original_action_dict = {'action': 'finish', 'args': {'outputs': {}, 'thought': ''}} serialization_deserialization(original_action_dict, AgentFinishAction)