Repository navigation
Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914) - #446
Merged
Merged
Conversation
Each event report_to_sentry posts is also posted, with the same event_id, to the GlitchTip project. The copy has its own failure counter, so a blocked GlitchTip host cannot switch Sentry reporting off. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
vigneshsubbiah16
left a comment
Contributor
There was a problem hiding this comment.
🛡️ Automated Security Review (consensus)
1 finding — 0 high-confidence, 1 to triage. Reviewers: Claude (lead), Semgrep, Gitleaks.
- [LOW] GlitchTip DSN is hardcoded with no env override 🟡 —
scripts/coding_discovery_tools/utils.py:3343- What:
_GLITCHTIP_DSNis a fixed literal. The Sentry DSN next to it can be overridden withAI_DISCOVERY_SENTRY_DSN, but this one cannot be overridden, rotated or turned off on its own. - Why: A DSN key is a public ingest key, not a secret, which is why Gitleaks did not flag it. But this one ships inside an agent that runs on customer endpoints. Anyone can pull it from the script and flood the self-hosted
sentry.unboundsecurity.aiproject 7 with fake events. That uses up the server's storage and capacity and pollutes the trial data. Rotating the key or stopping the copy means shipping a new agent release, and old agents keep posting with the old key until it is revoked on the server. - Fix: Read it as
os.environ.get("AI_DISCOVERY_GLITCHTIP_DSN", "<default>"), the same way_SENTRY_DSNis read. Also turn on rate limits or event quotas for that project on the GlitchTip server. - Flagged by: Claude
- What:
🤖 consensus review · reviewers: Claude, Semgrep, Gitleaks · head fe4d5a1e · 2026-11-30T04:24Z
Contributor
Author
|
/review code |
Also fixes the time-budget test on Windows, where the coarse clock let the copy through, and moves the main copy test onto real local servers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Author
|
/review code |
vigneshsubbiah16
left a comment
Contributor
There was a problem hiding this comment.
✅ Security consensus: no issues found. (reviewers: claude, semgrep, gitleaks)
🤖 consensus review · reviewers: Claude, Semgrep, Gitleaks · head 0fc1c218 · 2026-11-30T04:52Z
pugazhendhi-m
approved these changes
Nov 30, 2026
anonpran
added a commit
that referenced
this pull request
Nov 30, 2026
…p-dual-send (#447) Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914)
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.
Summary
coding-discovery-prod) as well as Sentry, with the sameevent_id, for the Sentry vs GlitchTip trial.Changes
_GLITCHTIP_DSN, plus_post_sentry_event(the existing curl call, extracted) and_copy_event_to_glitchtipscripts/coding_discovery_tools/utils.pyscripts/coding_discovery_tools/utils.pymax_secondsbudget and is skipped when under 1 secondscripts/coding_discovery_tools/utils.pyAI_DISCOVERY_SENTRY_DSNis set, so pointing Sentry at another project never copies into prod GlitchTipscripts/coding_discovery_tools/utils.pyAI_DISCOVERY_SENTRY_DSNdefaults to empty for every test process and its children, which turns off Sentry and the copytests/__init__.pytests/test_discovery_flow.pyGood to know
sentry.unboundsecurity.ai, a run spends at most about 12 extra seconds (3 attempts of 3 s, plus one for the end-of-run priority event) before the counter stops further attempts.curlruns without-f, as before, so an HTTP 4xx from either host still counts as sent. Delivery is checked server side by comparing event IDs.Why: leadership wants to move from Sentry to self-hosted GlitchTip, and this agent is the only active Sentry project that was not in the trial.
🤖 Generated with Claude Code
Unbound Review · Score 4/5 (P2s only) ·
0fc1c21findings: 0 P0 · 0 P1 · 1 P2 (top 5 P0/P1 inline) · engines: codex ✅ · claude ✅
Findings not posted inline
tests/test_discovery_flow.py:825Use real HTTP servers for transport tests — The new transport tests mock subprocess.run instead of exercising HTTP against a local server. This bypasses the repository's required HTTP testing approach and cannot verify the actual curl requests in those cases. (codex+claude)rules applied: CLAUDE.md