gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[Bug]: AttributeError: 'NoneType' object has no attribute 'steps'

Open niklasfink opened this issue 9 months ago • 4 comments

Version

VisualStudio Code extension

Operating System

MacOS

What happened?

Pythagora abruptly stopped with the following error:

Stopping Pythagora due to error:

File `core/cli/main.py`, line 38, in run_project
    success = await orca.run()
File `core/agents/orchestrator.py`, line 64, in run
    response = await agent.run()
File `core/agents/developer.py`, line 87, in run
    return await self.breakdown_current_iteration()
File `core/agents/developer.py`, line 153, in breakdown_current_iteration
    self.set_next_steps(response, source)
File `core/agents/developer.py`, line 241, in set_next_steps
    for step in response.steps
AttributeError: 'NoneType' object has no attribute 'steps'

Using Pythagora v0.2.0 / GPT Pilot v0.2.1. There was no error from the LLM API.

Just before that, the Developer Agent was returning (I escaped with \ ):

Breaking down the current task iteration ...

Figuring out which project files are relevant for the next task ...

\```json
{
  "relevant_files": [
    "views/customers.ejs",
    "public/js/customers.js",
    "models/Customer.js",
    "routes/customerRoutes.js",
    "views/partials/_header.ejs",
    "views/partials/_footer.ejs",
    "views/partials/_head.ejs"
  ]
}
\```

\```json
{
  "steps": [
    {
      "type": "command",
      "command": {
        "command": "npm install dotenv",
        "timeout": 60,
        "success_message": "dotenv package installed successfully."
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "server.js",
        "content": "require('dotenv').config();\n" + require('fs').readFileSync('server.js', 'utf8')
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "package.json",
        "content": JSON.stringify({
          ...require('./package.json'),
          scripts: {
            ...require('./package.json').scripts,
            start: "nodemon server.js"
          }
        }, null, 2)
      }
    },
    {
      "type": "command",
      "command": {
        "command": "npm start",
        "timeout": 60,
        "success_message": "Application started successfully using npm start."
      }
    }
  ]
}
\```

\```json
{
  "steps": [
    {
      "type": "command",
      "command": {
        "command": "npm install dotenv",
        "timeout": 60,
        "success_message": "dotenv package installed successfully."
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "server.js",
        "content": "require('dotenv').config();\n" + require('fs').readFileSync('server.js', 'utf8')
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "package.json",
        "content": JSON.stringify({
          ...require('./package.json'),
          scripts: {
            ...require('./package.json').scripts,
            start: "nodemon server.js"
          }
        }, null, 2)
      }
    },
    {
      "type": "command",
      "command": {
        "command": "npm start",
        "timeout": 60,
        "success_message": "Application started successfully using npm start."
      }
    }
  ]
}
\```

\```json
{
  "steps": [
    {
      "type": "command",
      "command": {
        "command": "npm install dotenv",
        "timeout": 60,
        "success_message": "dotenv package installed successfully."
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "server.js",
        "content": "require('dotenv').config();\n" + require('fs').readFileSync('server.js', 'utf8')
      }
    },
    {
      "type": "save_file",
      "save_file": {
        "path": "package.json",
        "content": "{\n  \"name\": \"tt0\",\n  \"version\": \"1.0.0\",\n  \"main\": \"server.js\",\n  \"scripts\": {\n    \"start\": \"nodemon server.js\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.17.1\",\n    \"mongoose\": \"^5.10.9\",\n    \"bcrypt\": \"^5.0.0\",\n    \"express-session\": \"^1.17.1\",\n    \"ejs\": \"^3.1.5\",\n    \"bootstrap\": \"^5.3.2\",\n    \"nodemailer\": \"^6.4.11\",\n    \"pdfkit\": \"^0.11.0\",\n    \"dotenv\": \"^8.2.0\"\n  }\n}"
      }
    },
    {
      "type": "command",
      "command": {
        "command": "npm start",
        "timeout": 60,
        "success_message": "Application started successfully using npm start."
      }
    }
  ]
}
\```

niklasfink avatar Jun 04 '24 16:06 niklasfink