Skip to content

Commit bcd258c

Browse files
Gkrumbach07Ambient Code Botclaude
authored
feat: Slack notification on PR creation (#1227)
## Summary When the agent creates a PR from an issue (via `ambient-code:auto-fix` label or `@ambient-code` on an issue), it now sends a Slack notification with links to the PR and the session. ## Message format ``` PR created for #1234 PR: https://github.com/ambient-code/platform/pull/5678 Session: https://ambient.ai/projects/my-project/sessions/session-abc123 ``` ## Test plan - [ ] Add `ambient-code:auto-fix` to an issue — verify Slack notification sent after PR created - [ ] `@ambient-code` on an issue — verify same 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated workflow logic to require creation of a plan and to prompt for clarification when ambiguous. * Added conditional Slack notifications: one before requesting user clarification and one after PR creation (sent only if configured). * Adjusted workflow step ordering and related guidance to reflect the new notification and clarification flow. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ambient Code Bot <bot@ambient-code.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ab7307a commit bcd258c

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

.github/workflows/amber-issue-handler.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,32 @@ jobs:
8484
8585
1. Read the issue and understand the problem.
8686
2. Explore the codebase to find the relevant code.
87-
3. Implement a fix. Write tests if the area has existing test coverage.
88-
4. Create a PR with a clear description. Include this frontmatter as the
87+
3. Create a plan for how to fix the issue. If there is any ambiguity —
88+
unclear requirements, multiple valid approaches, missing context — you
89+
MUST ask for clarification. IMPORTANT: Before calling AskUserQuestion,
90+
ALWAYS send a Slack notification first (the session stops streaming when
91+
AskUserQuestion is called, so the notification must go out before):
92+
```bash
93+
curl -X POST -H 'Content-type: application/json' \
94+
--data '{"text":"I have a question about #${{ steps.issue.outputs.number }}\n*Issue*: https://github.com/${{ github.repository }}/issues/${{ steps.issue.outputs.number }}\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\n*Question*: <brief summary of what you need>"}' \
95+
"$SLACK_WEBHOOK_URL"
96+
```
97+
Only send if SLACK_WEBHOOK_URL is set. Then call AskUserQuestion.
98+
4. Implement the fix. Write tests if the area has existing test coverage.
99+
5. Create a PR with a clear description. Include this frontmatter as the
89100
first line of the PR body (read your session ID from the
90101
AGENTIC_SESSION_NAME environment variable):
91102
<!-- acp:session_id=$AGENTIC_SESSION_NAME source=#${{ steps.issue.outputs.number }} last_action=<ISO8601_NOW> retry_count=0 -->
92-
5. Add the `ambient-code:managed` label to the PR.
93-
6. Ensure CI passes. If it fails, investigate and fix.
94-
7. Do not merge. Leave the PR open for human review.
103+
6. Add the `ambient-code:managed` label to the PR.
104+
7. After creating the PR, send a Slack notification:
105+
```bash
106+
curl -X POST -H 'Content-type: application/json' \
107+
--data '{"text":"PR created for #${{ steps.issue.outputs.number }}\n*PR*: <PR_URL>\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'"}' \
108+
"$SLACK_WEBHOOK_URL"
109+
```
110+
Only send if SLACK_WEBHOOK_URL is set.
111+
8. Ensure CI passes. If it fails, investigate and fix.
112+
9. Do not merge. Leave the PR open for human review.
95113
repos: >-
96114
[{"url": "https://github.com/${{ github.repository }}", "branch": "main"}]
97115
model: claude-opus-4-6
@@ -259,14 +277,32 @@ jobs:
259277
260278
1. Read the issue and understand the problem.
261279
2. Explore the codebase to find the relevant code.
262-
3. Implement a fix. Write tests if the area has existing test coverage.
263-
4. Create a PR with a clear description. Include this frontmatter as the
280+
3. Create a plan for how to fix the issue. If there is any ambiguity —
281+
unclear requirements, multiple valid approaches, missing context — you
282+
MUST ask for clarification. IMPORTANT: Before calling AskUserQuestion,
283+
ALWAYS send a Slack notification first (the session stops streaming when
284+
AskUserQuestion is called, so the notification must go out before):
285+
```bash
286+
curl -X POST -H 'Content-type: application/json' \
287+
--data '{"text":"I have a question about #${{ steps.context.outputs.number }}\n*Issue*: ${{ steps.context.outputs.url }}\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\n*Question*: <brief summary of what you need>"}' \
288+
"$SLACK_WEBHOOK_URL"
289+
```
290+
Only send if SLACK_WEBHOOK_URL is set. Then call AskUserQuestion.
291+
4. Implement the fix. Write tests if the area has existing test coverage.
292+
5. Create a PR with a clear description. Include this frontmatter as the
264293
first line of the PR body (read your session ID from the
265294
AGENTIC_SESSION_NAME environment variable):
266295
<!-- acp:session_id=$AGENTIC_SESSION_NAME source=#${{ steps.context.outputs.number }} last_action=<ISO8601_NOW> retry_count=0 -->
267-
5. Add the `ambient-code:managed` label to the PR.
268-
6. Ensure CI passes. If it fails, investigate and fix.
269-
7. Do not merge. Leave the PR open for human review.
296+
6. Add the `ambient-code:managed` label to the PR.
297+
7. After creating the PR, send a Slack notification:
298+
```bash
299+
curl -X POST -H 'Content-type: application/json' \
300+
--data '{"text":"PR created for #${{ steps.context.outputs.number }}\n*PR*: <PR_URL>\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'"}' \
301+
"$SLACK_WEBHOOK_URL"
302+
```
303+
Only send if SLACK_WEBHOOK_URL is set.
304+
8. Ensure CI passes. If it fails, investigate and fix.
305+
9. Do not merge. Leave the PR open for human review.
270306
repos: >-
271307
[{"url": "https://github.com/${{ github.repository }}", "branch": "main"}]
272308
model: claude-opus-4-6

0 commit comments

Comments
 (0)