Agents Window: AI Agent Sessions for PLCs
On this page
Overview
The Agents window is a separate window built for working with AI agents. While the main editor is where you read and edit code yourself, the Agents window is where you hand work to the assistant and let it run: you start a session against a project, describe what you want, and the agent works through it, reading files, running tools, and proposing changes that you review and apply.
It is designed for running several sessions at once. You can kick off one agent on a project, switch to another, and let them work in parallel, glancing at the list to see which one is running, which needs your input, and which is done.
Using AI sessions needs a plan with AI chat on your account (Basic plan or higher, or an active trial), the same as the built-in AI Chat. A few features noted below need a higher plan.
Opening the Agents window
- From your project: click Open in Agents in the title bar of the main editor window. This opens the Agents window and carries your current project folder over, so new sessions start against it.
- Command Palette (
Ctrl+Shift+P): run Open in Agents (carries the current folder) or Open Agents Window (opens it without a folder). - Keyboard:
Ctrl+Shift+A(in screen-reader mode,Ctrl+Shift+Alt+A). - Welcome page / banner: the Try out the new Agents window and View All Sessions buttons also open it.
- Windows taskbar: right-click the Studio icon in the taskbar and choose Agents Window.
To jump back to a full editor, click Open in AnyAutomation Studio in the top-right of the Agents window. If the current session has a project folder, it opens that folder in an editor window.
The layout
- Title bar. In the center, a clickable session pill shows the active session's icon, title, and folder (and its branch when it uses one). Click it to open the session picker; right-click it for that session's actions. Back and Forward controls (also
Alt+Left/Alt+Right) move through recently viewed sessions. Top-right is Open in AnyAutomation Studio. - Left: the sessions list. Every session, with a New button and search, filter, sort, and grouping controls.
- Center: the active session. The conversation with the agent. A new session starts with the composer, where you pick the project and model and write your first instruction. The session header puts the title first and keeps the secondary actions in an overflow menu. While the assistant works, pills above the message box show what the turn is doing and keep the changed files one click away; right-click a pill to choose which pills are shown, and they can be turned off altogether in settings.
- Right: three tabs. Project Explorer (a read-only view of the TIA Portal project connected in this window), Changes (the files the session has modified), and Files (a file browser for the session's folder).
Files, diffs, and TIA blocks open as tabs in the side pane next to the conversation, on the one tab bar it shares with Changes and Files, so the conversation keeps its room. A file comparison shows side by side when there is room and inline when the pane is narrow; choose Always Show Inline Diff in the editor title bar's More Actions menu to always stay inline.
A panel can be opened along the bottom edge with Show Panel in the title bar, and Hide Panel closes it again. Right-click a tab of that panel and choose Align Panel to lay it out Center (under the conversation) or Justify (across the whole window); the choice is kept per profile. The window remembers how you left it: the panel keeps its place across restarts, each session comes back with the view it had open there, and the side pane keeps the width you dragged it to.
The background of the chat surface
The area behind the conversation can carry a background. Right-click an empty spot of the chat surface, or run Set Background... from the Command Palette, and choose:
- Codicons: a pattern of the built-in icons that follows your color theme.
- Image...: an image file from this machine (AVIF, BMP, GIF, ICO, JPEG, PNG, SVG or WebP). The five images you used last are offered again under recently used.
- No Background: removes it again.
With an image set, Change Background Layout... in the same menu places it: Repeat, Stretch, Center, or pinned to a side or a corner (Top, Top Right, Top Left, Bottom, Bottom Right, Bottom Left, Left, Right). Moving through the list shows each placement right away, so you pick the one you see.
The background and its placement are kept separately for dark and light themes, so switching the theme brings back the background and layout you picked for it. In a high contrast theme no background is shown. With an image set, Tint Window to Match Background in the same menu colors the window after your image.
Starting a session
- Pick the project. At the top of the composer, click the project chip to open the picker. It lists your recent projects (and recently opened folders); if the list is long, a search box appears. Choose Select… to browse for any folder. Your last choice is remembered for next time. If a recent folder no longer exists, the picker tells you so right away.
- Local or remote. When more than one kind of host is available, the picker shows tabs. Local runs the session on your own machine against a folder on this computer, always available, no setup. Remote runs it on another machine; from the Remote tab you can Connect via SSH (pick a host or type
user@host, choose how to authenticate, name it), Connect via Dev Tunnel (sign in, then pick a tunnel), or add a host by address. After it connects, you pick a folder on that machine. Each remote shows a live status, and a Manage entry lets you reconnect, remove, or open its settings. - Confirm trust. The first time you target a folder the agent hasn't worked in, you are asked to confirm: the agent will be able to read files, run commands, and make changes there. Declining cancels the selection.
- Pick a model. The composer's model picker shows the AI model the session will use. It mirrors the model you last chose in the main editor's AI Chat, so both windows stay in sync. See AI Chat for connecting providers and choosing models.
- Write and send. Type your first instruction in the message box and press Enter (use
Shift+Enterfor a new line), or click the Send button. The session is created and the agent begins working.
A chat without a folder. For a quick question that needs no project folder, for example about an SCL statement or your open TIA Portal project, choose Chat in the project picker and then AnyAutomation Chat. The assistant answers with your own AI providers and its TIA Portal tools, without a folder. The chat appears in the sessions list like any other session and is still there after a restart.
Session types. New sessions use AnyAutomation Chat with your own AI providers. The Copilot and Claude session types need a GitHub Copilot subscription and are not offered by default. With such a subscription, turn on Copilot And Claude Sessions in the settings of the Agents window to choose them again. Sessions of these types that you started earlier stay in the list either way. The earlier Local type is no longer offered for new sessions; if you had picked it last time, new sessions use AnyAutomation Chat.
Earlier Local sessions
Sessions you started with the earlier Local type stay in the sessions list in this release and open read-only; their row says so and, when the session worked in its own worktree, shows where that worktree is. To keep working on such a session, right-click it and choose Continue in New AnyAutomation Chat (also in the Command Palette for the selected session). A new AnyAutomation session opens in the same folder, for a session that ran in a worktree in the folder of your project, and its message box holds the conversation of the earlier session (its last 20,000 characters) as an attachment. Nothing is sent until you write and send. The earlier session stays as it is.
Open Folder in the context menu of such a session opens the folder it worked in, its worktree included, in a new window. Changes left in a worktree stay where they are: commit or apply them from that folder, Studio no longer does it for you. Delete removes the session from the list and from the chat history; the worktree stays on your computer.
The sessions list
- New session: click New, or press
Ctrl+N. Alt-click New to open the new session beside the one you are in. - Find a session: the search icon filters the list as you type; the filter icon lets you show only the sessions of one Harness (Copilot, Claude or Local), sort by created or updated time, group by workspace or by time, show recent or all, and collapse groups. Compact View in the same menu shows only the titles and moves workspace and time into the hover, and Empty Groups hides groups without sessions and an empty Chats section.
- Switch sessions: click a row, open the session picker (the title-bar pill, or
Ctrl+R) and type to search, or jump withCtrl+1…Ctrl+8(andCtrl+9for the last one). - What a row shows: the session's icon and title, its folder, the lines added and removed, and a timestamp, plus its live state:
- Working: a spinning indicator with a "Working…" line.
- Input needed: a pulsing dot; when the agent asks permission for an action, an Allow button appears right on the row.
- Idle / done: a small dot; finished, unread sessions are marked so you can spot them.
- Failed: an error icon.
- Per-session actions (row hover, right-click, or the title-bar pill): Pin / Unpin (a pinned session is marked in its toolbar), Rename… (or double-click the title to rename it in place: Enter confirms, Escape cancels), Mark as Read / Unread (a session you mark as unread stays unread while you work in it), Mark as Done (archives it; a session that is still running is stopped first, and one that cannot be stopped stays in the list), Restore, Open in New Window, and Copy Worktree Path for isolated sessions. There is no separate delete: Mark as Done archives a session and you can always Restore it. Right-click a workspace heading for Mark All as Read.
- The chats of a session: a session that holds more than one chat lists them underneath it. Each chat row carries its own title and status, and a pending approval appears right in the row for you to answer. Click a row to open that chat; right-click it for Rename..., Open to the Side and Delete.... Inside the session, Show Chat Tabs in the session menu switches between Multiple (every chat is a tab) and Single (only the active chat, without a tab row). Alt-click Fork Conversation at a checkpoint to open the fork beside the source conversation.
- Earlier Local sessions: sessions started with the earlier Local type are listed read-only; how to continue them in a new AnyAutomation session or open their folder is described in Earlier Local sessions.
- Keyboard:
F2renames what you have selected in the list right in its row,Deletearchives the selected session, andCtrl+Alt+I(alsoCtrl+Shift+I) jumps back to the session you are working in. Inside a session, the arrow keys move between its chat tabs, and the actions of the selected session can be reached from the keyboard as well.
The message composer
The composer is the box where you tell the agent what to do.
- Writing and sending. Type your request; the box grows with multi-line input. Enter sends,
Shift+Enteradds a line, and the round Send arrow (bottom-right) sends once there is text. - @Codebase auto-context (Pro). With it enabled, the most relevant code from your project attaches to each message automatically as removable chips above the box; remove any you don't want and it won't come back for that message. A small indicator shows whether the index is idle, working, or unavailable. It is off until you turn it on in Codebase Index settings.
- Voice dictation. A microphone button (shown when speech input is available on your machine) lets you dictate by speaking. Click to start, click to stop; your words appear as you talk. If you end a sentence with the configured submit word (by default "submit"), the message sends automatically. You can change or clear that word in settings.
- Attach context. The + button (or
Ctrl+/) attaches Files… or an Image from Clipboard. You can also drag and drop files onto the box, paste an image, or type # to reference a file inline. Attachments appear as chips you can click to open or remove. - Slash commands and skills. Type / at the start of a message for a menu, including /agents, /skills, /instructions, and /hooks, plus your own saved prompts. The Run Skill button (lightbulb) runs one of your skills without typing the command.
- Prompt history. With the cursor at the start of an empty box, press Up to recall earlier prompts.
- Context usage. A Context indicator shows how much of the model's context window the conversation is using; click it for a breakdown.
Repository options
A row of small dropdowns under the composer controls how a session runs against your project:
- Default Approvals: how much the agent may do on its own: Default Approvals (asks before sensitive actions), Bypass Approvals (auto-approves every tool action; shows a warning the first time), or Autopilot (Preview) (the agent works autonomously start to finish; you can stop it anytime). Your organization's policy can disable the elevated options.
- Worktree: whether the session works in an isolated copy of the project or directly in your folder (see Running in isolation below). Available for Git projects.
- Branch: which branch the session starts from; searchable when there are many.
Sub-sessions
Inside an existing session you can start a fresh chat in the same project, useful for a side question or a separate task with clean context. It works like the main composer but skips the project and model pickers, since the workspace is already set. Every extra chat appears as its own row under that session in the sessions list, where you open, rename or remove it (see The sessions list).
An extra chat can be marked as done and restored on its own, without the session; while it is done it is read-only. Each chat keeps its own read state.
Side questions. To ask something in between without pulling the assistant away from its task, type /btw followed by your question, or select text in an answer and ask about it. A side chat opens next to the session with the conversation so far, answers the question and leaves the main chat as it was. Side chats sit under their session and are still there after a restart.
Forking a chat. To try another way from a certain point, click Fork Conversation on a message, or type /fork in the input. A new chat titled Forked: … opens in the same session with the conversation up to that point; the original chat stays as it is. Type /fork followed by a name to name the new chat, or /fork prompt followed by a message to fork and send that message right away. Forked chats sit under their session and are still there after a restart.
Comparing several models
To see how different models handle the same task, run it on several of them at once and compare the results:
- Write your prompt in a new session. Open the model picker and click Compare Models next to the search field (or press
Ctrl+Alt+M). - Check the models for the attempts. A comparison runs 2 to 10 attempts; a model can also run more than once, for example at different thinking efforts.
- Optionally click Configure Judge to choose a Judge, a model that reviews the attempts and recommends one, and then Configure Synthesis to choose a Synthesizer, a model that can combine the best parts afterwards. Click Done at any step.
- Click Run N Attempts (the Send button shows the number of attempts).
All attempts start at the same time. Each one works in its own Git worktree, a separate copy created from the branch selected in the composer, so the attempts never interfere with each other or with your open folder. The comparison appears as one group in the sessions list; open it to see the attempts side by side.
When at least two attempts have finished, the Judge reviews their changes and replies, and its chat shows a scorecard: the recommended model with a short reason, the time and tokens each attempt used, and Open Attempt N to jump to an attempt. If you chose a Synthesizer, Synthesize starts a new attempt that builds on the recommendation, optionally with your extra instructions; the original attempts stay unchanged. The recommendation is a suggestion: review any attempt and apply the one you want with Apply Changes to Parent Repository (below).
Good to know:
- With a folder, the project must be a Git repository with at least one commit. If an attempt cannot get its own worktree, it stops with a message instead of working in your open folder.
- Without a folder (Chat in the project picker), the attempts run as plain chats side by side, without worktrees, Judge or Synthesizer.
- Mark All as Done on the group archives every attempt: the changes of each attempt are saved on its own branch and its worktree is removed. Undo brings the attempts back with their worktrees.
Running in isolation
A session can run in an isolated copy of your project so your open files are never touched while the agent works:
- Folder (default): the agent edits your open project folder directly.
- Worktree: the agent works in a separate, throwaway copy; you review its work and merge it in only when you're happy. Pick New Worktree in the composer above the input of a new session; the choice is remembered for your next sessions.
The isolated copy is kept when you close or restart Studio, and the session continues in it. When you mark the session as done, its changes are saved on the session's own branch and the copy is removed; restoring the session brings the copy back with its changes. Deleting the session removes the copy. If the copy or its branch was removed outside Studio, the session says so and continues in your open folder.
Isolation is available for Git projects, and files belonging to an isolated copy are marked so you can tell them apart.
Reviewing and applying changes
- Changes panel. Toggle it with Show Changes / Hide Changes in the title bar. It lists every file the session created or changed, with added and removed line counts. Click a file to open its diff; Open File and Open Changes are also available per file. When a session is linked to a pull request, an Open Pull Request button appears.
- Which changes you see. The list picker at the top of the panel switches between Branch Changes, Uncommitted Changes (everything not yet committed in the session's folder or copy), All Changes (everything the session changed since it started) and Last Turn Changes (what its latest answer changed). The lists are also there when you open a session again after a restart.
- Discard a file. Point at a file in Uncommitted Changes, All Changes or Last Turn Changes and click Discard Changes. After you confirm, the file goes back to its committed state, to its state at the start of the session, or to its state before the latest answer. If you changed the file yourself after the latest answer, Studio tells you so and leaves it alone.
- Commit. Commit above Uncommitted Changes saves exactly the files in the list to version control. Studio proposes the chat title as message; edit it and press Enter, or press Escape to cancel.
- Change navigation. In the diff header, Previous Change and Next Change step through the changed files, and a counter shows your position (for example, 2 of 7).
- Long lines. The More Actions menu in the title of a code or comparison view offers Word Wrap, so long lines wrap instead of running off to the side.
- Apply to your project. For a session that ran in isolation, first commit its changes with Commit; then Apply Changes to Parent Repository appears and merges the work into your real project. You'll see Applied changes to parent repository (with an Undo Apply button), a note that the repository was already up to date, or, if it has diverged, a message asking you to resolve conflicts.
- Undo an apply. Use Undo Apply on the confirmation message, or run Undo Apply to Parent Repository. A dialog confirms the action (it rewinds your project to the earlier point and cannot be undone). For safety, undo is blocked while your project has uncommitted changes or a merge in progress, and is no longer offered once you've committed more work on top.
Investigating failed checks
When the session is linked to a pull request whose CI checks are failing, the Changes panel shows a Checks list with each check and its status.
- Investigate a failure. A failed check carries an Investigate Check button (and Investigate All Checks runs them together). It looks into why the check failed and shows, under the check, a short summary with the root cause, the failing signal (the exact failing line or command), a flakiness read (Likely flaky / Unlikely flaky / Flakiness unknown) and a confidence level (High / Medium / Low confidence). If it can't produce an analysis, it shows "Investigation failed. See annotations." and the raw check details stay available.
- Rerun. Rerun Check re-runs the failed CI job.
- Resolve. Resolve Check (and Resolve All Checks) clears a check's analysis from your view. It doesn't change anything on the pull request. The next CI run updates the check itself.
- Fix. Fix Checks hands the failures and their analysis to the agent, which proposes a fix; you review and apply it through the Changes panel as usual.
Approvals and autonomy
While a session runs, the agent asks permission before taking actions (running a tool, editing a file, running a command) and you Allow or deny each request inline (also from the session's row in the list). A tool you set to Always Deny in the chat's tool approvals stays refused here too, even in an auto-approving mode. Set the overall policy per session with Default Approvals in the composer (see Repository options). The mode and the permission level you choose under the input of a new session apply to the requests of that session.
When a run finishes
When an agent run finishes, fails, or pauses needing your input while the Agents window is in the background, a short sound plays so you know to come back, with distinct cues for completed, failed, and needs-attention. A system notification appears as well, naming the session and what happened; click it, or its Open Session button, to bring that session to the front. Both the sound and the notification can be turned off in settings; the sound sits under Agent Notifications.
In the open session you see the result right in the chat: the answer starts with how many steps it took and how long, Changed N files under the answer opens the files that answer changed, and the file count above the message box opens the Changes panel. The session's row in the list shows whether the run completed, failed or needs your attention.
Customizations
A Customizations area in the left sidebar gives the agent extra capabilities and guidance. Each category shows a count and opens a full editor where items are grouped by where they come from (your workspace, your user profile, built-in, or installed plugins) and can be searched. These are the same customizations used by AI Chat, surfaced here for sessions:
- Agents: specialized assistants with their own tools and instructions for specific tasks. Create, edit, enable/disable, or delete.
- Skills: reusable knowledge and workflows for the agent, including built-in ones; a skill of yours can override a built-in of the same name. Some carry a UI Integration tag, meaning a button in the app uses them.
- Instructions: always-on guidance applied across a workspace or your profile, including project rule files the agent reads automatically.
- Hooks: automated actions that run on events in the agent's lifecycle. Configuring hooks needs an open folder.
- MCP Servers: external tool servers that add tools and data sources. Add Server or Browse Marketplace to find them.
- Plugins: bundles of tools, skills, and integrations. Browse Marketplace, Install Plugin from Source, or Create Plugin. Install Plugin from Source also offers a button that picks a plugin folder on your computer.
MCP servers and plugins can be turned off by your organization's policy, in which case the panel explains that. See AI Chat for more on these customizations.
Side panels
- Files. A file browser for the session's folder. Click a file to open it as a tab in the side pane (an HTML file opens in the integrated browser); the toolbar offers New File, New Folder, Open Folder (change the root), and Collapse All.
- Search. Searching inside the session's folder skips ignored files, and the search tab says so when nothing was found.
- Project Explorer. A read-only view of the TIA Portal project connected in this window: PLCs, folders, and blocks with their Siemens icons. Click a block to open its source as a tab in the side pane. The Agents window has its own connection, separate from the main Studio window, and the assistant in this window works only on this window's project.
- Connecting. While no project is connected, the panel shows Attach to Running TIA Portal (pick a running TIA Portal), Open TIA Project (pick a project file; this starts a new TIA Portal) and, while the main window has a project open, Use Project Open in Studio (pick one of the projects open in the main window). In the attach list, a TIA Portal Studio already works with is marked Already open in Studio.
- Switching and disconnecting. Click the project name at the top of the panel for a menu with the open projects (the checkmark marks this window's project), Attach to Running TIA Portal, Open TIA Project and Disconnect from TIA Portal. Picking a project switches only this window; the main window keeps its project. The same commands are in the Command Palette (
Ctrl+Shift+P). - Sharing a project. When both windows use the same project, they work with one TIA Portal. Disconnect from TIA Portal in one window leaves the project open for the other window and does not ask whether to save. If the project is closed in the other window, or TIA Portal ends, this window shows the connect buttons again.
- There are no checkboxes here.
CODESYS in the Agents window
The assistant in an Agents window works with a CODESYS project of its own: it opens the project, reads and edits objects, compiles, and changes devices and the I/O mapping in this window, while the Studio window keeps its project. When both windows open the same project, they share it: a change in one window is part of the project in the other, saving it under a new name, going online or offline and logging in as a project user work only in the window that opened it first, and while that window is logged in to the device, the assistant here only reads. Opening the shared project here with another project user is refused. Closing it in one window leaves it open in the other. If the window that opened the project first saves it under a new name, switches to another project or closes it, the Agents window no longer shares it, and the assistant opens a project again before it continues. Closing the Agents window ends its CODESYS session. A project that an Agents window has open in its own CODESYS session cannot be opened in the Studio window at the same time; close it there first. Online work, unit tests, compare, libraries, tasks, analysis, EPLAN and the other CODESYS features stay in the Studio window; the assistant says so when you ask for them here.
Notes
- AI sessions require a plan with AI chat (Basic plan or higher, or a trial); @Codebase auto-context and codebase search require a Pro license or higher.
- The Agents window connects to TIA Portal on its own: attach, open, use a project open in Studio, and disconnect. Working offline, creating a new project, Multi-User and server management stay in the main Studio window. The Agents window's Project Explorer is read-only.
- Connecting needs the same license as in the main Studio window.
- Most Studio tools work in the Agents window too. Tools that need the main Studio window tell you so when the assistant calls them, among them the SCADA, Trace, Unit Testing, Simulation and commissioning report tools, the PLC / OPC UA panels and watch tables, the EPLAN editing and transfer tools, the Sysmac Studio tools, the canvas and the TIA compare editor.
- Sessions are archived with Mark as Done, not deleted, and can be restored at any time.