diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml old mode 100644 new mode 100755 index 8e9f83c5b..c08d71136 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -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: @@ -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 @@ -102,12 +117,23 @@ jobs: 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]() 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 + + 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 @@ -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 @@ -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: @@ -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 + + 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 @@ -297,12 +358,23 @@ jobs: 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]() 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 + + 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 @@ -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 + + 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