From 3b700dec0659a6eae2136b6685a91308851dd7be Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Fri, 3 Apr 2026 15:25:03 -0500 Subject: [PATCH 1/6] feat: post check runs on PRs with session link When Amber works on a PR (via @ambient-code comment or batch fixer), post a GitHub check run with: - Status: success/failure/neutral based on session phase - Details URL: link directly to the Amber session in the UI This makes sessions visible in the PR checks tab. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/amber-issue-handler.yml | 60 ++++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index c373896f3..f81fa03d3 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -28,6 +28,7 @@ permissions: contents: read issues: write pull-requests: write + checks: write jobs: # -- Issue: labeled ambient-code:auto-fix → fresh session prompt -- @@ -274,10 +275,45 @@ jobs: wait: 'true' timeout: '0' + - name: Post check run on PR + if: >- + always() + && steps.context.outputs.is_fork != 'true' + && steps.context.outputs.type == 'pr' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + SESSION_NAME="${{ steps.fix-session.outputs.session-name || steps.fix-issue-session.outputs.session-name || steps.custom-session.outputs.session-name }}" + SESSION_URL="${{ steps.fix-session.outputs.session-url || steps.fix-issue-session.outputs.session-url || steps.custom-session.outputs.session-url }}" + SESSION_PHASE="${{ steps.fix-session.outputs.session-phase || steps.fix-issue-session.outputs.session-phase || steps.custom-session.outputs.session-phase }}" + + if [ -z "$SESSION_NAME" ]; then + exit 0 + fi + + # Get PR head SHA + HEAD_SHA=$(gh pr view ${{ steps.context.outputs.number }} --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid') + + # Map session phase to check conclusion + case "$SESSION_PHASE" in + Completed|Running) CONCLUSION="success" ;; + Error|Failed) CONCLUSION="failure" ;; + *) CONCLUSION="neutral" ;; + esac + + gh api "repos/${{ github.repository }}/check-runs" \ + -X POST \ + -f "name=Amber Session" \ + -f "head_sha=$HEAD_SHA" \ + -f "status=completed" \ + -f "conclusion=$CONCLUSION" \ + -f "details_url=$SESSION_URL" \ + -f "output[title]=Amber — ${{ steps.context.outputs.prompt_type }} prompt" \ + -f "output[summary]=Session \`$SESSION_NAME\` (phase: $SESSION_PHASE)" || true + - name: Session summary if: always() && steps.context.outputs.is_fork != 'true' run: | - # Get session name from whichever step ran (only one will have output) SESSION_NAME="${{ steps.fix-session.outputs.session-name || steps.fix-issue-session.outputs.session-name || steps.custom-session.outputs.session-name }}" SESSION_PHASE="${{ steps.fix-session.outputs.session-phase || steps.fix-issue-session.outputs.session-phase || steps.custom-session.outputs.session-phase }}" @@ -369,6 +405,24 @@ jobs: print(f" Failed to start session: {e}") return False + def post_check_run(pr_number, session_name, status="in_progress"): + """Post a check run on the PR linking to the Amber session.""" + head_sha = gh("pr", "view", str(pr_number), "--repo", REPO, "--json", "headRefOid", "--jq", ".headRefOid") + if not head_sha: + return + api_url_base = API_URL.rstrip("/").replace("/api", "") + session_url = f"{api_url_base}/projects/{PROJECT}/sessions/{session_name}" + conclusion = "success" if status == "completed" else "neutral" + gh("api", f"repos/{REPO}/check-runs", + "-X", "POST", + "-f", "name=Amber Session", + "-f", f"head_sha={head_sha}", + "-f", "status=completed", + "-f", f"conclusion={conclusion}", + "-f", f"details_url={session_url}", + "-f", "output[title]=Amber — batch fix", + "-f", f"output[summary]=Session `{session_name}` triggered for PR #{pr_number}") + def create_session_api(prompt, session_name="", model="claude-opus-4-6"): """Create a new session or send message to existing one.""" @@ -476,7 +530,9 @@ jobs: 5. Do not merge. Do not close. Do not force-push. 6. If fundamentally broken beyond repair, add a comment explaining and stop.""" - create_session_api(prompt, session_name=session_id) + result_name = create_session_api(prompt, session_name=session_id) + if result_name: + post_check_run(number, result_name) # Increment retry_count in frontmatter so circuit breaker advances if fm: From 848339b6ecdf81adb295cd92050bc0776ae90239 Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Mon, 6 Apr 2026 11:35:18 -0500 Subject: [PATCH 2/6] feat: agent-managed circuit breaker, Slack notifications, log_correction Move circuit breaker logic from GHA shell to agent prompts: - Agent reads/increments retry_count in frontmatter - Agent adds ambient-code:needs-human and removes ambient-code:managed - Agent sends Slack notification when human attention needed Slack notifications sent when: - Circuit breaker fires (3+ retries) - Agent is stuck and can't proceed - AskUserQuestion tool is used Also: - Add log_correction instruction to fix prompts - Pass SLACK_WEBHOOK_URL and PLATFORM_HOST as env vars to sessions - Remove GHA-side frontmatter/circuit-breaker management from batch Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/amber-issue-handler.yml | 94 +++++++++++++++-------- 1 file changed, 63 insertions(+), 31 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index f81fa03d3..2f0eb9473 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -97,6 +97,8 @@ jobs: model: claude-opus-4-6 wait: 'true' timeout: '0' + environment-variables: >- + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} - name: Post-session labels and comment if: steps.existing.outputs.skip != 'true' @@ -207,13 +209,33 @@ jobs: - Are there merge conflicts? Resolve them. - Is CI failing? Read the logs and fix the failures. - Are there review comments (human or bot like CodeRabbit)? Address each comment. - 2. Push fixes. - 3. Ensure the PR body contains this frontmatter as the first line + 2. For each issue you fix, call `log_correction` to record what went wrong and how you fixed it. + 3. Push fixes. + 4. Ensure the PR body contains this frontmatter as the first line (read your session ID from the AGENTIC_SESSION_NAME environment variable): - - 4. Add the `ambient-code:managed` label. - 5. Do not merge. Do not close. Do not force-push. - 6. If fundamentally broken beyond repair, add a comment explaining and stop. + + Increment retry_count from whatever it was before. If retry_count reaches 3 or more, + stop working, add `ambient-code:needs-human` label, remove `ambient-code:managed` label, + comment "AI was unable to resolve after 3 attempts. Needs human attention.", + and send a Slack notification (see below). + 5. Add the `ambient-code:managed` label. + 6. Do not merge. Do not close. Do not force-push. + 7. If fundamentally broken beyond repair, add a comment explaining and stop. + + ## Slack Notifications + + When you need human attention — whether you hit the circuit breaker (3 retries), + you're stuck and can't proceed, or you use the AskUserQuestion tool — send a + Slack notification: + + ```bash + curl -X POST -H 'Content-type: application/json' \ + --data '{"text":"🤖 Amber needs human attention\n*PR*: ${{ steps.context.outputs.url }}\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\n*Reason*: "}' \ + "$SLACK_WEBHOOK_URL" + ``` + + The environment variables SLACK_WEBHOOK_URL, PLATFORM_HOST, AGENTIC_SESSION_NAMESPACE, + and AGENTIC_SESSION_NAME are available in your environment. Only send if SLACK_WEBHOOK_URL is set. # Fix prompt on an issue: @ambient-code alone — investigate and create PR (same as fresh prompt) - name: Run fix prompt (issue) @@ -251,6 +273,8 @@ jobs: model: claude-opus-4-6 wait: 'true' timeout: '0' + environment-variables: >- + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} # Custom prompt: @ambient-code — pass user's text - name: Run custom prompt @@ -274,6 +298,8 @@ jobs: model: claude-opus-4-6 wait: 'true' timeout: '0' + environment-variables: >- + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} - name: Post check run on PR if: >- @@ -342,6 +368,7 @@ jobs: AMBIENT_API_URL: ${{ secrets.AMBIENT_API_URL }} AMBIENT_API_TOKEN: ${{ secrets.AMBIENT_BOT_TOKEN }} AMBIENT_PROJECT: ${{ secrets.AMBIENT_PROJECT }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} run: | pip install --quiet 'requests>=2.31.0' @@ -457,9 +484,17 @@ jobs: # Create new session url = f"{API_URL.rstrip('/')}/projects/{PROJECT}/agentic-sessions" + slack_url = os.environ.get("SLACK_WEBHOOK_URL", "") + platform_host = os.environ.get("AMBIENT_API_URL", "").rstrip("/") + env_vars = {} + if slack_url: + env_vars["SLACK_WEBHOOK_URL"] = slack_url + if platform_host: + env_vars["PLATFORM_HOST"] = platform_host body = {"initialPrompt": prompt, "llmSettings": {"model": model}, - "repos": [{"url": f"https://github.com/{REPO}", "branch": "main"}]} + "repos": [{"url": f"https://github.com/{REPO}", "branch": "main"}], + **({"environmentVariables": env_vars} if env_vars else {})} try: resp = requests.post(url, headers={"Authorization": f"Bearer {API_TOKEN}", "Content-Type": "application/json"}, json=body, timeout=30) @@ -495,13 +530,6 @@ jobs: session_id = fm["session_id"] source = fm["source"] - # Circuit breaker - if fm["retry_count"] >= 3: - print(f"PR #{number}: circuit breaker (retry_count={fm['retry_count']}), adding ambient-code:needs-human") - gh("pr", "edit", str(number), "--repo", REPO, "--add-label", "ambient-code:needs-human", "--remove-label", "ambient-code:managed") - gh("pr", "comment", str(number), "--repo", REPO, "--body", "AI was unable to resolve issues after 3 attempts. Needs human attention.") - continue - # Check for changes using updatedAt from gh pr list (no extra API call) updated_at = pr.get("updatedAt", "") if updated_at and updated_at <= fm["last_action"]: @@ -512,6 +540,7 @@ jobs: # Trigger fix — reuse session if exists, create new if not print(f"PR #{number}: triggering fix (session_id={session_id or 'new'})") + current_retry = fm["retry_count"] if fm else 0 prompt = f"""You are maintaining a pull request. URL: https://github.com/{REPO}/pull/{number} @@ -522,29 +551,32 @@ jobs: - Are there merge conflicts? Resolve them. - Is CI failing? Read the logs and fix the failures. - Are there review comments (human or bot like CodeRabbit)? Address each comment. - 2. Push fixes. - 3. Ensure the PR body contains this frontmatter as the first line + 2. For each issue you fix, call `log_correction` to record what went wrong and how you fixed it. + 3. Push fixes. + 4. Ensure the PR body contains this frontmatter as the first line (read your session ID from the AGENTIC_SESSION_NAME environment variable): - - 4. Add the `ambient-code:managed` label. - 5. Do not merge. Do not close. Do not force-push. - 6. If fundamentally broken beyond repair, add a comment explaining and stop.""" + + The current retry_count is {current_retry}. Increment it by 1. + If retry_count reaches 3 or more, stop working, add `ambient-code:needs-human` label, + remove `ambient-code:managed` label, comment on the PR, and send a Slack notification. + 5. Add the `ambient-code:managed` label. + 6. Do not merge. Do not close. Do not force-push. + 7. If fundamentally broken beyond repair, add a comment explaining and stop. + + ## Slack Notifications + + When you need human attention — circuit breaker, stuck, or using AskUserQuestion — send: + + curl -X POST -H 'Content-type: application/json' \\ + --data '{{"text":"🤖 Amber needs human attention\\n*PR*: https://github.com/{REPO}/pull/{number}\\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\\n*Reason*: "}}' \\ + "$SLACK_WEBHOOK_URL" + + Only send if SLACK_WEBHOOK_URL is set.""" result_name = create_session_api(prompt, session_name=session_id) if result_name: post_check_run(number, result_name) - # Increment retry_count in frontmatter so circuit breaker advances - if fm: - new_count = fm["retry_count"] + 1 - now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") - old_fm = f'acp:session_id={fm["session_id"]} source={fm["source"]} last_action={fm["last_action"]} retry_count={fm["retry_count"]}' - new_fm = f'acp:session_id={fm["session_id"]} source={fm["source"]} last_action={now} retry_count={new_count}' - new_body = body.replace(old_fm, new_fm) - if new_body != body: - gh("pr", "edit", str(number), "--repo", REPO, "--body", new_body) - print(f" Updated frontmatter: retry_count={new_count}, last_action={now}") - processed += 1 print(f"\nBatch complete: {processed} processed, {skipped} skipped") From 9515b3e6c476b600f27b19eed7e1ca6314558cb3 Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Mon, 6 Apr 2026 11:43:33 -0500 Subject: [PATCH 3/6] fix: Slack message says "I need human attention" Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/amber-issue-handler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index 2f0eb9473..cccbd7692 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -230,7 +230,7 @@ jobs: ```bash curl -X POST -H 'Content-type: application/json' \ - --data '{"text":"🤖 Amber needs human attention\n*PR*: ${{ steps.context.outputs.url }}\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\n*Reason*: "}' \ + --data '{"text":"I need human attention\n*PR*: ${{ steps.context.outputs.url }}\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\n*Reason*: "}' \ "$SLACK_WEBHOOK_URL" ``` @@ -568,7 +568,7 @@ jobs: When you need human attention — circuit breaker, stuck, or using AskUserQuestion — send: curl -X POST -H 'Content-type: application/json' \\ - --data '{{"text":"🤖 Amber needs human attention\\n*PR*: https://github.com/{REPO}/pull/{number}\\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\\n*Reason*: "}}' \\ + --data '{{"text":"I need human attention\\n*PR*: https://github.com/{REPO}/pull/{number}\\n*Session*: '"$PLATFORM_HOST/projects/$AGENTIC_SESSION_NAMESPACE/sessions/$AGENTIC_SESSION_NAME"'\\n*Reason*: "}}' \\ "$SLACK_WEBHOOK_URL" Only send if SLACK_WEBHOOK_URL is set.""" From f080c58b1211ac583e965709fa3da7b1b6a67f28 Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Mon, 6 Apr 2026 11:44:59 -0500 Subject: [PATCH 4/6] fix: use dedicated PLATFORM_HOST secret instead of deriving from API URL API URL (e.g. https://api.ambient.ai/api) is not the frontend host. Use a separate PLATFORM_HOST secret for session links in Slack messages. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/amber-issue-handler.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index cccbd7692..7e98804a9 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -98,7 +98,7 @@ jobs: wait: 'true' timeout: '0' environment-variables: >- - {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.PLATFORM_HOST }}"} - name: Post-session labels and comment if: steps.existing.outputs.skip != 'true' @@ -274,7 +274,7 @@ jobs: wait: 'true' timeout: '0' environment-variables: >- - {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.PLATFORM_HOST }}"} # Custom prompt: @ambient-code — pass user's text - name: Run custom prompt @@ -299,7 +299,7 @@ jobs: wait: 'true' timeout: '0' environment-variables: >- - {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.AMBIENT_API_URL }}"} + {"SLACK_WEBHOOK_URL": "${{ secrets.SLACK_WEBHOOK_URL }}", "PLATFORM_HOST": "${{ secrets.PLATFORM_HOST }}"} - name: Post check run on PR if: >- @@ -369,6 +369,7 @@ jobs: AMBIENT_API_TOKEN: ${{ secrets.AMBIENT_BOT_TOKEN }} AMBIENT_PROJECT: ${{ secrets.AMBIENT_PROJECT }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + PLATFORM_HOST: ${{ secrets.PLATFORM_HOST }} run: | pip install --quiet 'requests>=2.31.0' @@ -485,7 +486,7 @@ jobs: # Create new session url = f"{API_URL.rstrip('/')}/projects/{PROJECT}/agentic-sessions" slack_url = os.environ.get("SLACK_WEBHOOK_URL", "") - platform_host = os.environ.get("AMBIENT_API_URL", "").rstrip("/") + platform_host = os.environ.get("PLATFORM_HOST", "").rstrip("/") env_vars = {} if slack_url: env_vars["SLACK_WEBHOOK_URL"] = slack_url From bd72a5487eb28041a5093660d26f8420c319c3f9 Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Mon, 6 Apr 2026 11:46:27 -0500 Subject: [PATCH 5/6] fix: check run status mapping and error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Running session → in_progress check (was incorrectly success) - Only set conclusion when status is completed - Emit ::warning:: on check-run creation failure instead of || true - Batch post_check_run uses in_progress and PLATFORM_HOST for URL Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/amber-issue-handler.yml | 56 +++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index 7e98804a9..8c1c01787 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -320,22 +320,30 @@ jobs: # Get PR head SHA HEAD_SHA=$(gh pr view ${{ steps.context.outputs.number }} --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid') - # Map session phase to check conclusion + # Map session phase to check status/conclusion + CHECK_ARGS=( + -X POST + -f "name=Amber Session" + -f "head_sha=$HEAD_SHA" + -f "details_url=$SESSION_URL" + -f "output[title]=Amber — ${{ steps.context.outputs.prompt_type }} prompt" + -f "output[summary]=Session \`$SESSION_NAME\` (phase: $SESSION_PHASE)" + ) + case "$SESSION_PHASE" in - Completed|Running) CONCLUSION="success" ;; - Error|Failed) CONCLUSION="failure" ;; - *) CONCLUSION="neutral" ;; + Running) + CHECK_ARGS+=(-f "status=in_progress") ;; + Completed) + CHECK_ARGS+=(-f "status=completed" -f "conclusion=success") ;; + Error|Failed) + CHECK_ARGS+=(-f "status=completed" -f "conclusion=failure") ;; + *) + CHECK_ARGS+=(-f "status=completed" -f "conclusion=neutral") ;; esac - gh api "repos/${{ github.repository }}/check-runs" \ - -X POST \ - -f "name=Amber Session" \ - -f "head_sha=$HEAD_SHA" \ - -f "status=completed" \ - -f "conclusion=$CONCLUSION" \ - -f "details_url=$SESSION_URL" \ - -f "output[title]=Amber — ${{ steps.context.outputs.prompt_type }} prompt" \ - -f "output[summary]=Session \`$SESSION_NAME\` (phase: $SESSION_PHASE)" || true + if ! CHECK_OUTPUT=$(gh api "repos/${{ github.repository }}/check-runs" "${CHECK_ARGS[@]}" 2>&1); then + echo "::warning::Failed to create check run: $CHECK_OUTPUT" + fi - name: Session summary if: always() && steps.context.outputs.is_fork != 'true' @@ -433,23 +441,25 @@ jobs: print(f" Failed to start session: {e}") return False - def post_check_run(pr_number, session_name, status="in_progress"): - """Post a check run on the PR linking to the Amber session.""" + def post_check_run(pr_number, session_name): + """Post an in_progress check run on the PR linking to the Amber session.""" head_sha = gh("pr", "view", str(pr_number), "--repo", REPO, "--json", "headRefOid", "--jq", ".headRefOid") if not head_sha: return - api_url_base = API_URL.rstrip("/").replace("/api", "") - session_url = f"{api_url_base}/projects/{PROJECT}/sessions/{session_name}" - conclusion = "success" if status == "completed" else "neutral" - gh("api", f"repos/{REPO}/check-runs", + host = os.environ.get("PLATFORM_HOST", "").rstrip("/") + session_url = f"{host}/projects/{PROJECT}/sessions/{session_name}" if host else "" + args = ["api", f"repos/{REPO}/check-runs", "-X", "POST", "-f", "name=Amber Session", "-f", f"head_sha={head_sha}", - "-f", "status=completed", - "-f", f"conclusion={conclusion}", - "-f", f"details_url={session_url}", + "-f", "status=in_progress", "-f", "output[title]=Amber — batch fix", - "-f", f"output[summary]=Session `{session_name}` triggered for PR #{pr_number}") + "-f", f"output[summary]=Session `{session_name}` triggered for PR #{pr_number}"] + if session_url: + args.extend(["-f", f"details_url={session_url}"]) + result = gh(*args) + if not result and "error" in result.lower() if result else False: + print(f" Warning: failed to create check run for PR #{pr_number}") def create_session_api(prompt, session_name="", model="claude-opus-4-6"): """Create a new session or send message to existing one.""" From 963100a35fada4356435c338558c29abb4c9ed05 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Mon, 6 Apr 2026 12:23:53 -0500 Subject: [PATCH 6/6] Update .github/workflows/amber-issue-handler.yml Co-authored-by: ambient-code[bot] <235912155+ambient-code[bot]@users.noreply.github.com> --- .github/workflows/amber-issue-handler.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/amber-issue-handler.yml b/.github/workflows/amber-issue-handler.yml index 8c1c01787..8de1f63aa 100644 --- a/.github/workflows/amber-issue-handler.yml +++ b/.github/workflows/amber-issue-handler.yml @@ -457,9 +457,9 @@ jobs: "-f", f"output[summary]=Session `{session_name}` triggered for PR #{pr_number}"] if session_url: args.extend(["-f", f"details_url={session_url}"]) - result = gh(*args) - if not result and "error" in result.lower() if result else False: - print(f" Warning: failed to create check run for PR #{pr_number}") + proc = subprocess.run(["gh"] + list(args), capture_output=True, text=True) + if proc.returncode != 0: + print(f" Warning: failed to create check run for PR #{pr_number}: {proc.stderr or proc.stdout}") def create_session_api(prompt, session_name="", model="claude-opus-4-6"): """Create a new session or send message to existing one."""