Skip to content

Conversation

@hassoncs
Copy link
Contributor

@hassoncs hassoncs commented Oct 17, 2025

This PR builds off my original one, but adds a nice api so the code around most urls looks similar to before:
#3055

With this change, it's super easy to point a local Kilo development extension at a local backend just by changing the run target. This PR does not remove support for the kilocodeToken approach to changing the backendUrl– that's useful for pointing the production extension at local backends

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

⚠️ No Changeset found

Latest commit: 1307886

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hassoncs hassoncs force-pushed the easy-local-backend-env-var branch 4 times, most recently from faf3d24 to 70d8b45 Compare October 17, 2025 19:29
@hassoncs hassoncs marked this pull request as ready for review October 17, 2025 21:16
@hassoncs hassoncs force-pushed the easy-local-backend-env-var branch from 70d8b45 to e9abdd1 Compare October 17, 2025 21:21
@hassoncs hassoncs force-pushed the easy-local-backend-env-var branch from e9abdd1 to 88e66d1 Compare October 20, 2025 23:07
Copy link
Contributor

@pandemicsyn pandemicsyn left a comment

Choose a reason for hiding this comment

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

lgtm. My only question (more for my knowledge), our telemetry client doesn't support this or the o.g. method. Guessing thats because we don't want to accidentally send events while cruising around during development:

const response = await fetch("https://api.kilocode.ai/api/profile", {

Is there a scenario where you'd specify a development KILOCODE_POSTHOG_API_KEY and then still want to use a local backend?

Add KILOCODE_BACKEND_BASE_URL environment variable to enable testing against a local Kilo Code backend. Refactor hardcoded API URLs across providers, webview, and CLI to use getKiloUrl() and getKiloUrlFromToken() functions for dynamic URL resolution. Include new launch configuration and documentation updates for local development workflow.
Replace the generic getKiloUrl function with two specific functions:
- getApiUrl for API endpoints (e.g., /extension-config.json)
- getAppUrl for app/web URLs (e.g., /profile, /support)

This improves type safety and clarity by separating concerns between API and app URL generation.

BREAKING CHANGE: getKiloUrl function removed, use getApiUrl or getAppUrl instead
Move getApiUrl, getAppUrl, and getKiloUrlFromToken functions from src/shared/kilocode/ to packages/types/src/kilocode/kilocode.ts and update all imports across the codebase. This consolidates shared utilities into the types package, reducing duplication and improving maintainability.
@hassoncs hassoncs force-pushed the easy-local-backend-env-var branch from 88e66d1 to 81f1892 Compare October 22, 2025 17:45
- Introduce getExtensionConfigUrl function for extension config endpoint
- Refactor getApiUrl and getAppUrl to use shared buildUrl helper
- Update tests to cover new function and maintain backwards compatibility
- Use getExtensionConfigUrl in Gemini CLI provider instead of hardcoded URL
@hassoncs hassoncs force-pushed the easy-local-backend-env-var branch from 4fa7af7 to 1307886 Compare October 24, 2025 10:05
@hassoncs hassoncs enabled auto-merge (squash) October 24, 2025 10:10
@hassoncs hassoncs merged commit 3aa33b3 into main Oct 24, 2025
14 checks passed
@hassoncs hassoncs deleted the easy-local-backend-env-var branch October 24, 2025 10:15
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.

4 participants