Skip to content

fix(cloud-agent-next): translate local backend URLs#3282

Merged
eshurakov merged 1 commit into
mainfrom
stump-ogre
May 18, 2026
Merged

fix(cloud-agent-next): translate local backend URLs#3282
eshurakov merged 1 commit into
mainfrom
stump-ogre

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

Summary

  • Keep local Cloud Agent backend URL examples as worker-reachable localhost values.
  • Translate localhost backend and provider URLs to host.docker.internal only when injecting sandbox env/config.
  • Preserve those worker-local defaults in dev env sync and cover the behavior with tests.

Verification

N/A - no manual verification performed; this is local dev URL/env shaping with no UI flow.

Visual Changes

N/A

Reviewer Notes

The key boundary is that worker-side local fetches still use localhost, while sandbox-injected values are rewritten for Docker container reachability.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 15, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

All changes are correct and well-scoped: the backendUrlForSandbox function is correctly implemented, the env-sync WORKER_LOCALHOST_URL_KEYS whitelist approach is sound, and both test suites cover the behaviour thoroughly.

Files Reviewed (4 files)
  • services/cloud-agent-next/src/session-service.ts — New backendUrlForSandbox export: correctly swaps localhost/127.0.0.1 hostname to host.docker.internal; trailing-slash normalisation via .replace(/\/$/, '') handles the URL API's root-path / addition cleanly. Applied at both KILOCODE_BACKEND_BASE_URL/KILO_API_URL assignment and KILO_OPENROUTER_BASEproviderOptions.baseURL.
  • services/cloud-agent-next/src/session-service.test.ts — Integration test verifies all three env vars are translated; backendUrlForSandbox unit tests cover localhost, 127.0.0.1, path-suffixed URL, remote URL passthrough, and non-URL passthrough.
  • dev/local/env-sync/parse.tsWORKER_LOCALHOST_URL_KEYS whitelist correctly triggers only when the example default itself contains localhost/127.0.0.1, preserving worker-reachable values during env-sync while the existing host.docker.internal and LAN-IP branches remain unchanged.
  • services/cloud-agent-next/.dev.vars.example — Updated comments and default values (localhost:3000) match the new dev-time intent.

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 1,316,156 tokens

Review guidance: REVIEW.md from base branch main

Copy link
Copy Markdown
Contributor

@jeanduplessis jeanduplessis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed final combined diff, PR body, and unresolved review-thread state. No issues found.

@eshurakov eshurakov merged commit 3646a8b into main May 18, 2026
13 checks passed
@eshurakov eshurakov deleted the stump-ogre branch May 18, 2026 07:54
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.

2 participants