Wing Tips: Reviewing and Accepting Agent Changes in Wing Pro 12
This Wing Tip continues the series on AI agents in Wing Pro 12. It covers what happens after the agent finishes a task and before you commit it.
Change Tracking and Review
When a task finishes running, it will transition from the Execute tab of the Tasks tool to the Review tab, where it waits for you to inspect and accept or reject the work that was done.
The Review tab has a section for each queue that is running tasks, and lists all the completed but unreviewed tasks under each queue. Review is done on a per-queue basis. If you accept all changes from a queue, that does not necessarily commit all files. However, granularity of commits is at the file level so you may end up committing changes made in other queues. Wing keeps track of who changed what and will warn in this case.
If a task or queue has made changes that aren't committed yet, you can click on the diff/merge icons in the Review tab to visit the changed files and view the differences. More often, you will use the Start Review or Commit links on the queue to process all the files changed by that queue at once.
Start Review shows you a diff/merge session in Wing where you can move through all the files and changes, accepting or rejecting each one or making comments on changes using the pencil icon visible in the floating icon set between changes. Pressing the pencil icon in the toolbar lets you make an overall comment and reject the changes. This transitions the task back to Execute and works on changes until it's ready to review again. Review mode is entered again automatically. If you want to accept all the changes instead, press the green check mark icon in the toolbar. Wing will then commit that change set.

Shown above: Reviewing the agent's proposed change side-by-side with the original file and commenting on a particular change.
Commit just executes the latter part of that process, skipping the review phase. This is appropriate if you have already reviewed the changes or trust that unit tests or other measures have sufficiently vetted the changes in other ways. Looking at diffs is by no means the only way to check an agent's work. You can also run tests or ask another agent to review the work. How much you read at the code level is up to you, and will likely change as you gain confidence in your tests and cross-checks.
A task that ran autonomously through the Tasks Manager (see the Wing Tip on autonomous development) shows a summary report of what it did and the decisions it made on your behalf, with the reasoning and alternatives for each. You can disagree with any of these and send it back with a description of what you want changed.
Commit Modes
Once you actually get to the point of committing, who commits and how is controlled by Commit Mode in the AI Agent tab of Project Properties. There are five choices:
The agent commits only when asked -- The default. The agent never commits on its own; when you approve a review or use Commit, it writes a commit message from the work it just did and then does the commit.
The agent commits after each task -- The agent commits on its own at the end of every completed task whose tests pass, without waiting for you.
The agent commits at its discretion -- The agent commits on its own at the logical stopping points it chooses, deferring when work is incomplete, tests fail, or problems are unresolved.
Wing commits with generated message -- Wing commits immediately, without involving the agent, using a commit message made out of the work summaries for each of the tasks being committed.
Wing presents commit message for review -- Wing builds the commit message from the task summaries and brings it up in Wing's commit dialog, waiting for you to review the message and complete the commit yourself.
When the Tasks Manager is enabled for autonomous task queueing, its own Commits setting overrides the above. It will either leave finished work on Review for you, commit automatically once tests pass, or follow a policy that you describe, such as "commit code automatically, but leave documentation changes for me to review". If you let the Manager commit on its own, consider working on a separate branch, so you stay in control of when the work is merged into your main branch. Note that even if the Tasks Manager commits for you, tasks land on the Review tab and you can still reject or revisit each decision it made.
History
Once you have committed work done by a task, or marked it complete, it transitions to the History tab in the Tasks tool. You can control whether and how history is kept from the History Settings item in the Tasks tool's Options menu.
From here (and in fact also from the Review tab) you can expand each task to see the agent's responses and any follow-up requests made in the same session (often as typed directly into the AI Agent tool).
The history for each task also shows the run time and number of tokens consumed by that task. A total for all tasks is at the top of the History tab. This is a good way to estimate how expensive tasks were.
The Resume Session link on tasks lets you resume the agent's session, if it is still available, to reinspect what was done.
Further Reading
Wing's AI agent integration has a lot of features, but you don't need to understand all of them to get started. When in doubt, ask the agent!
See also Autonomous Development with AI Agents and AI Agent-Assisted Development in Wing's documentation.
That's it for now! Next time we'll cover combining the agent with Wing's testing tools.
As always, please don't hesitate to email support@wingware.com if you run into problems or have any questions.