Switch to using a more compatible docker internal hostname that works cross platform#394
Switch to using a more compatible docker internal hostname that works cross platform#394
Conversation
WalkthroughThe Changes
Poem
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
internal/util/api.go (2)
245-245: Duplication of docker host string
The hostname"host.docker.agentuity.io"is repeated in multiple branches. Extract this value (and the default port values) into package-level constants to keep the code DRY and simplify future updates.
249-249: Use URL parsing instead of regex for port extraction
Rather than matching:(\d+)on the rawurlString, parse the URL once and callu.Port()—this is more robust and clearer.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
internal/util/api.go(1 hunks)internal/util/api_test.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Build and Test (macos-latest)
- GitHub Check: Test CLI Upgrade Path (windows-latest)
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
internal/util/api.go (1)
251-251: Hardcoded fallback port
Always defaulting to:3000could miss custom ports in certain setups. Verify if this meets all scenarios or consider making the default port configurable (or dynamically derived).internal/util/api_test.go (1)
27-30: Align test expectations with updated docker host
The test cases correctly expect"host.docker.agentuity.io"in transformed URLs, matching the updatedTransformUrllogic.
Summary by CodeRabbit
Bug Fixes
Tests