Skip to content

Commit 3c14f40

Browse files
Add comprehensive documentation for Slack/Linear interrupt system (#1175)
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
1 parent 465c550 commit 3c14f40

File tree

2 files changed

+145
-1
lines changed

2 files changed

+145
-1
lines changed

docs/capabilities/interrupts.mdx

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
title: "Interrupts"
3+
description: "How Codegen handles real-time interrupts from Slack and Linear while working"
4+
---
5+
6+
## Overview
7+
8+
Codegen supports **real-time interrupts** that allow users to send additional messages or clarifications while the agent is actively working on a task. This feature enables dynamic, conversational interactions where users can provide feedback, corrections, or additional context without waiting for the agent to complete its current work.
9+
10+
## How Interrupts Work
11+
12+
When Codegen is actively processing a request, users can send follow-up messages through supported channels (Slack, Linear) that will be immediately delivered to the running agent as "interrupt messages."
13+
14+
### Key Features
15+
16+
- **Real-time delivery**: Messages are delivered immediately to the active agent
17+
- **Context preservation**: The agent maintains full context of the original task
18+
- **Immediate acknowledgment**: Codegen typically responds quickly to acknowledge the interrupt
19+
- **Seamless integration**: The agent incorporates new information into its current workflow
20+
21+
## Supported Channels
22+
23+
### Slack Interrupts
24+
25+
In Slack, you can send interrupt messages by:
26+
27+
1. **Replying in the thread** where Codegen is working
28+
2. **Mentioning @codegen** with additional context
29+
3. **Sending follow-up messages** in the same channel
30+
31+
<Warning>
32+
**Important**: You **must** mention `@codegen` in your interrupt messages for Codegen to respond in Slack channels, unless you're in a direct message (DM) with Codegen where it will respond automatically.
33+
</Warning>
34+
35+
**Example:**
36+
```
37+
User: @codegen can you fix the login bug?
38+
Codegen: I'll fix the login bug! 🔧 [starts working]
39+
User: Actually, make sure to also handle the password reset flow
40+
Codegen: Got it! I'll include the password reset flow in my fix 👍
41+
```
42+
43+
### Linear Interrupts
44+
45+
In Linear, interrupts work through:
46+
47+
1. **Adding comments** to the issue Codegen is working on
48+
2. **Updating the issue description** with additional requirements
49+
3. **Changing issue priority or labels** (triggers re-evaluation)
50+
51+
<Info>
52+
**Note**: Codegen will respond automatically to your comments in Linear unless another user is tagged in the same comment.
53+
</Info>
54+
55+
**Example:**
56+
```
57+
Issue: Fix authentication system
58+
Codegen: Working on the authentication fix...
59+
[User adds comment]: "Please also add 2FA support"
60+
Codegen: I see you've added 2FA requirements - incorporating that now!
61+
```
62+
63+
64+
65+
## Best Practices
66+
67+
### For Users
68+
69+
<Tip>
70+
**Send interrupts early**: If you realize you need to add context or change requirements, send the message immediately rather than waiting for completion.
71+
</Tip>
72+
73+
- **Be specific**: Clearly state what you want to add or change
74+
- **Provide context**: Explain how the new information relates to the original request
75+
- **Use @mentions in Slack**: Always mention @codegen in Slack channels (not needed in DMs)
76+
- **No mentions needed in Linear**: Codegen responds automatically unless other users are tagged
77+
78+
### Common Use Cases
79+
80+
1. **Adding requirements**: "Also make sure to add error handling"
81+
2. **Providing clarification**: "By 'users' I meant admin users specifically"
82+
3. **Changing scope**: "Actually, let's focus on the mobile version first"
83+
4. **Sharing additional context**: "Here's the error log I forgot to include"
84+
5. **Course correction**: "That approach won't work, try using the new API instead"
85+
86+
## Limitations
87+
88+
- **Processing order**: Interrupts are processed in the order they're received
89+
- **Context switching**: Very frequent interrupts may slow down overall progress
90+
- **Channel-specific**: Interrupts only work within the same channel/issue where work started
91+
92+
## Troubleshooting
93+
94+
### Interrupt Not Acknowledged
95+
96+
If your interrupt isn't acknowledged:
97+
98+
1. **Check the channel**: Ensure you're messaging in the same thread/issue
99+
2. **Wait briefly**: The agent may be in the middle of a long operation
100+
3. **Use @mentions in Slack**: Make sure you mentioned @codegen (required in channels, not DMs)
101+
4. **Check for other tags in Linear**: If you tagged other users, Codegen won't respond automatically
102+
5. **Check agent status**: The agent may have completed or encountered an error
103+
104+
### Message Not Incorporated
105+
106+
If your interrupt seems ignored:
107+
108+
1. **Be more explicit**: Clearly state what you want changed
109+
2. **Reference the original task**: Connect your interrupt to the current work
110+
3. **Follow up**: Send a clarifying message if needed
111+
112+
## Examples
113+
114+
### Slack Thread Example
115+
116+
```
117+
User: @codegen create a user registration form
118+
Codegen: I'll create a user registration form! 📝 [working...]
119+
120+
User: Make sure it includes email verification
121+
Codegen: Got it! Adding email verification to the registration form 📧
122+
123+
User: And add password strength requirements
124+
Codegen: Perfect! I'll include password strength validation as well 🔒
125+
```
126+
127+
### Linear Issue Example
128+
129+
```
130+
Linear Issue: "Implement search functionality"
131+
Codegen: Working on search functionality...
132+
133+
[User adds comment]: "Please include filters for date and category"
134+
Codegen: I see you've added filter requirements - implementing date and category filters now!
135+
136+
[User adds comment]: "Also add sorting options"
137+
Codegen: Adding sorting options to the search as well! 📊
138+
```
139+
140+
## Related Features
141+
142+
- [Wake-up Triggers](/capabilities/wake-up) - How to initially trigger Codegen
143+
- [Slack Integration](/integrations/slack) - Complete Slack setup and usage
144+
- [Linear Integration](/integrations/linear) - Complete Linear setup and usage

docs/docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
{
2828
"group": "Capabilities",
29-
"pages": ["capabilities/capabilities", "capabilities/wake-up"]
29+
"pages": ["capabilities/capabilities", "capabilities/wake-up", "capabilities/interrupts"]
3030
},
3131
{
3232
"group": "Integrations",

0 commit comments

Comments
 (0)