DEV Community

1 1 1

GitHub Copilot Agent Mode: An Even Smarter Code Assistant

Recently, GitHub Copilot’s Agent Mode became available in the VSCode Insiders preview. This new mode can iterate over its own code, recognize errors, and correct them automatically. Additionally, it can suggest terminal commands and request their execution, as well as analyze runtime errors and apply auto-corrections.
Agent Mode Example

Now, instead of just executing the requested task, Copilot can also add additional tasks that were not specified in the prompt but are necessary for the solution to work correctly. It can identify its own errors and apply fixes directly in the code.

I've been testing Agent Mode for a few weeks in experimental projects to better understand how it works and how it can impact my productivity in development.

A Practical Example

One of the most interesting features of Agent Mode is its ability to analyze an entire project (or just specific files) and automatically generate solutions. It can even create new files when necessary.

To test this, I created a simple CRUD project and asked Copilot to add a new route to list trucks and drivers together, combining two existing routes:
Copilot Chat Request

Agent Mode started analyzing the code, identified relevant references within the project, and determined the ideal approach to apply the requested solution.

Copilot's Response

Shortly after, it created a new file, automatically including the necessary component imports for the listing and the requests.

Copilot's Response

Next, it added the request to list trucks and drivers, including the filtering logic:

New Component Code

And structured the display of results:

New Component Code

Finally, Copilot identified that it was necessary to register the new route in the main routes file and made this modification automatically:

GitHub Copilot Chat Response

The new route was added along with the import of the newly created page:

New Route Addition

All of this was generated from a single message in the Agent Mode chat. This is just one example of the countless possibilities this new feature offers. For now, Agent Mode is still in preview, but I have already noticed a significant increase in productivity while using it. I believe that in the future, it will become even more refined and a great ally in development, reducing rework and eliminating the need to copy code from other sources.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️