fix(telemetry): use hosted ingestion proxy#171
Conversation
|
CodeAnt AI is reviewing your PR. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. pr-reviewer could not complete review for #171 in AgentWorkforce/relaycast. |
There was a problem hiding this comment.
Code Review
This pull request updates the default PostHog host from https://us.i.posthog.com to https://i.agentrelay.com in both the engine logger and MCP telemetry modules, and updates or adds corresponding unit tests. The feedback suggests asserting that nodeRequestMock was called in the telemetry tests before accessing its call arguments to prevent cryptic TypeError failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const options = nodeRequestMock.mock.calls[0]?.[0] as { | ||
| hostname: string; | ||
| path: string; | ||
| }; | ||
| expect(options.hostname).toBe('app.posthog.example'); |
There was a problem hiding this comment.
For better test failure messages and consistency with the other tests in this file (e.g., line 107), assert that nodeRequestMock was called before accessing its call arguments. This avoids a cryptic TypeError if the mock was not called.
| const options = nodeRequestMock.mock.calls[0]?.[0] as { | |
| hostname: string; | |
| path: string; | |
| }; | |
| expect(options.hostname).toBe('app.posthog.example'); | |
| expect(nodeRequestMock).toHaveBeenCalledTimes(1); | |
| const options = nodeRequestMock.mock.calls[0]?.[0] as { | |
| hostname: string; | |
| path: string; | |
| }; | |
| expect(options.hostname).toBe('app.posthog.example'); |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/engine/src/lib/logger.ts">
<violation number="1" location="packages/engine/src/lib/logger.ts:7">
P2: Host overrides are not normalized here, so a blank/whitespace `posthogHost` can bypass the default and break log export with a relative URL.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| type LogFields = Record<string, unknown>; | ||
|
|
||
| const DEFAULT_POSTHOG_HOST = 'https://us.i.posthog.com'; | ||
| const DEFAULT_POSTHOG_HOST = 'https://i.agentrelay.com'; |
There was a problem hiding this comment.
P2: Host overrides are not normalized here, so a blank/whitespace posthogHost can bypass the default and break log export with a relative URL.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/engine/src/lib/logger.ts, line 7:
<comment>Host overrides are not normalized here, so a blank/whitespace `posthogHost` can bypass the default and break log export with a relative URL.</comment>
<file context>
@@ -4,7 +4,7 @@ import type { AppEnv, EngineRuntime } from '../env.js';
type LogFields = Record<string, unknown>;
-const DEFAULT_POSTHOG_HOST = 'https://us.i.posthog.com';
+const DEFAULT_POSTHOG_HOST = 'https://i.agentrelay.com';
const DEFAULT_APP_VERSION = '0.1.0';
const DEFAULT_SDK_VERSION = 'unknown';
</file context>
User description
Summary
https://i.agentrelay.comPOSTHOG_HOST/ Relaycast host overrides workingVerification
npm --prefix packages/mcp run test -- src/__tests__/telemetry.test.tsnpm --prefix packages/engine run test -- src/lib/__tests__/logger.test.ts src/lib/__tests__/origin.test.tsCodeAnt-AI Description
Send telemetry and logs through the hosted proxy by default, while still allowing custom host overrides
What Changed
Impact
✅ Centralized telemetry delivery✅ Fewer blocked log and event uploads✅ Existing custom telemetry endpoints still work💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.