agentops
agentops copied to clipboard
Fix local development console errors
📥 Pull Request
📘 Description This PR addresses the excessive console errors in local development mode by:
- Gating PostHog initialization to only run in production or when explicitly enabled via
NEXT_PUBLIC_ENABLE_POSTHOG_IN_DEV=true. - Adding checks to
signinandsimple-loginpages to prevent unnecessary/opsboard/users/meAPI calls (and subsequent 401 errors) when nosession_idcookie is present. - Removing an unused PostHog import.
These changes significantly reduce console noise, improving the local development experience.
🧪 Testing
- Without logging in: Hard refresh
/signinor/simple-login. Verify that the console is clean, with no PostHog 401/404 errors or/opsboard/users/me401 errors. - After logging in: Log in as a user. Verify that the application functions normally and that relevant requests (including
/opsboard/users/me) are made without the previous noise. - (Optional) Enable PostHog in dev: Set
NEXT_PUBLIC_ENABLE_POSTHOG_IN_DEV=truein.env.localand provide PostHog keys. Verify PostHog initializes and sends events in dev mode.
Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents