Troubleshoot a production-only performance issue
Cursor and AI Agent Development. Task: Cursor and AI Agent Development I have been using Cursor’s AI agents off and on for a while now but December was the first time I really applied them in some recent projects. AI coding agents are shockingly good at trouble shooting issues and feature development. This might not be a shock to those who have been using these tools for a while, but this was my first experience really using them. Over the past month, there were three situations in which Cursor’s (and Warp’s) agent significantly aided in my development tasks. Running into a performance issue in a production system, but the dev environment had no such issue. I asked the agent to generate a list of possible causes of this performance issue and steps that could be taken to rectify it. The AI did this rather well. It was able to understand the database queries that NestJS was making to the database and what database indexes should be utilized. After adding in the database indexes, the performance of the page load significantly improved. I was rather impressed with the solutions that the AI provided and how it directly applied to the codebase that I was working in. Running into a performance issue in a production system, but the dev environment had no such issue. I asked the agent to generate a list of possible causes of this performance issue and steps that could be taken to rectify it. The AI did this rather well. It was able to understand the database queries that NestJS was making to the database and what database indexes should be utilized. After adding in the database indexes, the performance of the page load significantly improved. I was rather impressed with the solutions that the AI provided and how it directly applied to the codebase that I was working in. Adding a new feature to a Flutter android app, as someone with no mobile app development experience. This was exactly what I like AI for. I can have years of software development experience, but no Flutter experience, so I know what I want the app to do and how to ask the AI for that functionality. This did take a little back and forth with the agent as well as manually code changes, but overall I enjoyed the collaborative approach with the agent. For this I actually used both Cursor’s agent mode as well as Warp. Adding a new feature to a Flutter android app, as someone with no mobile app development experience. This was exactly what I like AI for. I can have years of software development experience, but no Flutter experience, so I know what I want the app to do and how to ask the AI for that functionality. This did take a little back and forth with the agent as well as manually code changes, but overall I enjoyed the collaborative approach with the agent. For this I actually used both Cursor’s agent mode as well as Warp. Writing unit tests for a python api. Been doing python development for a while now, but unit tests have never been something that I invested the time to learn. The api already had a suite of tests, so I thought it might be worth having the agent take a crack at it. This task actually had mixed results. It came up with a good set of tests, however, the way they were mocked led to several errors. I prompted a few times to have the AI fix the tests, but never actually worked. I had to step through the code and better understand what was happening in order to manually make the code changes that fixed the tests. The issue ended up being the service mock return value was not being mocked correctly. Writing unit tests for a python api. Been doing python development for a while now, but unit tests have never been something that I invested the time to learn. The api already had a suite of tests, so I thought it might be worth having the agent take a crack at it. This task actually had mixed results. It came up with a good set of tests, however, the way they were mocked led to several errors. I prompted a few times to have the AI fix the tests, but never actually worked. I had to step through the code and better understand what was happening in order to manually make the code changes that fixed the tests. The issue ended up being the service mock return value was not being mocked correctly.; tools: Cursor. Human role: The original post does not say how a person stayed involved.; limitations: AI agents may produce incorrect code, particularly in complex areas like unit test mocking, requiring human debugging. The author notes that reviewing AI-generated code is tedious but necessary to avoid hidden traps. Success depends on the developer's ability to critically evaluate outputs rather than blindly trusting them..
Tools
Published on Agent Work Atlas:
Overview
Cursor and AI Agent Development
Workflow
Cursor and AI Agent Development I have been using Cursor’s AI agents off and on for a while now but December was the first time I really applied them in some recent projects. AI coding agents are shockingly good at trouble shooting issues and feature development. This might not be a shock to those who have been using these tools for a while, but this was my first experience really using them. Over the past month, there were three situations in which Cursor’s (and Warp’s) agent significantly aided in my development tasks. Running into a performance issue in a production system, but the dev environment had no such issue. I asked the agent to generate a list of possible causes of this performance issue and steps that could be taken to rectify it. The AI did this rather well. It was able to understand the database queries that NestJS was making to the database and what database indexes should be utilized. After adding in the database indexes, the performance of the page load significantly improved. I was rather impressed with the solutions that the AI provided and how it directly applied to the codebase that I was working in. Running into a performance issue in a production system, but the dev environment had no such issue. I asked the agent to generate a list of possible causes of this performance issue and steps that could be taken to rectify it. The AI did this rather well. It was able to understand the database queries that NestJS was making to the database and what database indexes should be utilized. After adding in the database indexes, the performance of the page load significantly improved. I was rather impressed with the solutions that the AI provided and how it directly applied to the codebase that I was working in. Adding a new feature to a Flutter android app, as someone with no mobile app development experience. This was exactly what I like AI for. I can have years of software development experience, but no Flutter experience, so I know what I want the app to do and how to ask the AI for that functionality. This did take a little back and forth with the agent as well as manually code changes, but overall I enjoyed the collaborative approach with the agent. For this I actually used both Cursor’s agent mode as well as Warp. Adding a new feature to a Flutter android app, as someone with no mobile app development experience. This was exactly what I like AI for. I can have years of software development experience, but no Flutter experience, so I know what I want the app to do and how to ask the AI for that functionality. This did take a little back and forth with the agent as well as manually code changes, but overall I enjoyed the collaborative approach with the agent. For this I actually used both Cursor’s agent mode as well as Warp. Writing unit tests for a python api. Been doing python development for a while now, but unit tests have never been something that I invested the time to learn. The api already had a suite of tests, so I thought it might be worth having the agent take a crack at it. This task actually had mixed results. It came up with a good set of tests, however, the way they were mocked led to several errors. I prompted a few times to have the AI fix the tests, but never actually worked. I had to step through the code and better understand what was happening in order to manually make the code changes that fixed the tests. The issue ended up being the service mock return value was not being mocked correctly. Writing unit tests for a python api. Been doing python development for a while now, but unit tests have never been something that I invested the time to learn. The api already had a suite of tests, so I thought it might be worth having the agent take a crack at it. This task actually had mixed results. It came up with a good set of tests, however, the way they were mocked led to several errors. I prompted a few times to have the AI fix the tests, but never actually worked. I had to step through the code and better understand what was happening in order to manually make the code changes that fixed the tests. The issue ended up being the service mock return value was not being mocked correctly.
Reported result
Adding the AI-suggested database indexes significantly improved page load performance in production. However, the AI-generated Python unit tests contained mocking errors that the agent failed to fix despite multiple prompts, requiring the author to manually debug and correct the code. The Flutter feature development involved back-and-forth collaboration and manual code changes.
Human role
The original post does not say how a person stayed involved.
Limitations
AI agents may produce incorrect code, particularly in complex areas like unit test mocking, requiring human debugging. The author notes that reviewing AI-generated code is tedious but necessary to avoid hidden traps. Success depends on the developer's ability to critically evaluate outputs rather than blindly trusting them.
Try it
Act as a senior developer using Cursor and Warp to solve a production performance issue in a [replaceable: NestJS/Python/Java] application. First, provide the agent with the [replaceable: slow query logs or code snippet] and ask it to list possible causes and rectification steps. Review the suggested database indexes or code changes. Apply these changes to a [replaceable: staging environment] and measure the [replaceable: page load time or API response time] before and after. If the AI generates unit tests for [replaceable: Python API], run them immediately. If tests fail due to mocking errors, do not ask the AI to fix them repeatedly; instead, manually inspect the mock return values and correct the code. Confirm with me before applying any changes to production. Output a summary of the performance improvement metrics and any manual fixes required.
Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.