Skip to content

Remove collection of unhandled exception error messages from telemetry#585

Open
singe wants to merge 4 commits into
usestrix:mainfrom
singe:patch-1
Open

Remove collection of unhandled exception error messages from telemetry#585
singe wants to merge 4 commits into
usestrix:mainfrom
singe:patch-1

Conversation

@singe

@singe singe commented Jun 24, 2026

Copy link
Copy Markdown

This PR addresses issue #584

The telemetry collection policy states that error messages are not collected, this PR modifies the code to align it with the telemetry policy.

singe added 3 commits June 24, 2026 07:40
Prevent post hog from collecting error message strings, only exception type.
Remove optional error message parameter from error function.
Remove exception message logging from unhandled exceptions.
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the exception message (str(e)) from unhandled-exception telemetry events to bring the code in line with the stated telemetry policy that error messages are not collected.

  • Both posthog.error and scarf.error have the error_msg parameter removed entirely, and the call sites in main.py are updated to match. The only remaining callers were these two, so there is no risk of a call-site mismatch elsewhere.
  • The except Exception as e: clause in main.py now binds e without ever using it; except Exception: would be cleaner and avoids linter warnings.

Confidence Score: 4/5

Safe to merge; the change is a small, targeted removal of exception message data from telemetry with no functional side-effects.

The telemetry and call-site changes are consistent and complete — grep confirms no other callers pass the now-removed second argument. The only rough edge is that strix/interface/main.py now binds an unused except Exception as e: variable, which is a linter concern but not a runtime problem.

strix/interface/main.py — the unused e binding in the except clause is worth cleaning up before merging.

Important Files Changed

Filename Overview
strix/interface/main.py Removes str(e) from posthog.error and scarf.error calls; exception variable e is now unused in the except clause
strix/telemetry/posthog.py Drops error_msg parameter and the conditional that added it to telemetry props; change is self-contained with no other callers passing a second argument
strix/telemetry/scarf.py Drops error_msg parameter and the conditional that added it to telemetry props; mirrors the posthog.py change symmetrically
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
strix/interface/main.py:823-827
Since `e` is no longer referenced after this change, the except clause now binds an unused variable. Most linters (ruff `E741`/`F841`, flake8) will flag this. The bare `raise` re-raises the active exception without needing `e`.

```suggestion
    except Exception:
        exit_reason = "error"
        posthog.error("unhandled_exception")
        scarf.error("unhandled_exception")
        raise
```

Reviews (1): Last reviewed commit: "Simplify unhandled exception logging" | Re-trigger Greptile

Comment thread strix/interface/main.py Outdated
As it's not longer referenced.
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.

1 participant