OpenDevin / OpenDevin

🐚 OpenDevin: Code Less, Make More
https://docs.all-hands.dev/
MIT License
29.26k stars 3.38k forks source link

[Bug]: K.indexOf is not a function (AttributeError: 'dict' object has no attribute 'split') #2825

Open Luxcium opened 3 weeks ago

Luxcium commented 3 weeks ago

Is there an existing issue for the same bug?

Describe the bug

In the browser the full window become an error message and it is impossible to restore the session because it would still be the same error message:

Unexpected Application Error!
K.indexOf is not a function
TypeError: K.indexOf is not a function
    at W (https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs/editor/editor.main.js:698:13567)
    at Object.J [as createModel] (https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs/editor/editor.main.js:699:3987)
    at Pwe (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:2883)
    at Es (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:2780)
    at http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:6297
    at gf (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:24283)
    at Cs (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:42409)
    at gK (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:41231)
    at Va (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:40278)
    at qw (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:36886)

Then this is happening often with many different error message in the log (terminal running the docker) this time it is again mentioning that the 'dict' object has no attribute 'split'

Current OpenDevin version

ghcr.io/opendevin/opendevin:0.7

Installation and Configuration

luxcium@corsair-one:/src/OpenDevin$ WORKSPACE_BASE=$(pwd)/workspace
luxcium@corsair-one:/src/OpenDevin$ !! docker run -it     --pull=always     -e SANDBOX_USER_ID=$(id -u)     -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE     -v $WORKSPACE_BASE:/opt/workspace_base     -v /var
/run/docker.sock:/var/run/docker.sock     -p 3000:3000     --add-host host.docker.internal:host-gateway     --name opendevin-app-$(date +%Y%m%d%H%M%S)     ghcr.io/opendevin/opendevin:0.7
WORKSPACE_BASE=$(pwd)/workspace docker run -it     --pull=always     -e SANDBOX_USER_ID=$(id -u)     -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE     -v $WORKSPACE_BASE:/opt/workspace_base     -v /var/run/docker.sock:/var/run/docker.sock     -p 3000:3000     --add-host host.docker.internal:host-gateway     --name opendevin-app-$(date +%Y%m%d%H%M%S)     ghcr.io/opendevin/opendevin:0.7

Model and Agent

CoderAgent using LLM claude-3-5-sonnet-20240620

Operating System

Fedora Linux KDE Plasma Shell: 6.9.5-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jun 16 15:47:09 UTC 2024 x86_64 GNU/Linux

Reproduction Steps

Everything was lost but the requests where from me on an empty workspace:

Hello I would like to define a strict set of rules for our future interactions and I would like to document everything that we will be doing in a formal and codified set of imperative rules to follow I will also want to create the files that would be in the project to demonstrate the strict set of rules in action... I would like to explain you few rules at a time so you will need to reorganize the codification accordingly as we are moving along... my typescript projects must always have a src folder in which we will have one index.ts (for now export {}) and one main.ts file (for not place there a min function with an hello world and invoque it below the declaration) if you are ok with that we will discover one (or few) of my rules at at time and it is very important to keep track of all that in a very well organized manner as to be easy for other instance of your AI Agency to be able to quickly understand my imperatives rules and other things that please do those steps and ten I will give you the next set of instructions that I want to be codified in the formal procedure and guideline for other Open Devin AI Agents and other similar agents... please use best practices and modern well known nodejs and typescript practices for resilient, robust and professional code

and then:

ok this is perfect, you will manage the codification as we go further it will be easier to manage but as we begin it may need to be reorganized and we do not need to worry about the changes that would occur since it is not the final form it may be adapted and the numbering system may be changed until we have something that will have everything we can expect...

