Code Channels in Slack with Bits Code
This product is not supported for your selected
Datadog site. (
).
Overview
Code channels are dedicated, temporary Slack channels for working with a coding agent on a specific task. When you ask Bits Chat in Slack to make a code change, Bits Code creates a code channel for that task. You and your team can follow the work, steer it, and review the result there, without cluttering the original conversation.
Learn more about code channels in the Slack documentation.
Create a code channel
After setting up Bits Code and enabling code channels, create a code channel by mentioning @Datadog in Slack and describing a code change you’d like to make. If Bits Chat determines the request requires code changes, it hands the task off to Bits Code, which creates a code channel. Bits posts a link to the new code channel in the location where it was originally prompted.
Bits Code names the code channel automatically based on your initial request. Find your code channels in a dedicated Code channels section in your Slack sidebar.
Permissions and access
Only the user who prompted @Datadog is added to the new code channel automatically. Code channels match the visibility of the channel from which they are created (that is, if you mentioned @Datadog in a public channel, the resulting code channel is also public).
Bits Code can access source code repositories with the permissions of the user who prompted
@Datadog and created the channel. It can access all Datadog telemetry (with
Data Access Control restrictions applied) of all users in the channel. Bits Code may bring this repository data and telemetry into the code channel. As the creator of a code channel, it is your responsibility to ensure that anyone who can view a code channel is authorized to view its contents, and that anyone who can join a code channel is authorized to steer Bits Code.
Any user who wants to steer the agent must have a Datadog account connected to Slack. (If you post in a code channel but do not have a connected Datadog account, Bits ignores your message.)
Work in a code channel
In other Slack channels, when you want a response from Bits Chat, you must @-mention it every time. A code channel works differently: Bits Code listens to each message posted. You don’t need to mention @Datadog again to keep steering the agent.
As Bits Code works, the code channel shows:
- A diff view of proposed code changes
- Datadog graph widgets, when relevant to the task
- A Create PR button to open a pull request from the changes
After Bits Code has generated a code diff, you can comment on specific lines directly in the code channel.
The work in every code channel is also reflected in a Bits Code session in Datadog. To view it, at the bottom-right corner of the code channel, click </> Code session.
Learn more about how to work in a code channel in the Slack documentation.
How auto-push works in code channels
When the auto-push setting is set to Always allow auto-push, Bits Code can push changes agentically—that is, without a human clicking a button. When pushing agentically, Bits uses the code channel creator’s source code identity to author the commits and pull request.
Bits Code can only push code agentically from a code channel when the channel creator and every user who has sent a message in the channel has a source control account linked to Datadog with:
- Write access to every repository with a pull request in the channel, and any repository receiving changes
- Read access to all other repositories attached to the channel
(These permissions are not verified for users who have joined the channel but not sent a message.)
If any user who has sent a message in the code channel lacks the required repository permissions, or Bits cannot verify them, Bits does not agentically push changes. In this scenario, a user with the required permissions can still click Create PR or Update PR. These buttons check only that single user’s permissions across the code channel’s attached repositories. The user who clicks Create PR is the author of the resulting pull or merge request.
Limitations
The overall Bits Code limitations also apply to code channels.
Further reading
Additional helpful documentation, links, and articles: