Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ INTERNAL_API_SECRET=changeme
# Git token service persisted-authorization disconnect
GIT_TOKEN_SERVICE_API_URL=http://localhost:8802
# Worker URLs (defaults shown, workers are optional)
CLOUD_AGENT_API_URL=http://localhost:8788
WEBHOOK_AGENT_URL=http://localhost:8793
MODEL_EVAL_INGEST_URL=http://localhost:8798
SESSION_INGEST_WORKER_URL=
Expand Down
51 changes: 2 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
timeout-minutes: 5
outputs:
kilocode_backend: ${{ steps.filter.outputs.kilocode_backend }}
cloud_agent: ${{ steps.filter.outputs.cloud_agent }}
cloud_agent_next: ${{ steps.filter.outputs.cloud_agent_next }}
workspace_matrix: ${{ steps.workspaces.outputs.matrix }}
steps:
Expand Down Expand Up @@ -63,15 +62,13 @@ jobs:
- 'packages/worker-utils/**'
- 'package.json'
- 'pnpm-lock.yaml'
cloud_agent:
- 'services/cloud-agent/**'
cloud_agent_next:
- 'services/cloud-agent-next/**'

- name: Detect changed workspaces with tests
id: workspaces
run: |
matrix=$(scripts/changed-workspaces.sh --exclude services/cloud-agent --exclude services/cloud-agent-next --exclude apps/web)
matrix=$(scripts/changed-workspaces.sh --exclude services/cloud-agent-next --exclude apps/web)
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"

typecheck:
Expand Down Expand Up @@ -301,40 +298,6 @@ jobs:
NODE_OPTIONS: '--max-old-space-size=8192'
run: pnpm run build

cloud-agent:
needs: [changes, typecheck, lint, format-check, drizzle-check]
if: needs.changes.outputs.cloud_agent == 'true'
runs-on: ${{ vars.RUNNER_LARGE_LABEL || 'ubuntu-24.04-8core' }}
timeout-minutes: 15
steps:
- uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true

- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build wrapper bundle
working-directory: services/cloud-agent/wrapper
run: bun run build.ts

- name: Run cloud-agent tests
run: pnpm --filter cloud-agent test:all

