Turn Switch off and nothing merges: a commit-bound merge gate that lives in your team chat
An AI coding agent can open a pull request in four minutes. Reviewing it still takes a person — and two things go wrong in between. First, the branch can move. You read a diff, say "looks good", and by the time the merge happens another commit has landed on the same branch. What merged is not what you approved. Second, and this one appears the moment agents work from chat: a bot that reads a room…
A new tool called Loopback enables AI agents to work within team chat rooms, ensuring code merges only occur after proper approvals. This innovative solution addresses two major issues in software development: branch movement and unauthorized merging.
When a maintainer posts a report in a designated Slack channel, the Loopback bridge forwards it to the team's chat room. The system then differentiates between commands and regular messages, ensuring that only approved actions are executed. For instance, a maintainer can request a bug fix, while a bot's request to merge code without review is ignored.
The core of the system is a custom merge gate, which verifies that only the intended commit with its specific SHA (unique identifier) is merged. If another commit is made on the same branch, the merge is rejected, preventing unintended code integration. This gate operates independently, disengaging as soon as the branch changes, ensuring that the merge remains accurate and secure.
Loopback operates through two primary channels: a public intake room for submitting bugs and a private room for maintainers and AI agents to collaborate. The system maintains a clear separation between users and agents, utilizing unique participant IDs for approvals, and adheres to strict addressing policies to avoid confusion.
To set up Loopback, users first install the Switch Console, which launches the local server. Slack is then integrated through a bridge, or the Mattermost server that comes with it. After registering the custom agent loopback-gate, the system automatically creates the necessary rooms and assigns instructions to the maintainers' room, clearly outlining agent behavior and approval processes.
The entire workflow is demonstrated through a case study involving 25 audit events on a demo repository. The process starts with a reported bug, moves through the fixing and verifying stages, and concludes with a verified merge. This end-to-end workflow demonstrates Loopback's ability to maintain strict control over code changes, ensuring that only approved commits are merged into the main branch.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.