Skip to main content

Configure Code Writer

You can use Code Writer directly from Slack through Glean's Slack integration. This lets users turn Slack conversations, incidents, and escalations into draft pull requests without leaving their channels.

How Code Writer works in Slack

When Code Writer is available in Slack:

  • Users can ask Glean in Slack to propose code changes based on channel messages, tickets, or stack traces.
  • Agents that include a Code Writer step can be triggered from Slack.
  • Code Writer opens draft pull requests in GitHub and posts the pull request links and summaries back to Slack.

Code Writer uses the same GitHub connector, GitHub App, and action pack configuration as Assistant and agents.

Prerequisites

Before users can use Code Writer in Slack:

  1. Glean in Slack is installed — Follow the setup steps in the Glean in Slack documentation so your workspace can use the Glean app.

  2. GitHub is connected — The GitHub connector is configured and connected to the repositories where Code Writer will open pull requests.

  3. Code Writer action is configured — The Code generation / Code Writer action pack is set up in the Admin console with:

    • A GitHub data source instance.
    • The Glean GitHub App installed.
    • Authentication and (optional) GPG signing configured.
    • Access granted to the groups who will use Slack.
  4. User GitHub auth completed — On first use, engineers connect their GitHub account via OAuth so Code Writer can run on their behalf.

Admin configuration for Slack

Enable Glean in Slack

If you have not already done so:

  1. Install the Glean Slack app for your workspace.
  2. Complete any workspace-level and channel-level permissions needed for Glean to read messages and respond in selected channels.

See the general Glean in Slack documentation for detailed installation and permission steps.

Confirm Code Writer is enabled

In the Admin console:

  1. Go to Actions.

  2. Open the Code generation / Code Writer configuration.

  3. Verify:

    • A GitHub data source instance is selected.
    • The Glean GitHub App is installed for the correct organization.
    • Authentication is set (User OAuth or central OAuth).
    • GPG signing is configured if you require verified commits.
    • The Enable actions section includes the users or groups who will use Slack.

Changes you make here apply to Assistant, agents, and Slack.

Add Glean to relevant channels

To use Code Writer in a Slack channel:

  1. Add the Glean app to the channel (for example, #prod-escalations or #eng-support).
  2. Ensure channel members who will invoke Code Writer:
    • Have Glean accounts.
    • Are included in the Code Writer action's access list.

See also