cloud-agent-next:
needs: [changes, typecheck, lint, format-check, drizzle-check]
if: needs.changes.outputs.cloud_agent_next == 'true'
Expand Down Expand Up @@ -403,17 +366,7 @@ jobs:
notify-main-failure:
if: ${{ always() && github.ref == 'refs/heads/main' && contains(join(needs.*.result, ','), 'failure') }}
needs:
[
typecheck,
lint,
format-check,
drizzle-check,
test,
build,
cloud-agent,
cloud-agent-next,
workspace-tests,
]
[typecheck, lint, format-check, drizzle-check, test, build, cloud-agent-next, workspace-tests]
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 5
steps:
Expand Down
1 change: 0 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@
},
{
"files": [
"services/cloud-agent/src/session/queries/*.ts",
"services/cloud-agent-next/src/session/queries/*.ts",
"services/gastown/**/*.ts",
"services/wasteland/**/*.ts",
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ AI inference works locally without any extra services. The Next.js app includes

### Running workers locally

Each worker in the workspace can be started individually with `wrangler dev` (or `pnpm dev`) from its directory. Workers communicate with Next.js over HTTP using env vars like `CLOUD_AGENT_API_URL`, `CODE_REVIEW_WORKER_URL`, etc. Dev ports are defined in each worker's `wrangler.jsonc`.
Each worker in the workspace can be started individually with `wrangler dev` (or `pnpm dev`) from its directory. Workers communicate with Next.js over HTTP using env vars like `CLOUD_AGENT_NEXT_API_URL`, `CODE_REVIEW_WORKER_URL`, etc. Dev ports are defined in each worker's `wrangler.jsonc`.

The easiest way to run workers is with `pnpm dev:start` (see [Common Development Commands](#common-development-commands)), which starts groups of related services in a tmux dashboard.

Expand Down Expand Up @@ -435,7 +435,7 @@ If `CF_AE_TOKEN` is missing, Grafana will still boot — only dashboard queries

- **Service bindings** resolve locally for Workers launched together by `pnpm dev:start` when the bound target is running. Bindings to optional services remain unavailable unless their owning group is started (for example, session-ingest -> o11y requires the `observability` group).
- **Webhook → KiloClaw Chat** triggers require the KiloClaw worker running on port 8795. The webhook worker calls it via `KILOCLAW_API_URL` (HTTP, not a service binding) to deliver messages to Stream Chat. Stream Chat credentials (`STREAM_CHAT_API_KEY`, `STREAM_CHAT_API_SECRET`) must be in `kiloclaw/.dev.vars`.
- **Cloudflare Containers** (used by cloud-agent, cloud-agent-next, app-builder) always run on Cloudflare's remote infrastructure, even in dev mode. Purely local execution is not possible.
- **Cloudflare Containers** (used by Cloud Agent Next and App Builder) always run on Cloudflare's remote infrastructure, even in dev mode. Purely local execution is not possible.
- **Analytics Engine writes** are no-ops in `wrangler dev` — there is no local AE simulator. Reads against the real prod datasets still work via the local Grafana above. **Pipelines** and **dispatch namespaces** don't work locally.

### What works without running any workers
Expand Down
22 changes: 8 additions & 14 deletions ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ This document lists all environment variables used in the Kilo Code cloud monore
- `POSTGRES_MAX_QUERY_TIME` - Max allowed query time in ms. [SERVER]
- `USE_PRODUCTION_DB` - Forces use of the production DB URL in non-production contexts; used by `packages/db/src/database-url.ts`. [SERVER]
- `DATABASE_CA` - CA certificate content (PEM) for TLS connections to Postgres; used by `packages/db/src/database-url.ts` in tests and scripts. [SERVER]
- `DATABASE_URL` - Generic/alternate Postgres URL used by E2E tests and some services (`cloud-agent`, `kiloclaw`). `[SECRET]`
- `DATABASE_URL` - Generic/alternate Postgres URL used by E2E tests and some services (`cloud-agent-next`, `kiloclaw`). `[SECRET]`

### Redis & Queue

Expand Down Expand Up @@ -193,10 +193,8 @@ This document lists all environment variables used in the Kilo Code cloud monore
- `USER_DEPLOYMENTS_DISPATCHER_URL` - URL for the deployments dispatcher (local dev). [SERVER]
- `USER_DEPLOYMENTS_ENV_VARS_PUBLIC_KEY` - Public key for encrypting user deployment env vars. [SERVER]
- `USER_DEPLOYMENTS_ENV_VARS_PRIVATE_KEY` - Private key counterpart for decrypting user deployment env vars. `[SECRET]`
- `CLOUD_AGENT_API_URL` - URL for Cloud Agent Next API; used by App Builder chat and other clients. [SERVER]
- `CLOUD_AGENT_NEXT_API_URL` - Alias for `CLOUD_AGENT_API_URL` in local dev overrides. [SERVER]
- `NEXT_PUBLIC_CLOUD_AGENT_WS_URL` - WebSocket URL for Cloud Agent (legacy) from browser. [PUBLIC]
- `NEXT_PUBLIC_CLOUD_AGENT_NEXT_WS_URL` - WebSocket URL for Cloud Agent Next from browser. [PUBLIC]
- `CLOUD_AGENT_NEXT_API_URL` - URL for the Cloud Agent Next API; used by App Builder chat and other clients. [SERVER]
- `NEXT_PUBLIC_CLOUD_AGENT_NEXT_WS_URL` - WebSocket URL for Cloud Agent Next from the browser. [PUBLIC]
- `CLOUD_AGENT_R2_ATTACHMENTS_BUCKET_NAME` - R2 bucket for cloud agent file attachments. [SERVER]
- `GASTOWN_SERVICE_URL` - URL for the Gastown service. [SERVER]
- `NEXT_PUBLIC_GASTOWN_URL` - Client-side base URL for Gastown. [PUBLIC]
Expand Down Expand Up @@ -304,16 +302,12 @@ This document lists all environment variables used in the Kilo Code cloud monore

### Cloud Agent Services

- `KILOCODE_TOKEN` - Auth token for KiloCode/Session service identity; used by `cloud-agent-next` wrapper and Gastown containers. `[SECRET]`
- `KILOCODE_TOKEN` - Auth token for KiloCode/Session service identity; used by the Cloud Agent Next wrapper and Gastown containers. `[SECRET]`
- `KILOCODE_TOKEN_FILE` - Path to a file containing the KiloCode token (alternative to the env var). [SERVER]
- `KILO_SESSION_ID` - Legacy/session-wrapper session identifier. [SERVER]
- `KILO_SESSION_INGEST_URL` - URL for ingesting session data from the cloud agent wrapper. [SERVER]
- `INGEST_URL` - URL for telemetry/event ingest from `cloud-agent/wrapper`. [SERVER]
- `KILO_PLATFORM` - Target platform identifier for the cloud-agent wrapper (`darwin`, `linux`, etc.). [SERVER]
- `CLI_LOG_PATH` - File path for the cloud-agent wrapper's local CLI log output. [SERVER]
- `WRAPPER_LOG_PATH` - File path for the cloud-agent-next wrapper's log output. [SERVER]
- `KILO_SESSION_INGEST_URL` - URL used by the Cloud Agent Next wrapper to ingest session data. [SERVER]
- `KILO_PLATFORM` - Target platform identifier used by the Cloud Agent Next wrapper (`darwin`, `linux`, etc.). [SERVER]
- `WRAPPER_LOG_PATH` - File path for the Cloud Agent Next wrapper's log output. [SERVER]
- `KILO_BIN_PATH` - Path or name of the `kilo` CLI binary; used by `services/cloud-agent-next/scripts/update-default-slash-commands.mjs`. [SERVER]
- `UPSTREAM_BRANCH` - Default upstream branch name for the cloud-agent wrapper workspace. [SERVER]
- `WORKSPACE_PATH` - Filesystem path of the agent workspace. [SERVER]
- `SESSION_ID` - Reserved session identifier for the `cloud-agent-next` runtime; reserved in `RESERVED_ENV_VARS`. [SERVER]
- `HOME` - Reserved in `RESERVED_ENV_VARS` for cloud-agent-next session home management. [SYSTEM]
Expand Down Expand Up @@ -349,7 +343,7 @@ This document lists all environment variables used in the Kilo Code cloud monore

- `API_BASE_URL` - Base HTTPS URL for the mobile app's API (e.g. `https://api.kilo.ai`). Bundled into the binary. [PUBLIC]
- `WEB_BASE_URL` - Base HTTPS URL for the mobile in-app web views (e.g. `https://app.kilo.ai`). Bundled into the binary. [PUBLIC]
- `CLOUD_AGENT_WS_URL` - WebSocket URL for cloud-agent streaming in the mobile app. Bundled into the binary. [PUBLIC]
- `CLOUD_AGENT_WS_URL` - WebSocket URL for Cloud Agent Next streaming in the mobile app. Bundled into the binary. [PUBLIC]
- `SESSION_INGEST_WS_URL` - WebSocket URL for session ingest from the mobile app. Bundled into the binary. [PUBLIC]
- `APPSFLYER_DEV_KEY` - AppsFlyer development key for mobile attribution. Bundled into the binary (not secret — it's a device-level SDK key). [PUBLIC]
- `APPSFLYER_APP_ID` - AppsFlyer app ID for mobile attribution tracking. [PUBLIC]
Expand Down
6 changes: 0 additions & 6 deletions apps/web/.env.development.local.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# @url cloud-agent-next
CLOUD_AGENT_API_URL=http://localhost:8794

# @url cloud-agent-next
CLOUD_AGENT_NEXT_API_URL=http://localhost:8794

Expand Down Expand Up @@ -53,9 +50,6 @@ O11Y_SERVICE_URL=http://localhost:8801
# @from O11Y_KILO_GATEWAY_CLIENT_SECRET
O11Y_KILO_GATEWAY_CLIENT_SECRET=

# @url cloud-agent-next
NEXT_PUBLIC_CLOUD_AGENT_WS_URL=ws://localhost:8794

# @url cloud-agent-next
NEXT_PUBLIC_CLOUD_AGENT_NEXT_WS_URL=ws://localhost:8794

Expand Down
2 changes: 0 additions & 2 deletions apps/web/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ XAI_API_KEY=
GIGAPOTATO_API_KEY=
GIGAPOTATO_API_URL=
GENLABS_API_KEY=
CLOUD_AGENT_API_URL=
NEXT_PUBLIC_TURNSTILE_SITE_KEY=invalid-turnstile-site
TURNSTILE_SECRET_KEY=invalid-turnstile-test-key
WORKOS_API_KEY=invalid-mock-workos-key
Expand All @@ -52,7 +51,6 @@ R2_CLI_SESSIONS_BUCKET_NAME=test-bucket
GENLABS_API_KEY=''
GIGAPOTATO_API_KEY=''
GIGAPOTATO_API_URL=''
CLOUD_AGENT_API_URL=''
CODE_REVIEW_WORKER_URL=mock-url''
CODE_REVIEW_WORKER_AUTH_TOKEN='mock-key'
AUTO_TRIAGE_URL='mock-url'
Expand Down
1 change: 0 additions & 1 deletion apps/web/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const config: Config = {
testMatch: ['**/src/**/*.test.ts', '<rootDir>/../../packages/db/src/**/*.test.ts'],
testPathIgnorePatterns: [
'<rootDir>/../../.kilocode/',
'<rootDir>/../../services/cloud-agent/',
'<rootDir>/../../services/cloud-agent-next/',
'<rootDir>/../../services/app-builder/',
'<rootDir>/../../services/webhook-agent-ingest/',
Expand Down
4 changes: 0 additions & 4 deletions apps/web/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ const config: KnipConfig = {
'@chromatic-com/storybook',
],
},
'../../services/cloud-agent': {
entry: ['src/index.ts', 'test/**/*.test.ts'],
ignoreDependencies: ['cloudflare', '@vitest/coverage-v8'],
},
'../../services/ai-attribution': {
entry: ['src/ai-attribution.worker.ts'],
ignoreDependencies: ['cloudflare'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ export function EditWebhookTriggerContent({
error: repoError,
} = useQuery(
organizationId
? trpc.organizations.cloudAgent.listGitHubRepositories.queryOptions({
? trpc.organizations.cloudAgentNext.listGitHubRepositories.queryOptions({
organizationId,
forceRefresh: false,
})
: trpc.cloudAgent.listGitHubRepositories.queryOptions({
: trpc.cloudAgentNext.listGitHubRepositories.queryOptions({
forceRefresh: false,
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export function CreateWebhookTriggerContent({ organizationId }: CreateWebhookTri
error: repoError,
} = useQuery(
organizationId
? trpc.organizations.cloudAgent.listGitHubRepositories.queryOptions({
? trpc.organizations.cloudAgentNext.listGitHubRepositories.queryOptions({
organizationId,
forceRefresh: false,
})
: trpc.cloudAgent.listGitHubRepositories.queryOptions({
: trpc.cloudAgentNext.listGitHubRepositories.queryOptions({
forceRefresh: false,
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function OnboardingStepRepo() {
organizationId: orgId,
forceRefresh: false,
})
: mainTrpc.cloudAgent.listGitHubRepositories.queryOptions({ forceRefresh: false })),
: mainTrpc.cloudAgentNext.listGitHubRepositories.queryOptions({ forceRefresh: false })),
});

const gitlabReposQuery = useQuery({
Expand All @@ -37,7 +37,7 @@ export function OnboardingStepRepo() {
organizationId: orgId,
forceRefresh: false,
})
: mainTrpc.cloudAgent.listGitLabRepositories.queryOptions({ forceRefresh: false })),
: mainTrpc.cloudAgentNext.listGitLabRepositories.queryOptions({ forceRefresh: false })),
});

const unifiedRepositories = useMemo<RepositoryOption[]>(() => {
Expand Down
Loading
Loading