normally we would initialize the different things that are in thee project but it may or may not have nodejs in the ambiant environnement we do not need to worry but now we will need to have all the usual files in the root of the project (the license can be mit and the read me can be a quick intro the copyright older can be myself Benjamin Vincent (Luxcium) we will not need to generate the config files for those: editorconfig eslintignore eslintrc gitignore jest LICENSE package.json prettierignore prettierrc README tsconfig for now we will assume the basic stuff and we will later review the formal requirements and the optional ones and those that can be variable and all that stuff for now include in the root each of the most common configurations for each that I named and the files extensions (when required) and the '.' upfront the filenames as you know... include the most common configuration and information (assume that the preferred package manager is pnpm to document each place that can benefit from it) becareful to not include dummy text or invalid placeholders as any place holders must be valid and meaningful and any other settings must be best practices and the codified project rules shall include the section for each as we will later probably define stricter rules or maybe not... I will review the configurations and will then change them or ask you to make modifications but it should be fully working and functional already out of the box (maybe no tooling and instrumentation are available but it does not matter you can write the content of each all by yourself you should already know how to do that based on your intrinsic knowledge or data set used during training) you can start now and keep the project rules up to date as you complete each tasks one after the other...

Full log of the session until the problem Status: Downloaded newer image for ghcr.io/opendevin/opendevin:0.7 Starting OpenDevin... Setting up enduser with id 1000 Docker socket group id: 978 Creating group with id 978 Running as enduser /app/.venv/lib/python3.12/site-packages/llama_cloud/types/metadata_filter.py:20: SyntaxWarning: invalid escape sequence '\*' """ INFO: Started server process [42] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit) INFO: 172.17.0.1:37368 - "GET /assets/index-CFxkkK5d.css HTTP/1.1" 404 Not Found INFO: 172.17.0.1:37368 - "GET /locales/en/translation.json HTTP/1.1" 200 OK INFO: 172.17.0.1:37368 - "GET /api/options/models HTTP/1.1" 200 OK INFO: 172.17.0.1:37368 - "GET /api/options/agents HTTP/1.1" 200 OK INFO: ('172.17.0.1', 52222) - "WebSocket /ws" [accepted] INFO: connection open 11:44:13 - opendevin:INFO: agent.py:64 - Using server runtime 11:44:13 - opendevin:INFO: ssh_box.py:215 - SSHBox is running as opendevin user with USER_ID=1000 in the sandbox 11:44:13 - opendevin:INFO: ssh_box.py:260 - Detected initial session. 11:44:13 - opendevin:INFO: ssh_box.py:262 - Creating new Docker container 11:44:13 - opendevin:WARNING: ssh_box.py:722 - Using port forwarding till the enable host network mode of Docker is out of experimental mode.Check the 897th issue on https://github.com/OpenDevin/OpenDevin/issues/ for more information. 11:44:13 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:44:13 - opendevin:INFO: ssh_box.py:730 - Mounting volumes: {'/src/OpenDevin/workspace': {'bind': '/workspace', 'mode': 'rw'}, '/tmp/cache': {'bind': '/home/opendevin/.cache', 'mode': 'rw'}} 11:44:13 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:44:13 - opendevin:INFO: ssh_box.py:741 - Container started 11:44:14 - opendevin:INFO: ssh_box.py:757 - waiting for container to start: 1, container status: running 11:44:14 - opendevin:INFO: ssh_box.py:426 - Connecting to SSH session... 11:44:14 - opendevin:INFO: ssh_box.py:428 - You can debug the SSH connection by running: `ssh -v -p 58531 opendevin@host.docker.internal` using the password '1b18fcad-816f-46c4-ac36-19082b97acd1' 11:44:15 - opendevin:INFO: ssh_box.py:432 - Connected to SSH session 11:44:16 - opendevin:INFO: agent.py:95 - Creating agent CoderAgent using LLM claude-3-haiku-20240307 11:44:16 - opendevin:INFO: llm.py:123 - Initializing LLM with model: claude-3-haiku-20240307 11:44:16 - opendevin:INFO: mixin.py:43 - Initializing plugins in the sandbox 11:44:16 - opendevin:ERROR: state.py:75 - Failed to restore state from session: sessions/e1d848a8-4d3d-42c6-925e-a0fccf3c3dd8/agent_state.pkl Error restoring state sessions/e1d848a8-4d3d-42c6-925e-a0fccf3c3dd8/agent_state.pkl 11:44:16 - opendevin:INFO: agent_controller.py:133 - [Agent Controller e1d848a8-4d3d-42c6-925e-a0fccf3c3dd8] Starting step loop... INFO: 172.17.0.1:52232 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK INFO: 172.17.0.1:52232 - "GET /apple-touch-icon.png HTTP/1.1" 200 OK INFO: 172.17.0.1:52232 - "GET / HTTP/1.1" 200 OK 11:44:18 - opendevin:INFO: session.py:58 - WebSocket disconnected, sid: e1d848a8-4d3d-42c6-925e-a0fccf3c3dd8 11:44:18 - opendevin:INFO: agent_controller.py:138 - AgentController task was cancelled INFO: connection closed INFO: 172.17.0.1:52232 - "GET /assets/index-D7Efrf-x.js HTTP/1.1" 200 OK INFO: 172.17.0.1:52238 - "GET /assets/index-BAtRrv_U.css HTTP/1.1" 200 OK INFO: 172.17.0.1:52254 - "GET /api/options/models HTTP/1.1" 200 OK INFO: 172.17.0.1:52254 - "GET /favicon-32x32.png HTTP/1.1" 200 OK INFO: 172.17.0.1:52254 - "GET /api/options/agents HTTP/1.1" 200 OK INFO: ('172.17.0.1', 52260) - "WebSocket /ws" [accepted] INFO: connection open 11:44:20 - opendevin:INFO: agent.py:64 - Using server runtime 11:44:20 - opendevin:INFO: ssh_box.py:215 - SSHBox is running as opendevin user with USER_ID=1000 in the sandbox 11:44:20 - opendevin:INFO: ssh_box.py:260 - Detected initial session. 11:44:20 - opendevin:INFO: ssh_box.py:262 - Creating new Docker container 11:44:20 - opendevin:WARNING: ssh_box.py:722 - Using port forwarding till the enable host network mode of Docker is out of experimental mode.Check the 897th issue on https://github.com/OpenDevin/OpenDevin/issues/ for more information. 11:44:20 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:44:20 - opendevin:INFO: ssh_box.py:730 - Mounting volumes: {'/src/OpenDevin/workspace': {'bind': '/workspace', 'mode': 'rw'}, '/tmp/cache': {'bind': '/home/opendevin/.cache', 'mode': 'rw'}} 11:44:20 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:44:20 - opendevin:INFO: ssh_box.py:741 - Container started 11:44:21 - opendevin:INFO: ssh_box.py:757 - waiting for container to start: 1, container status: running 11:44:22 - opendevin:INFO: ssh_box.py:426 - Connecting to SSH session... 11:44:22 - opendevin:INFO: ssh_box.py:428 - You can debug the SSH connection by running: `ssh -v -p 56135 opendevin@host.docker.internal` using the password '524e825f-efd4-47bb-bce4-5afdab578391' 11:44:23 - opendevin:INFO: ssh_box.py:432 - Connected to SSH session 11:44:24 - opendevin:INFO: agent.py:95 - Creating agent CoderAgent using LLM claude-3-haiku-20240307 11:44:24 - opendevin:INFO: llm.py:123 - Initializing LLM with model: claude-3-haiku-20240307 11:44:24 - opendevin:INFO: mixin.py:43 - Initializing plugins in the sandbox 11:44:24 - opendevin:ERROR: state.py:75 - Failed to restore state from session: sessions/4f04769f-40e9-413f-ac54-1c226af5085c/agent_state.pkl Error restoring state sessions/4f04769f-40e9-413f-ac54-1c226af5085c/agent_state.pkl 11:44:24 - opendevin:INFO: agent_controller.py:133 - [Agent Controller 4f04769f-40e9-413f-ac54-1c226af5085c] Starting step loop... INFO: 172.17.0.1:54326 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK 11:46:14 - opendevin:INFO: session.py:58 - WebSocket disconnected, sid: 4f04769f-40e9-413f-ac54-1c226af5085c INFO: connection closed 11:46:14 - opendevin:INFO: agent_controller.py:138 - AgentController task was cancelled INFO: ('172.17.0.1', 53384) - "WebSocket /ws" [accepted] INFO: connection open 11:46:14 - opendevin:INFO: agent.py:64 - Using server runtime 11:46:14 - opendevin:INFO: ssh_box.py:215 - SSHBox is running as opendevin user with USER_ID=1000 in the sandbox 11:46:14 - opendevin:INFO: ssh_box.py:260 - Detected initial session. 11:46:14 - opendevin:INFO: ssh_box.py:262 - Creating new Docker container 11:46:14 - opendevin:WARNING: ssh_box.py:722 - Using port forwarding till the enable host network mode of Docker is out of experimental mode.Check the 897th issue on https://github.com/OpenDevin/OpenDevin/issues/ for more information. 11:46:14 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:46:14 - opendevin:INFO: ssh_box.py:730 - Mounting volumes: {'/src/OpenDevin/workspace': {'bind': '/workspace', 'mode': 'rw'}, '/tmp/cache': {'bind': '/home/opendevin/.cache', 'mode': 'rw'}} 11:46:14 - opendevin:INFO: ssh_box.py:695 - Mounting workspace directory: /src/OpenDevin/workspace 11:46:14 - opendevin:INFO: ssh_box.py:741 - Container started 11:46:15 - opendevin:INFO: ssh_box.py:757 - waiting for container to start: 1, container status: running 11:46:16 - opendevin:INFO: ssh_box.py:426 - Connecting to SSH session... 11:46:16 - opendevin:INFO: ssh_box.py:428 - You can debug the SSH connection by running: `ssh -v -p 33791 opendevin@host.docker.internal` using the password 'a69e8196-fb69-427a-aa67-974bff9c4fed' 11:46:17 - opendevin:INFO: ssh_box.py:432 - Connected to SSH session 11:46:18 - opendevin:INFO: agent.py:95 - Creating agent CoderAgent using LLM claude-3-5-sonnet-20240620 11:46:18 - opendevin:INFO: llm.py:123 - Initializing LLM with model: claude-3-5-sonnet-20240620 11:46:18 - opendevin:INFO: mixin.py:43 - Initializing plugins in the sandbox 11:46:18 - opendevin:ERROR: state.py:75 - Failed to restore state from session: sessions/4028f0b3-8cf8-4519-8298-a3ebcb75fe5f/agent_state.pkl Error restoring state sessions/4028f0b3-8cf8-4519-8298-a3ebcb75fe5f/agent_state.pkl 11:46:18 - opendevin:INFO: agent_controller.py:133 - [Agent Controller 4028f0b3-8cf8-4519-8298-a3ebcb75fe5f] Starting step loop... INFO: 172.17.0.1:53386 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK 11:53:01 - OBSERVATION **MessageAction** (source=EventSource.USER) CONTENT: Hello I would like to define a strict set of rules for our future interactions and I would like to document everything that we will be doing in a formal and codified set of imperative rules to follow I will also want to create the files that would be in the project to demonstrate the strict set of rules in action... I would like to explain you few rules at a time so you will need to reorganize the codification accordingly as we are moving along... my typescript projects must always have a src folder in which we will have one index.ts (for now export {}) and one main.ts file (for not place there a min function with an hello world and invoque it below the declaration) if you are ok with that we will discover one (or few) of my rules at at time and it is very important to keep track of all that in a very well organized manner as to be easy for other instance of your AI Agency to be able to quickly understand my imperatives rules and other things that please do those steps and ten I will give you the next set of instructions that I want to be codified in the formal procedure and guideline for other Open Devin AI Agents and other similar agents... please use best practices and modern well known nodejs and typescript practices for resilient, robust and professional code INFO: 172.17.0.1:51304 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK ============== CoderAgent LEVEL 0 STEP 0 11:53:05 - opendevin:INFO: llm.py:245 - Cost: 0.00 USD | Accumulated Cost: 0.00 USD 11:53:05 - ACTION **MessageAction** (source=None) CONTENT: Understood. I'll start by creating the basic project structure with the src folder, index.ts, and main.ts files as per your instructions. Then I'll document the rules we've established so far. Here's what I'm going to do: 1. Create the src folder 2. Create index.ts with export {} 3. Create main.ts with a hello world function 4. Document the rules we've established After that, I'll wait for your next set of instructions. ============== CoderAgent LEVEL 0 STEP 1 11:53:06 - opendevin:INFO: llm.py:245 - Cost: 0.00 USD | Accumulated Cost: 0.01 USD 11:53:06 - ACTION FileWriteAction(path='src/index.ts', content='export {}', start=0, end=-1, thought='', action='write') 11:53:06 - OBSERVATION FileWriteObservation(content='', path='src/index.ts', observation='write') ============== CoderAgent LEVEL 0 STEP 2 11:53:08 - opendevin:INFO: llm.py:245 - Cost: 0.00 USD | Accumulated Cost: 0.01 USD 11:53:08 - ACTION FileWriteAction(path='src/main.ts', content="function main() {\n console.log('Hello, world!');\n}\n\nmain();", start=0, end=-1, thought='', action='write') 11:53:08 - OBSERVATION FileWriteObservation(content='', path='src/main.ts', observation='write') ============== CoderAgent LEVEL 0 STEP 3 11:53:13 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.02 USD 11:53:13 - ACTION FileWriteAction(path='project_rules.md', content="# Project Rules and Guidelines\n\n## 1. Project Structure\n\n1.1. The project must have a `src` folder.\n1.2. Inside the `src` folder, there must be two files:\n - `index.ts`\n - `main.ts`\n\n## 2. File Contents\n\n2.1. `src/index.ts`:\n - Must contain the line `export {}`\n\n2.2. `src/main.ts`:\n - Must contain a `main` function\n - The `main` function should include a 'Hello, world!' console log\n - The `main` function must be invoked after its declaration\n\n## 3. Coding Standards\n\n3.1. Use best practices and modern, well-known Node.js and TypeScript practices\n3.2. Write resilient, robust, and professional code\n\n## 4. Documentation\n\n4.1. Maintain this document with all project rules and guidelines\n4.2. Update the document as new rules are introduced\n4.3. Organize the document in a clear, easy-to-understand manner for other AI agents", start=0, end=-1, thought='', action='write') 11:53:13 - OBSERVATION FileWriteObservation(content='', path='project_rules.md', observation='write') ============== CoderAgent LEVEL 0 STEP 4 11:53:15 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.03 USD 11:53:15 - ACTION **MessageAction** (source=None) CONTENT: I have completed the initial setup as per your instructions. I've created the src folder with index.ts and main.ts files, and documented the current rules in project_rules.md. Is there anything else you'd like me to add or modify in the project structure or rules? 11:53:15 - ACTION **MessageAction** (source=EventSource.AGENT) CONTENT: I have completed the initial setup as per your instructions. I've created the src folder with index.ts and main.ts files, and documented the current rules in project_rules.md. Is there anything else you'd like me to add or modify in the project structure or rules? INFO: 172.17.0.1:46626 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK INFO: 172.17.0.1:52130 - "GET /api/list-files?path=%2Fsrc%2F HTTP/1.1" 200 OK 11:58:55 - opendevin:INFO: manager.py:61 - Session e1d848a8-4d3d-42c6-925e-a0fccf3c3dd8 and related resource have been removed due to inactivity. 11:58:55 - opendevin:INFO: manager.py:61 - Session 4f04769f-40e9-413f-ac54-1c226af5085c and related resource have been removed due to inactivity. 12:10:14 - OBSERVATION **MessageAction** (source=EventSource.USER) CONTENT: ok this is perfect, you will manage the codification as we go further it will be easier to manage but as we begin it may need to be reorganized and we do not need to worry about the changes that would occur since it is not the final form it may be adapted and the numbering system may be changed until we have something that will have everything we can expect... normally we would initialize the different things that are in thee project but it may or may not have nodejs in the ambiant environnement we do not need to worry but now we will need to have all the usual files in the root of the project (the license can be mit and the read me can be a quick intro the copyright older can be myself Benjamin Vincent (Luxcium) we will not need to generate the config files for those: editorconfig eslintignore eslintrc gitignore jest LICENSE package.json prettierignore prettierrc README tsconfig for now we will assume the basic stuff and we will later review the formal requirements and the optional ones and those that can be variable and all that stuff for now include in the root each of the most common configurations for each that I named and the files extensions (when required) and the '.' upfront the filenames as you know... include the most common configuration and information (assume that the preferred package manager is pnpm to document each place that can benefit from it) becareful to not include dummy text or invalid placeholders as any place holders must be valid and meaningful and any other settings must be best practices and the codified project rules shall include the section for each as we will later probably define stricter rules or maybe not... I will review the configurations and will then change them or ask you to make modifications but it should be fully working and functional already out of the box (maybe no tooling and instrumentation are available but it does not matter you can write the content of each all by yourself you should already know how to do that based on your intrinsic knowledge or data set used during training) you can start now and keep the project rules up to date as you complete each tasks one after the other... INFO: 172.17.0.1:36122 - "GET /api/list-files?path=%2F HTTP/1.1" 200 OK INFO: 172.17.0.1:36122 - "GET /api/list-files?path=%2Fsrc%2F HTTP/1.1" 200 OK ============== CoderAgent LEVEL 0 STEP 5 12:10:17 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.04 USD 12:10:17 - ACTION FileWriteAction(path='.editorconfig', content='# EditorConfig is awesome: https://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false', start=0, end=-1, thought='', action='write') 12:10:17 - OBSERVATION FileWriteObservation(content='', path='.editorconfig', observation='write') ============== CoderAgent LEVEL 0 STEP 6 12:10:19 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.04 USD 12:10:19 - ACTION FileWriteAction(path='.eslintignore', content='node_modules\ndist\ncoverage', start=0, end=-1, thought='', action='write') 12:10:19 - OBSERVATION FileWriteObservation(content='', path='.eslintignore', observation='write') ============== CoderAgent LEVEL 0 STEP 7 12:10:22 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.05 USD 12:10:22 - ACTION FileWriteAction(path='.eslintrc.json', content='{\n "root": true,\n "parser": "@typescript-eslint/parser",\n "plugins": ["@typescript-eslint"],\n "extends": [\n "eslint:recommended",\n "plugin:@typescript-eslint/recommended",\n "prettier"\n ],\n "env": {\n "node": true,\n "es6": true\n },\n "rules": {\n "@typescript-eslint/explicit-module-boundary-types": "off",\n "@typescript-eslint/no-explicit-any": "warn"\n }\n}', start=0, end=-1, thought='', action='write') 12:10:23 - OBSERVATION FileWriteObservation(content='', path='.eslintrc.json', observation='write') ============== CoderAgent LEVEL 0 STEP 8 12:10:26 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.06 USD 12:10:26 - ACTION FileWriteAction(path='.gitignore', content='# Dependency directories\nnode_modules/\n\n# Build output\ndist/\n\n# Coverage directory\ncoverage/\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\n\n# Environment variables\n.env\n.env.local\n.env.*.local\n\n# Editor directories and files\n.vscode/\n.idea/\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# OS generated files\n.DS_Store\nThumbs.db', start=0, end=-1, thought='', action='write') 12:10:26 - OBSERVATION FileWriteObservation(content='', path='.gitignore', observation='write') ============== CoderAgent LEVEL 0 STEP 9 12:10:29 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.07 USD 12:10:29 - ACTION FileWriteAction(path='jest.config.js', content="module.exports = {\n preset: 'ts-jest',\n testEnvironment: 'node',\n roots: ['/src'],\n testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],\n transform: {\n '^.+\\.ts$': 'ts-jest',\n },\n coverageDirectory: 'coverage',\n collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],\n};", start=0, end=-1, thought='', action='write') 12:10:29 - OBSERVATION FileWriteObservation(content='', path='jest.config.js', observation='write') ============== CoderAgent LEVEL 0 STEP 10 12:10:33 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.09 USD 12:10:33 - ACTION FileWriteAction(path='LICENSE', content='MIT License\n\nCopyright (c) 2023 Benjamin Vincent (Luxcium)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.', start=0, end=-1, thought='', action='write') 12:10:33 - OBSERVATION FileWriteObservation(content='', path='LICENSE', observation='write') ============== CoderAgent LEVEL 0 STEP 11 12:10:39 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.10 USD 12:10:39 - ACTION FileWriteAction(path='package.json', content={'name': 'project-name', 'version': '1.0.0', 'description': 'A brief description of the project', 'main': 'dist/index.js', 'scripts': {'start': 'node dist/index.js', 'build': 'tsc', 'dev': 'ts-node src/index.ts', 'test': 'jest', 'lint': 'eslint . --ext .ts', 'format': 'prettier --write "src/**/*.ts"'}, 'author': 'Benjamin Vincent (Luxcium)', 'license': 'MIT', 'dependencies': {}, 'devDependencies': {'@types/jest': '^27.0.0', '@types/node': '^16.0.0', '@typescript-eslint/eslint-plugin': '^5.0.0', '@typescript-eslint/parser': '^5.0.0', 'eslint': '^8.0.0', 'eslint-config-prettier': '^8.0.0', 'jest': '^27.0.0', 'prettier': '^2.0.0', 'ts-jest': '^27.0.0', 'ts-node': '^10.0.0', 'typescript': '^4.0.0'}, 'engines': {'node': '>=14.0.0'}}, start=0, end=-1, thought='', action='write') ERROR:asyncio:Task exception was never retrieved future: exception=AttributeError("'dict' object has no attribute 'split'")> Traceback (most recent call last): File "/app/opendevin/runtime/runtime.py", line 111, in on_event observation = await self.run_action(event) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/opendevin/runtime/runtime.py", line 131, in run_action observation = await getattr(self, action_type)(action) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/opendevin/runtime/server/runtime.py", line 117, in write return await write_file( ^^^^^^^^^^^^^^^^^ File "/app/opendevin/runtime/server/files.py", line 90, in write_file insert = content.split('\n') ^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'split'

Logs, Errors, Screenshots, and Additional Context

This time only the last step was having an error I do not believe that eh informations below contain sensitive information about my project so I included the full step and the associated error because I am not sure the reason I can not give more specific error message:

==============
CoderAgent LEVEL 0 STEP 11

12:10:39 - opendevin:INFO: llm.py:245 - Cost: 0.01 USD | Accumulated Cost: 0.10 USD
12:10:39 - ACTION
FileWriteAction(path='package.json', content={'name': 'project-name', 'version': '1.0.0', 'description': 'A brief description of the project', 'main': 'dist/index.js', 'scripts': {'start': 'node dist/index.js', 'build': 'tsc', 'dev': 'ts-node src/index.ts', 'test': 'jest', 'lint': 'eslint . --ext .ts', 'format': 'prettier --write "src/**/*.ts"'}, 'author': 'Benjamin Vincent (Luxcium)', 'license': 'MIT', 'dependencies': {}, 'devDependencies': {'@types/jest': '^27.0.0', '@types/node': '^16.0.0', '@typescript-eslint/eslint-plugin': '^5.0.0', '@typescript-eslint/parser': '^5.0.0', 'eslint': '^8.0.0', 'eslint-config-prettier': '^8.0.0', 'jest': '^27.0.0', 'prettier': '^2.0.0', 'ts-jest': '^27.0.0', 'ts-node': '^10.0.0', 'typescript': '^4.0.0'}, 'engines': {'node': '>=14.0.0'}}, start=0, end=-1, thought='', action='write')
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-247' coro=<Runtime.on_event() done, defined at /app/opendevin/runtime/runtime.py:109> exception=AttributeError("'dict' object has no attribute 'split'")>
Traceback (most recent call last):
  File "/app/opendevin/runtime/runtime.py", line 111, in on_event
    observation = await self.run_action(event)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/runtime/runtime.py", line 131, in run_action
    observation = await getattr(self, action_type)(action)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/runtime/server/runtime.py", line 117, in write
    return await write_file(
           ^^^^^^^^^^^^^^^^^
  File "/app/opendevin/runtime/server/files.py", line 90, in write_file
    insert = content.split('\n')
             ^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'split'
Luxcium commented 3 weeks ago

I asked to chatgpt but I know that people often do not like when we use AI Assistants to help with code 😏 so yeah I have no idea if this is relevant to anything at all:

The issue in the code located at OpenDevin/opendevin/runtime/server/files.py is that the content variable is being split using the split('\n') method, which expects content to be a string. If content is a dictionary, this will cause the AttributeError.

Suggested Fix:

Ensure that content is a string before calling split. You can modify the code as follows:

if isinstance(content, dict):
    content = json.dumps(content)  # Convert dictionary to a JSON string
insert = content.split('\n')

This change ensures that content is always a string, thus avoiding the error when split is called.

ChatGPT can make mistakes. Check important info.

Luxcium commented 3 weeks ago

Similarly to my previous comment I am unsure if it is relevant to copy the output of the AI Assistant without reviewing it but you can decide if it is meaningful or not again I understand that letting an AI Agent delving into the realms of tapestries is something that many people can think is the wrong approach (in any case I did not review any of this and I only did the script kiddo copy + past magic trick) :

The issue in the code located at OpenDevin/frontend/src/components/AgentStatusBar.tsx is that the K variable is being used with the indexOf function, which expects K to be a string. If K is not a string, this will cause the TypeError.

Suggested Fix:

Ensure K is a string before calling indexOf. You can modify the code as follows:

if (typeof K !== 'string') {
    K = String(K);
}
const status = K.indexOf('desiredSubstring') !== -1 ? 'active' : 'inactive';

This will convert K to a string if it is not already, thus avoiding the error.

Context:

This change ensures that K is always treated as a string, preventing the indexOf method from causing errors when K is of another type. This is a common issue when dealing with dynamic data types in JavaScript.

ChatGPT can make mistakes. Check important info.

Luxcium commented 3 weeks ago

My previous comment was a mistake and I realize that it is clearly stated where is the problem (it is not something clear to me what is the cause so I will leave it to other to investigate):

Unexpected Application Error!
K.indexOf is not a function
TypeError: K.indexOf is not a function
    at W (https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs/editor/editor.main.js:698:13567)
    at Object.J [as createModel] (https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs/editor/editor.main.js:699:3987)
    at Pwe (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:2883)
    at Es (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:2780)
    at http://0.0.0.0:3000/assets/index-D7Efrf-x.js:311:6297
    at gf (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:24283)
    at Cs (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:42409)
    at gK (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:41231)
    at Va (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:40278)
    at qw (http://0.0.0.0:3000/assets/index-D7Efrf-x.js:40:36886)
Luxcium commented 3 weeks ago

as for a work around I did hit refresh and the error message was still on the screen (local web app) but the actual problem in the console of the terminal where I launched the docker did disappeared and it did the next steps (this seems like it is specific to my issue or it may be useful to others too)... after letting the process complete in the terminal I did refresh again and got a session continuation with no error message on the screen...

tobitege commented 3 weeks ago

Please switch your agent in the settings to CodeActAgent and see if that works better. The Monaco messages are coming from the editor on the right tab. I haven't seen those messages myself yet, but it looks like it is having an error in one of its own JavaScript assets. Please try CTRL+F5 or any other key appropriate for your browser to clear the cache (not when you're right in a task, of course).

Luxcium commented 3 weeks ago

CodeActAgent

But I am doing a typescript project (I am unsure the notebook is apparently full of useless stuff maybe) Edit: and it is very very expansive

SmartManoj commented 2 days ago

FileWriteAction(path='package.json', content={'name': 'project-name', 'version': '1.0.0', 'description': 'A brief description of the project', 'main': 'dist/index.js', 'scripts': {'start': 'node dist/index.js', 'build': 'tsc', 'dev': 'ts-node src/index.ts', 'test': 'jest', 'lint': 'eslint . --ext .ts', 'format': 'prettier --write "src/*/.ts"'}, 'author': 'Benjamin Vincent (Luxcium)', 'license': 'MIT', 'dependencies': {}, 'devDependencies': {'@types/jest': '^27.0.0', '@types/node': '^16.0.0', '@typescript-eslint/eslint-plugin': '^5.0.0', '@typescript-eslint/parser': '^5.0.0', 'eslint': '^8.0.0', 'eslint-config-prettier': '^8.0.0', 'jest': '^27.0.0', 'prettier': '^2.0.0', 'ts-jest': '^27.0.0', 'ts-node': '^10.0.0', 'typescript': '^4.0.0'}, 'engines': {'node': '>=14.0.0'}}, start=0, end=-1, thought='', action='write')

content should be a string.

image

Could you check the latest version?