Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 91 additions & 8 deletions .github/workflows/amber-issue-handler.yml
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Acknowledge issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/reactions \
-X POST -f content=eyes --silent || true

- name: Resolve issue details
id: issue
env:
Expand All @@ -66,6 +73,14 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi

- name: Post immediate acknowledgement
if: steps.existing.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue comment ${{ steps.issue.outputs.number }} --repo "${{ github.repository }}" \
--body "πŸ€– Amber is working on this issue. A PR will be created shortly with the \`ambient-code:managed\` label."

- name: Create session
if: steps.existing.outputs.skip != 'true'
id: session
Expand Down Expand Up @@ -102,12 +117,23 @@ jobs:
<!-- acp:session_id=$AGENTIC_SESSION_NAME source=#${{ steps.issue.outputs.number }} last_action=<ISO8601_NOW> retry_count=0 -->
At the bottom of the PR body, add a session link:
---
πŸ€– [Ambient Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)
πŸ€– [Ambient Session](<SESSION_URL>)
6. Add the `ambient-code:managed` label to the PR.
7. Ensure CI passes. If it fails, investigate and fix.
8. Do not merge. Leave the PR open for human review.
9. When you comment on the PR, include this footer at the end:
_πŸ€– [Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)_
_πŸ€– [Session](<SESSION_URL>)_

## Session URL

IMPORTANT: Wherever a session link is needed (PR body, comments, Slack),
you MUST first resolve the URL by reading the environment variables. Run:
```bash
echo "$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"
```
Use the resolved output as the actual URL. Do NOT write `$PLATFORM_HOST`,
`$AGENTIC_SESSION_NAMESPACE`, or `$AGENTIC_SESSION_NAME` literally in any
markdown link β€” always substitute their actual values.
repos: >-
[{"url": "https://github.com/${{ github.repository }}", "branch": "main"}]
model: claude-opus-4-6
Expand All @@ -116,15 +142,32 @@ jobs:
environment-variables: >-
{"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.PLATFORM_HOST }}"}

- name: Post-session labels and comment
- name: Post-session update comment
if: steps.existing.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SESSION_NAME: ${{ steps.session.outputs.session-name }}
SESSION_PHASE: ${{ steps.session.outputs.session-phase }}
SESSION_URL: ${{ steps.session.outputs.session-url }}
PLATFORM_HOST: ${{ secrets.PLATFORM_HOST }}
AMBIENT_PROJECT: ${{ secrets.AMBIENT_PROJECT }}
run: |
if [ -n "$SESSION_NAME" ]; then
gh issue comment ${{ steps.issue.outputs.number }} --repo "${{ github.repository }}" --body "Session \`$SESSION_NAME\` created (phase: $SESSION_PHASE). PR will have the \`ambient-code:managed\` label."
# Build session link β€” prefer session-url output, fall back to constructed URL
if [ -n "$SESSION_URL" ]; then
LINK="$SESSION_URL"
elif [ -n "$PLATFORM_HOST" ] && [ -n "$AMBIENT_PROJECT" ]; then
LINK="${PLATFORM_HOST%/}/projects/$AMBIENT_PROJECT/sessions/$SESSION_NAME"
else
LINK=""
fi

if [ -n "$LINK" ]; then
BODY="πŸ€– Amber session completed (phase: $SESSION_PHASE). [View session]($LINK)"
else
BODY="πŸ€– Amber session \`$SESSION_NAME\` completed (phase: $SESSION_PHASE)."
fi
gh issue comment ${{ steps.issue.outputs.number }} --repo "${{ github.repository }}" --body "$BODY"
fi

- name: Session summary
Expand Down Expand Up @@ -156,6 +199,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Acknowledge comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-X POST -f content=eyes --silent || true

- name: Resolve context
id: context
env:
Expand Down Expand Up @@ -239,7 +289,18 @@ jobs:
6. Do not merge. Do not close. Do not force-push.
7. If fundamentally broken beyond repair, add a comment explaining and stop.
8. When you comment on the PR, include this footer at the end:
_πŸ€– [Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)_
_πŸ€– [Session](<SESSION_URL>)_

## Session URL

IMPORTANT: Wherever a session link is needed (PR body, comments, Slack),
you MUST first resolve the URL by reading the environment variables. Run:
```bash
echo "$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"
```
Use the resolved output as the actual URL. Do NOT write `$PLATFORM_HOST`,
`$AGENTIC_SESSION_NAMESPACE`, or `$AGENTIC_SESSION_NAME` literally in any
markdown link β€” always substitute their actual values.

## Slack Notifications

Expand Down Expand Up @@ -297,12 +358,23 @@ jobs:
<!-- acp:session_id=$AGENTIC_SESSION_NAME source=#${{ steps.context.outputs.number }} last_action=<ISO8601_NOW> retry_count=0 -->
At the bottom of the PR body, add a session link:
---
πŸ€– [Ambient Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)
πŸ€– [Ambient Session](<SESSION_URL>)
6. Add the `ambient-code:managed` label to the PR.
7. Ensure CI passes. If it fails, investigate and fix.
8. Do not merge. Leave the PR open for human review.
9. When you comment on the PR, include this footer at the end:
_πŸ€– [Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)_
_πŸ€– [Session](<SESSION_URL>)_

## Session URL

IMPORTANT: Wherever a session link is needed (PR body, comments, Slack),
you MUST first resolve the URL by reading the environment variables. Run:
```bash
echo "$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"
```
Use the resolved output as the actual URL. Do NOT write `$PLATFORM_HOST`,
`$AGENTIC_SESSION_NAMESPACE`, or `$AGENTIC_SESSION_NAME` literally in any
markdown link β€” always substitute their actual values.
repos: >-
[{"url": "https://github.com/${{ github.repository }}", "branch": "main"}]
model: claude-opus-4-6
Expand Down Expand Up @@ -652,7 +724,18 @@ jobs:
6. Do not merge. Do not close. Do not force-push.
7. If fundamentally broken beyond repair, add a comment explaining and stop.
8. When you comment on the PR, include this footer at the end:
_πŸ€– [Session]($PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME)_
_πŸ€– [Session](<SESSION_URL>)_

## Session URL

IMPORTANT: Wherever a session link is needed (PR body, comments, Slack),
you MUST first resolve the URL by reading the environment variables. Run:
```bash
echo "$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"
```
Use the resolved output as the actual URL. Do NOT write `$PLATFORM_HOST`,
`$AGENTIC_SESSION_NAMESPACE`, or `$AGENTIC_SESSION_NAME` literally in any
markdown link β€” always substitute their actual values.

## Slack Notifications

Expand Down
Loading