Skip to content

feat: post check runs on PRs with Amber session link#1201

Merged
Gkrumbach07 merged 6 commits intomainfrom
feat/amber-check-runs
Apr 6, 2026
Merged

feat: post check runs on PRs with Amber session link#1201
Gkrumbach07 merged 6 commits intomainfrom
feat/amber-check-runs

Conversation

@Gkrumbach07
Copy link
Copy Markdown
Contributor

@Gkrumbach07 Gkrumbach07 commented Apr 3, 2026

[git remote -v]
[git config --get-regexp ^remote..*.gh-resolved$]

[git remote -v]
[git config --get-regexp ^remote..*.gh-resolved$]

[git remote -v]
[git config --get-regexp ^remote..*.gh-resolved$]

Summary

When Amber works on a PR, post a GitHub check run so the session shows up in the PR checks tab with a direct link to the session UI.

Where it posts

  • handle-comment on PR: After any @ambient-code comment triggers a fix/custom session
  • batch-pr-fixer: After each PR is processed in the 30 min cron

What it shows

  • Check name: "Amber Session"
  • Conclusion: success (Completed/Running), failure (Error/Failed), neutral (other)
  • Details URL: Direct link to the session in Ambient UI
  • Summary: Session name, phase, and prompt type

Permissions

Added checks: write to workflow permissions.

Test plan

  • Comment @ambient-code on a PR — verify check appears in PR checks tab
  • Click "Details" on the check — verify it opens the session URL
  • Batch cron processes a PR — verify check appears

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Posts an "Amber Session" status check on pull requests to show session progress and outcome.
    • Sends Slack notifications for circuit-breaker events when a webhook is configured.
  • Behavior Changes

    • Automated corrections must be explicitly logged for each fix to improve visibility.
    • Retry-count and circuit-breaker handling moved into session/frontmatter logic, triggering human review at the threshold.

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) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

Workflow permissions now include checks: write; the workflow and batch fixer inject SLACK_WEBHOOK_URL and PLATFORM_HOST into ambient sessions and batch job environments; circuit-breaker behavior was moved from in-code logic into prompt text; both the workflow and batch-fixer now attempt to post an Amber Session GitHub check-run after session creation.

Changes

