Skip to content

Merge pull request #446 from websentry-ai/web-6914-discovery-glitchti… - #447

Merged
anonpran merged 1 commit into
mainfrom
staging
Nov 30, 2026
Merged

anonpran merged 1 commit into
mainfrom
staging

Conversation

@anonpran

@anonpran anonpran commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

…p-dual-send

Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914)

Unbound Review · Score 3/5 (1 P1) · 80c73b1

  • codex (own score 3/5): The PR copies discovery error events to GlitchTip and adds separate failure tracking for that destination. However, Sentry’s circuit breaker also stops GlitchTip delivery after repeated Sentry transport failures, even when GlitchTip is healthy. Several new tests also mock the HTTP client contrary to the repository’s testing rule.
  • claude (own score 4/5): The PR moves the Sentry curl POST into a helper, _post_sentry_event. It then copies every event sent to Sentry to a self-hosted GlitchTip DSN, which has its own consecutive-failure circuit breaker (stops sending after repeated failures) and stays inside the caller's max_seconds budget. Setting AI_DISCOVERY_SENTRY_DSN turns the copy off, and tests/init now sets that variable to empty so test runs never send real events. The logic is correc

findings: 0 P0 · 1 P1 · 2 P2 (top 5 P0/P1 inline) · engines: codex ✅ · claude ✅

Findings not posted inline
  • P2 tests/test_discovery_flow.py:824 Use localhost servers for HTTP tests — The new GlitchTip tests mock subprocess.run for curl requests instead of exercising a real local HTTP server. (codex)
  • P2 scripts/coding_discovery_tools/utils.py:3723 GlitchTip copy stops whenever the Sentry breaker trips — The GlitchTip copy only runs after the Sentry-side checks pass. Once _sentry_dead_this_run is set after 3 failed Sentry posts, report_to_sentry returns early and GlitchTip gets nothing more for the rest of the run, except priority events. On a customer network that blocks ingest.us.sentry.io but (claude)

rules applied: CLAUDE.md

…p-dual-send

Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914)
@anonpran
anonpran requested a review from a team November 30, 2026 05:41

@vigneshsubbiah16 vigneshsubbiah16 left a comment

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.

✅ Security consensus: no issues found. (reviewers: Claude, Semgrep, Gitleaks)


🤖 consensus review · reviewers: Claude, Semgrep, Gitleaks · head 80c73b11 · 2026-11-30T05:41Z

finally:
glitchtip_timeout = event_timeout if max_seconds is None else int(
min(event_timeout, max_seconds - (time.monotonic() - post_started)))
_copy_event_to_glitchtip(tmp_path, glitchtip_timeout, priority)

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.

P1 · Keep GlitchTip active when Sentry is unavailable (codex)

After three consecutive Sentry transport failures, subsequent non-priority events return before the GlitchTip copy is attempted. A healthy GlitchTip therefore stops receiving discovery errors for the rest of the run when Sentry is blocked or unavailable.

The Sentry breaker returns at utils.py:3723-3724 before the GlitchTip call at utils.py:3784. Sentry transport failures trip that breaker at utils.py:3793-3798, while GlitchTip has its own separate failure counter at utils.py:3667-3680.

@anonpran
anonpran merged commit eafce8e into main Nov 30, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants