Add testnet agent invite URLs - #188
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 11 seconds. ⌛ 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 Run ID: 📒 Files selected for processing (2)
✨ 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 |
|
Claude finished @neekolas's task —— View job Code Review Complete ✅
SummaryThis PR successfully adds testnet-aware agent invite URL construction with clean separation of concerns and good test coverage. The implementation is solid with only minor suggestions for improvement. ✅ StrengthsCode Quality
Test Coverage
Security
🔍 Observations & Minor Suggestions1. Testnet Behavior Documentation (Minor)Location: The Consideration: Is this intentional for testnet? Since testnet gets its own dedicated domain ( Currently:
If testnet should mirror production behavior, you could add a helper like: export function shouldAllowForcedErrors(xmtpEnv: XmtpEnv = XMTP_ENV): boolean {
return xmtpEnv === "dev" || xmtpEnv === "local";
}However, if testnet is meant for integration testing with error simulation, the current implementation is correct. 2. Test Description (Cosmetic)Location: The test description "allows forced errors in dev-like environments only" is placed inside the describe("shouldAllowForcedErrors", () => {
test("allows forced errors in dev-like environments only", () => {
expect(shouldAllowForcedErrors("dev")).toBe(true);
expect(shouldAllowForcedErrors("testnet")).toBe(true);
expect(shouldAllowForcedErrors("local")).toBe(true);
expect(shouldAllowForcedErrors("production")).toBe(false);
});
});3. Domain Mapping Centralization (Optional Enhancement)Location: The domain mapping is currently local to export const XMTP_ENV_DOMAINS: Record<XmtpEnv, string> = {
production: "popup.convos.org",
testnet: "testnet.convos.org",
dev: "dev.convos.org",
local: "dev.convos.org",
} as const;This is only worth doing if the mapping will be reused elsewhere. 📊 Performance & Other ConsiderationsPerformance: ✅ No concerns
Bugs: ✅ None identified
Best Practices: ✅ Followed
RecommendationApprove with optional considerations: The code is production-ready as-is. The suggestions above are minor refinements around testnet behavior clarification and test organization, not blockers. Great work on the clean implementation and thorough testing! 🎉 |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
95c7f7c to
e2145e4
Compare
3eab43d to
09c00e0
Compare
09c00e0 to
5550f93
Compare
ApprovabilityVerdict: Approved Adds testnet environment support for agent invite URL generation by mapping 'testnet' to 'testnet.convos.org'. The logic change for forced errors is a pure refactor to use an existing helper - functionally identical. Simple, additive change with comprehensive unit tests. You can customize Macroscope's approvability policy. Learn more. |

Summary
Adds testnet-aware agent invite URL construction.
XMTP_ENV=productiontopopup.convos.org.XMTP_ENV=testnettotestnet.convos.org.devandlocalondev.convos.org.Verification
bun checkbun test tests/agent-join.test.ts tests/config-environment.test.tsNote
Add testnet domain support to
buildInviteUrlfor agent invite URLsbuildInviteUrlwith an explicit per-environment map:production→popup.convos.org,testnet→testnet.convos.org,dev/local→dev.convos.org.shouldAllowForcedErrorsto gate forced error simulation in the join handler, replacing a directXMTP_ENV !== 'production'check withshouldUseDevBehavior.Macroscope summarized 5550f93.