Fix daily token report: add list_events fallback when search_events LLM provider unavailable#32356
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…available Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix daily token consumption report workflow failure
Fix daily token report: add list_events fallback when search_events LLM provider unavailable
May 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the daily token consumption report workflow so it can still query Sentry telemetry when the agent-dependent search_events tool is unavailable (e.g., no embedded LLM provider configured).
Changes:
- Add
list_events/list_issue_eventsto the Sentry MCP allowlist as non-LLM fallbacks. - Update the daily token report instructions to use
search_eventsfirst, then fall back tolist_eventswith direct Sentry query syntax. - Propagate the new allowed tools into the compiled lockfile configuration.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/shared/mcp/sentry.md | Adds Sentry MCP tool allowlist entries for list_events / list_issue_events fallback usage. |
| .github/workflows/daily-token-consumption-report.md | Documents the search_events → list_events fallback flow and suggested query/fields for token telemetry. |
| .github/workflows/daily-token-consumption-report.lock.yml | Updates the compiled workflow to allow and pass through the new Sentry tools in all allowlist locations. |
| .github/workflows/ci-coach.lock.yml | Contains substantial lockfile regeneration/version changes not described in the PR’s stated scope. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 3
| - search_events | ||
| - search_issues | ||
| - list_events # fallback when search_events is unavailable (no LLM provider) | ||
| - list_issue_events # fallback when search_issue_events is unavailable (no LLM provider) |
Comment on lines
+71
to
+72
| - `dataset: spans` | ||
| - `query`: a filter for AI/LLM spans with token data; start with `span.op:ai*` and also try `span.op:gen_ai*` if the first returns no results; if neither matches, try an empty query and filter client-side for records with token fields |
Comment on lines
+1
to
5
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"fb33cbef9f16561a838cbfc9820e7d4e1dab77f376c0602477d75fd7dcbe9f69","strict":true,"agent_id":"copilot"} | ||
| # gh-aw-manifest: {"version":1,"secrets":["GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_GRAFANA_HEADERS","GH_AW_OTEL_SENTRY_ENDPOINT","GH_AW_OTEL_SENTRY_HEADERS","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.46"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.46"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.25.46"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.46"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.9","digest":"sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.9@sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} | ||
| # ___ _ _ | ||
| # / _ \ | | (_) | ||
| # | |_| | __ _ ___ _ __ | |_ _ ___ |
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix
What was the bug?
search_eventsin@sentry/mcp-server@0.33.0is an agent-dependent tool — it requires an embedded LLM provider (OPENAI_API_KEY/ANTHROPIC_API_KEY). WhenSENTRY_OPENAI_API_KEYis absent, the MCP server silently replacessearch_eventswithlist_events(direct Sentry query syntax, no LLM). The workflow only knew aboutsearch_events, so it emitted amissing_toolfailure.How did you fix it?
shared/mcp/sentry.md: Addedlist_eventsandlist_issue_eventsto theallowedtool list as explicit fallbacks.daily-token-consumption-report.md: Updated Step 2 to attemptsearch_eventsfirst, then fall back tolist_eventswith direct Sentry query syntax whensearch_eventsis absent:Includes guidance to drop unrecognized fields and retry if the query errors.
daily-token-consumption-report.lock.yml: Propagated the new tools to all three hardcoded allowlist locations in the lock file — the MCP gateway JSON config, the commented tool reference block, and the--allowed-toolsflag on the Claude harness invocation.