Cohort / File(s) Summary
Workflow file
/.github/workflows/amber-issue-handler.yml
Added permissions: checks: write; injected SLACK_WEBHOOK_URL and PLATFORM_HOST into multiple ambient-code/ambient-action@v0.0.4 steps and the batch job environment; added a PR-only "Post check run on PR" step that fetches PR head SHA, maps session phase → check-run status/conclusion, creates an Amber Session check-run via gh api, and tolerates failures (`
Batch fixer / Python
.../batch-pr-fixer.py
Removed in-code circuit-breaker that edited labels/commented when retry_count >= 3; added post_check_run(pr_number, session_name) which queries PR head SHA and creates an Amber Session check-run (includes session link when PLATFORM_HOST present); call post_check_run(...) after create_session_api(...) returns a session name; include environmentVariables with SLACK_WEBHOOK_URL and PLATFORM_HOST in session creation payloads when set.
Action prompts / session instructions
/.github/workflows/amber-issue-handler.yml (PR-fix, issue-to-PR, fresh-session prompts)
Prompts updated to require calling log_correction for each fixed issue; change PR frontmatter guidance from retry_count=0 to retry_count=<N> and instruct incrementing from prior value; move circuit-breaker behavior into prompt text for retry_count >= 3 (add ambient-code:needs-human, remove ambient-code:managed, comment on the PR, and send Slack notification — only if SLACK_WEBHOOK_URL is set).
Other / Metadata Lines changed: +133/-34. No public API declarations modified.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Performance And Algorithmic Complexity ❌ Error PR introduces N+1 API anti-pattern: fetches incomplete PR metadata then makes redundant API calls per PR to fetch headRefOid. Add headRefOid to gh pr list --json fields and pass it as parameter to post_check_run() to reduce API calls from (1+N) to 1 per batch.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title follows Conventional Commits format (feat: scope) and accurately summarizes the main change: posting GitHub check runs on PRs with Amber session links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security And Secret Handling ✅ Passed PR implements secure secret and environment variable handling with GitHub Secrets, proper authentication, regex validation, and no hardcoded credentials or injection vectors.
Kubernetes Resource Safety ✅ Passed PR modifies GitHub Actions workflow file, not Kubernetes resources. Check does not apply.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/amber-check-runs
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/amber-check-runs

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/amber-issue-handler.yml (1)

27-31: ⚠️ Potential issue | 🟠 Major

Scope checks: write to the jobs that post checks.

Line 31 grants checks: write workflow-wide, but only handle-comment and batch-pr-fixer create check runs. Move that grant to job-level permissions on those two jobs so the issue-label path keeps the narrower token it already had. As per coding guidelines, .github/workflows/**/*.{yml,yaml}: "Verify secrets are not exposed and permissions are scoped."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/amber-issue-handler.yml around lines 27 - 31, Top-level
workflow permissions currently include "checks: write"; remove that entry from
the global permissions block and instead add "checks: write" to the job-level
permissions for the two jobs that create check runs: the "handle-comment" job
and the "batch-pr-fixer" job. Keep other top-level permissions (contents: read,
issues: write, pull-requests: write) intact and ensure the two job definitions
each include a permissions map that adds checks: write while inheriting the
necessary narrower tokens for the issue-label path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/amber-issue-handler.yml:
- Around line 304-312: The gh api call that creates the check-run (gh api
"repos/${{ github.repository }}/check-runs" -f ... output[summary]=...)
currently swallows all errors via "|| true"; remove that blanket suppression and
replace it with explicit error handling so failures are not hidden — capture the
gh api exit status and stderr, and if it fails emit a visible warning that
includes the API error/response (and contextual fields like $HEAD_SHA,
$SESSION_NAME, $SESSION_PHASE, $SESSION_URL) while still allowing the step to
continue if you truly want non-blocking behavior.
- Around line 408-425: post_check_run currently posts a check-run to the PR
using the head_sha captured once and hardcodes status=completed; update it to
use the passed status parameter (e.g., replace the "-f", "status=completed" arg
with "-f", f"status={status}") and only include the conclusion field when status
== "completed" (compute conclusion as you already do, but don't force status to
completed). Also ensure the check-run for the final result is posted after Amber
finishes: in create_session_api, continue to queue the session but do not rely
on the earlier-captured head_sha for the final check-run—when the session
completes, call post_check_run again (or re-call gh api within post_check_run)
and re-fetch head_sha with gh("pr","view",...,"headRefOid") so the completion
check-run is attached to the updated commit SHA and uses the proper
status/conclusion derived from the Amber session phase.

---

Outside diff comments:
In @.github/workflows/amber-issue-handler.yml:
- Around line 27-31: Top-level workflow permissions currently include "checks:
write"; remove that entry from the global permissions block and instead add
"checks: write" to the job-level permissions for the two jobs that create check
runs: the "handle-comment" job and the "batch-pr-fixer" job. Keep other
top-level permissions (contents: read, issues: write, pull-requests: write)
intact and ensure the two job definitions each include a permissions map that
adds checks: write while inheriting the necessary narrower tokens for the
issue-label path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6cf682bb-9140-48a7-922a-f713bfeffa7b

📥 Commits

Reviewing files that changed from the base of the PR and between 7270194 and 3b700de.

📒 Files selected for processing (1)
  • .github/workflows/amber-issue-handler.yml

Comment on lines +408 to +425
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}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "amber-issue-handler.yml" | head -20

Repository: ambient-code/platform

Length of output: 108


🏁 Script executed:

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

Repository: ambient-code/platform

Length of output: 112


🏁 Script executed:

sed -n '400,440p' ./.github/workflows/amber-issue-handler.yml

Repository: ambient-code/platform

Length of output: 2246


🏁 Script executed:

sed -n '440,480p' ./.github/workflows/amber-issue-handler.yml

Repository: ambient-code/platform

Length of output: 2365


🏁 Script executed:

sed -n '480,530p' ./.github/workflows/amber-issue-handler.yml

Repository: ambient-code/platform

Length of output: 2471


🏁 Script executed:

sed -n '530,558p' ./.github/workflows/amber-issue-handler.yml

Repository: ambient-code/platform

Length of output: 1552


Check runs posted to wrong commit; status hardcoded and parameter ignored.

create_session_api() returns immediately after queueing the session—it does not wait for Amber to process or push fixes. post_check_run() is then called on line 535 with the current headRefOid (line 410), posting a check run to the pre-fix commit. When Amber later pushes fixes, the check run remains pinned to the old SHA.

Additionally, line 420 hardcodes status=completed regardless of the status parameter (which defaults to in_progress), breaking the intended status reporting. The check run should be reposted after the session completes, with status/conclusion derived from the actual Amber session phase.

Applies to lines 408–425 and the call site at 533–535.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/amber-issue-handler.yml around lines 408 - 425,
post_check_run currently posts a check-run to the PR using the head_sha captured
once and hardcodes status=completed; update it to use the passed status
parameter (e.g., replace the "-f", "status=completed" arg with "-f",
f"status={status}") and only include the conclusion field when status ==
"completed" (compute conclusion as you already do, but don't force status to
completed). Also ensure the check-run for the final result is posted after Amber
finishes: in create_session_api, continue to queue the session but do not rely
on the earlier-captured head_sha for the final check-run—when the session
completes, call post_check_run again (or re-call gh api within post_check_run)
and re-fetch head_sha with gh("pr","view",...,"headRefOid") so the completion
check-run is attached to the updated commit SHA and uses the proper
status/conclusion derived from the Amber session phase.

@ambient-code ambient-code bot added this to the Review Queue milestone Apr 6, 2026
@Gkrumbach07 Gkrumbach07 added the ambient-code:managed PR managed by AI automation label Apr 6, 2026
@ambient-code
Copy link
Copy Markdown
Contributor

ambient-code bot commented Apr 6, 2026

Automated Review Fix — Blocked on Permissions

I attempted to address all three CodeRabbit review comments:

  1. Scope checks: write to job-level — Moved from workflow-wide permissions to job-level on handle-comment and batch-pr-fixer only
  2. Replace || true error swallowing — Added explicit ::warning:: output with contextual fields (HEAD_SHA, SESSION_NAME, PHASE, URL) on failure, while keeping the step non-blocking
  3. Fix post_check_run status parameter — Now uses the passed status parameter instead of hardcoding status=completed, and only includes conclusion field when status == "completed"

However, the push was rejected because this PR modifies .github/workflows/amber-issue-handler.yml and the GitHub App token does not have the workflows permission required to push changes to workflow files. A user with a PAT that includes the workflows scope will need to push this commit.

The fix commit is ready locally: 125b6ea ("fix: address CodeRabbit review comments on check run posting").

@Gkrumbach07
Copy link
Copy Markdown
Contributor Author

@ambient-code please just make the changes as inline code suggestions

Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing all CodeRabbit review comments.

Note on permissions scoping: The checks: write at line 31 should be removed from workflow-level and added as job-level permissions on handle-comment (after line 134) and batch-pr-fixer (after line 332). These lines are outside the diff so I can't post inline suggestions — the change would be:

On handle-comment (after line 134), add:

    permissions:
      contents: read
      issues: write
      pull-requests: write
      checks: write

On batch-pr-fixer (after line 332), add:

    permissions:
      contents: read
      pull-requests: write
      checks: write

And remove checks: write from the workflow-level permissions block (line 31).

Comment on lines +304 to +312
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't swallow check-run creation errors.

Replace || true with captured output + ::warning:: so failures are visible in the Actions log while keeping the step non-blocking.

Suggested change
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" \
-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)" 2>&1); then
echo "::warning::Failed to post check run (HEAD_SHA=$HEAD_SHA, SESSION=$SESSION_NAME, PHASE=$SESSION_PHASE, URL=$SESSION_URL): $CHECK_OUTPUT"
fi

Comment on lines +408 to +425
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}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix post_check_run: honor the status parameter and only include conclusion when completed.

The current code hardcodes status=completed (line 420) and ignores the status parameter. This fix passes through the actual status and only adds conclusion for completed runs.

Suggested change
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 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}"
args = [
"api", f"repos/{REPO}/check-runs",
"-X", "POST",
"-f", "name=Amber Session",
"-f", f"head_sha={head_sha}",
"-f", f"status={status}",
"-f", f"details_url={session_url}",
"-f", "output[title]=Amber — batch fix",
"-f", f"output[summary]=Session `{session_name}` triggered for PR #{pr_number}",
]
if status == "completed":
args.extend(["-f", "conclusion=success"])
gh(*args)

@ambient-code
Copy link
Copy Markdown
Contributor

ambient-code bot commented Apr 6, 2026

Status Update — Push Blocked by GitHub Permissions

All 3 CodeRabbit review comments have been addressed in a local commit (125b6ea), but pushing is blocked because this PR modifies .github/workflows/amber-issue-handler.yml and the GitHub App installation token does not support the workflows scope (this is a GitHub platform limitation — only PATs can push workflow file changes).

Changes ready (commit 125b6ea):

  1. Scoped checks: write to job-level — Removed from workflow-wide permissions, added to handle-comment and batch-pr-fixer jobs only.
  2. Replaced || true with ::warning:: — Check-run API failures now emit a visible warning with context (HEAD_SHA, SESSION_NAME, PHASE, URL) instead of being silently swallowed.
  3. Fixed post_check_run status parameter — Now uses the passed status parameter instead of hardcoding status=completed, and only includes conclusion when status == "completed".

To unblock:

A contributor with a PAT that has the workflows scope needs to push this commit, or apply the inline code suggestions posted in the previous review.

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) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/amber-issue-handler.yml (1)

72-72: ⚠️ Potential issue | 🟠 Major

Pin actions to commit SHA instead of tag.

ambient-code/ambient-action is used at lines 72, 195, 247, and 285 with tag v0.0.4. Per coding guidelines, action versions must be pinned to SHA. Tags are mutable and can be overwritten.

Replace with commit SHA 1204c23cd7f193bd056c11d13634b3c5a08d142a (v0.0.4):

Diff (applies to all four occurrences)
-        uses: ambient-code/ambient-action@v0.0.4
+        uses: ambient-code/ambient-action@1204c23cd7f193bd056c11d13634b3c5a08d142a
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/amber-issue-handler.yml at line 72, Replace the mutable
tag usage ambient-code/ambient-action@v0.0.4 with the pinned commit SHA
ambient-code/ambient-action@1204c23cd7f193bd056c11d13634b3c5a08d142a at every
occurrence (the four places that currently reference
ambient-code/ambient-action@v0.0.4) so the workflow uses the exact commit
instead of a mutable tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/amber-issue-handler.yml:
- Around line 324-328: The case block incorrectly maps SESSION_PHASE "Running"
to a completed "success" CONCLUSION; change the logic to set a separate STATUS
(e.g., STATUS variable) and only set CONCLUSION when the session is finished:
for "Running" set STATUS="in_progress" and leave CONCLUSION empty/unset, for
"Completed" set STATUS="completed" and CONCLUSION="success", and for "Error" or
"Failed" set STATUS="completed" and CONCLUSION="failure"; update references to
SESSION_PHASE, CONCLUSION and any downstream use that posts the check to use
STATUS for posting status and CONCLUSION only when present.

---

Outside diff comments:
In @.github/workflows/amber-issue-handler.yml:
- Line 72: Replace the mutable tag usage ambient-code/ambient-action@v0.0.4 with
the pinned commit SHA
ambient-code/ambient-action@1204c23cd7f193bd056c11d13634b3c5a08d142a at every
occurrence (the four places that currently reference
ambient-code/ambient-action@v0.0.4) so the workflow uses the exact commit
instead of a mutable tag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5ca5b1f1-69e4-4453-90b5-34e6e9ed5d2d

📥 Commits

Reviewing files that changed from the base of the PR and between 3b700de and 848339b.

📒 Files selected for processing (1)
  • .github/workflows/amber-issue-handler.yml

Ambient Code Bot and others added 3 commits April 6, 2026 11:43
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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) <noreply@anthropic.com>
- 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) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/amber-issue-handler.yml (1)

72-72: Pin first-party action to SHA for reproducibility.

ambient-code/ambient-action@v0.0.4 uses a tag. While this is a first-party action, SHA pinning prevents drift if the tag is moved.

-        uses: ambient-code/ambient-action@v0.0.4
+        uses: ambient-code/ambient-action@<full-sha-here>  # v0.0.4

Applies to all four uses (lines 72, 195, 247, 285). As per coding guidelines: "Pin action versions to SHA."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/amber-issue-handler.yml at line 72, Replace the tag-based
action reference "ambient-code/ambient-action@v0.0.4" with the corresponding
commit SHA to pin the action for reproducibility; update all occurrences of the
string (the four uses of ambient-code/ambient-action) to the specific SHA form
"ambient-code/ambient-action@<commit-sha>" so the workflow uses an immutable
reference.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/amber-issue-handler.yml:
- Around line 460-462: The current check around the gh() call never triggers
because the boolean expression is malformed and also ignores stderr; change the
logic to detect failure by treating an empty result OR any "error" substring in
result.lower() as a failure and print the warning for that PR (i.e., replace the
condition with something like: if not result or "error" in result.lower()), and
update the gh invocation to capture stderr (or use the underlying subprocess
call with capture_output/stderr redirected into the captured output) so API
errors emitted to stderr are available in result for the string check;
reference: the gh() call, the result variable, and pr_number for the warning.

---

Nitpick comments:
In @.github/workflows/amber-issue-handler.yml:
- Line 72: Replace the tag-based action reference
"ambient-code/ambient-action@v0.0.4" with the corresponding commit SHA to pin
the action for reproducibility; update all occurrences of the string (the four
uses of ambient-code/ambient-action) to the specific SHA form
"ambient-code/ambient-action@<commit-sha>" so the workflow uses an immutable
reference.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 23666f18-3fad-4611-b4b4-e4e5e0b5e120

📥 Commits

Reviewing files that changed from the base of the PR and between 848339b and bd72a54.

📒 Files selected for processing (1)
  • .github/workflows/amber-issue-handler.yml

@Gkrumbach07
Copy link
Copy Markdown
Contributor Author

@ambient-code

Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing new CodeRabbit comment about broken error detection in post_check_run.

Co-authored-by: ambient-code[bot] <235912155+ambient-code[bot]@users.noreply.github.com>
@Gkrumbach07 Gkrumbach07 merged commit 70171b4 into main Apr 6, 2026
13 checks passed
@Gkrumbach07 Gkrumbach07 deleted the feat/amber-check-runs branch April 6, 2026 17:57
@ambient-code ambient-code bot removed this from the Review Queue milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ambient-code:managed PR managed by AI automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant