From 0706620761e3274a8345f59a68b3801c39157837 Mon Sep 17 00:00:00 2001 From: Steven Gates Date: Tue, 23 Jun 2026 14:56:06 -0500 Subject: [PATCH 1/2] fix(crashlytics-autotriage): trigger on `labeled` only (kill duplicate runs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow triggered on both `opened` and `labeled`, so an issue created *with* the crashlytics-auto label fired two triage runs — doubling Claude API spend per crash. Trigger on `labeled` only: the Cloud Function applies the label when it files a crash, so `labeled` reliably catches every case, and a human can still add the label to an existing issue. Also refreshes the stale "NOT YET ENABLED" header comment. --- .github/workflows/crashlytics-autotriage.yml | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/crashlytics-autotriage.yml b/.github/workflows/crashlytics-autotriage.yml index c7bce33..480f451 100644 --- a/.github/workflows/crashlytics-autotriage.yml +++ b/.github/workflows/crashlytics-autotriage.yml @@ -1,18 +1,21 @@ name: Crashlytics auto-triage # ============================================================================ -# DRAFT — NOT YET ENABLED. Pending owner sign-off of docs/PRD-crashlytics-autotriage.md. -# Do not enable until the secrets / service account in the PRD exist. +# ENABLED — Phase 0 (triage + draft PR). See docs/PRD-crashlytics-autotriage.md and +# docs/FIREBASE.md for the full design and runbook. # -# Trigger: a Crashlytics-sourced GitHub issue (created by the Cloud Function in functions/) -# carrying the `crashlytics-auto` label is opened. Claude reads the crash via the Firebase -# MCP server, posts a root-cause comment, and — when confident — opens a DRAFT PR with a -# first-pass fix. Nothing is ever auto-merged. See the PRD for the full design. +# Trigger: when an issue is LABELED `crashlytics-auto`. The Cloud Function applies that +# label when it files a crash; a human can also add it to an existing issue. Claude reads +# the crash via the Firebase MCP server, posts a root-cause comment, and — when confident — +# opens a DRAFT PR with a first-pass fix. Nothing is ever auto-merged. +# +# We trigger ONLY on `labeled` (not `opened`) so an issue created-with-label fires exactly +# one triage run instead of two (which would double the Claude API spend per crash). # ============================================================================ on: issues: - types: [opened, labeled] + types: [labeled] workflow_dispatch: inputs: issue_number: @@ -31,12 +34,10 @@ concurrency: jobs: triage: - # Only run for Crashlytics-sourced issues (label gate) or an explicit manual dispatch, - # so human-filed issues never spend tokens. + # Only run when the `crashlytics-auto` label is applied, or on an explicit manual dispatch, + # so other labels and human-filed issues never spend tokens. if: > github.event_name == 'workflow_dispatch' || - (github.event.action == 'opened' && - contains(join(github.event.issue.labels.*.name, ','), 'crashlytics-auto')) || (github.event.action == 'labeled' && github.event.label.name == 'crashlytics-auto') runs-on: ubuntu-latest env: From 8fec9b6cf94f1228136f2ceacff255d356815a12 Mon Sep 17 00:00:00 2001 From: Steven Gates Date: Tue, 23 Jun 2026 15:00:22 -0500 Subject: [PATCH 2/2] fix(crashlytics-autotriage): activate Crashlytics MCP tool group (--only crashlytics) The Crashlytics tools are experimental and NOT in the Firebase MCP server's default tool set (verified: `mcp --generate-tool-list` shows 63 tools, none crashlytics; `--only crashlytics` surfaces crashlytics_get_issue/list_events/etc). Without this flag the server connects but the crashlytics_* tools never appear, so Claude triages with no stacktrace (observed on issue #87). Core tools remain available alongside the crashlytics group. --- .github/firebase-mcp.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/firebase-mcp.json b/.github/firebase-mcp.json index 108d027..8859083 100644 --- a/.github/firebase-mcp.json +++ b/.github/firebase-mcp.json @@ -1,9 +1,9 @@ { - "_comment": "DRAFT — Firebase MCP server config for the crashlytics-autotriage workflow. See docs/PRD-crashlytics-autotriage.md. Requires Application Default Credentials (provided by google-github-actions/auth) with roles/firebasecrashlytics.viewer.", + "_comment": "Firebase MCP server config for the crashlytics-autotriage workflow. `--only crashlytics` activates the (experimental) Crashlytics tool group — it is NOT in the default tool set, so without it the crashlytics_* tools never surface. Requires Application Default Credentials (from google-github-actions/auth) on a service account with roles/firebasecrashlytics.viewer. See docs/PRD-crashlytics-autotriage.md.", "mcpServers": { "firebase": { "command": "npx", - "args": ["-y", "firebase-tools@latest", "mcp", "--dir", ".", "--project", "openloop-8c266"] + "args": ["-y", "firebase-tools@latest", "mcp", "--dir", ".", "--project", "openloop-8c266", "--only", "crashlytics"] } } }