Skip to content

test(cloud-agent-next): run the shared e2e scenarios against a deployed stack - #6284

Merged
eshurakov merged 2 commits into
eshurakov/deployed-e2e-infrafrom
eshurakov/jovial-starling
Sep 22, 2026
Merged

eshurakov merged 2 commits into
eshurakov/deployed-e2e-infrafrom
eshurakov/jovial-starling

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

Gives the e2e harness one shared implementation per scenario that runs under either the local or the deployed profile, and drives the deployed profile through an e2e-only Worker surface built only from mechanisms production also has.

Base is eshurakov/deployed-e2e-infra, which supplies the deployed fake LLM Worker and its Durable Object. Merge that one first.

  • Deployed profile. E2E_PROFILE=deployed drives a real Cloudflare stack. Authentication resolves environment-first and then from an ordinary personal-token file, so E2E_USER_TOKEN + FAKE_LLM_ADMIN_TOKEN alone are enough. The path never reads .dev.vars, root env files or Postgres, and never mints a credential. Container identity is observed through the e2e surface instead of a local Docker daemon.
  • One scenario definition, two profiles. 19 of the 34 scenario definitions now run under either profile: cold-hot, unknown-model, auth-reject, chunked-streaming, empty-response, waiters-clean, llm-error, the three callback scenarios, and nine queue/continuity/micro scenarios. The other 15 remain local-only because they need Docker to inspect or kill containers.
  • One owner for the gate and the exit code. scenario-capabilities.ts decides whether a scenario can run before any side effect: a missing injected environment is an error, a conflicting API pin is an error, a local profile without the mandatory sandbox capability is an error, a declared-but-absent capability is an explicit unsupported rather than a silently weakened assertion, and a throwing capability stays a failure. run.ts owns the exit policy: 1 any failure, 2 any unsupported, 0 clean.
  • E2e surface. An e2e-only entrypoint exposes /__e2e/*, reachable only behind the e2e-scoped INTERNAL_API_SECRET sent as x-internal-api-key, compared constant-time and failing closed when unset, with the caller's JWT still required on every route except the callback ingest route, which is authenticated by its own unguessable path token. The production entrypoint and its routes are untouched, and the surface is unreachable there by construction rather than by a flag. Callback bodies are read as raw bytes, bounded to 50 records with a one-hour TTL, and a body past 64 KiB is cancelled.
  • Matrix runner and CI entry point. e2e:deployed (smoke-deployed.ts) runs every shared scenario against a deployed Worker, with a tolerant per-scenario cleanup backstop so one stuck session cannot hide the rest, and reports passed / failed / unsupported as distinct categories. .github/workflows/e2e-deployed.yml is a workflow_dispatch-only runner around it.
  • Less duplicated ownership. Worktree ownership is read from getSession instead of a second direct cli_sessions_v2 query; transcript reduction skips CLI progress parts marked kilocode.lifecycle == transient so the echoed payload stays at the end of the observed text; gate tags are run-scoped behind one release/leak owner; and API selection has one owner that fails a conflicting pin instead of skipping it.
  • deploy-e2e-worker.sh no longer requires INTERNAL_API_SECRET on redeploy: wrangler never clears an existing Worker secret, so a supplied value now means "rotate" and its absence reports that the deployed value is kept.
  • The same HTTP surface backs a local-http profile (E2E_LOCAL_HTTP=1), so the local Worker can be driven with deployed-style auth and the HTTP-only capability set.

Verification

Manually verified against the deployed stack:

  • Full deployed matrix run: Summary: 14 passed, 5 failed, 0 unsupported — 19 shared scenarios, serial, 23m24s wall clock.
  • The five failures are one product defect, and it is diagnosed rather than guessed. cleanupDeadlineAt is minted on the Worker's clock and then validated against the Durable Object's clock and SandboxControl's clock; because the minted value already contained the timeout, the upper bound reduced to workerNow > doNow, so ordinary skew rejected every interrupt. Evidence: 9 Stop cleanup deadline is invalid rejections, each 62-184 ms after Starting session interruption, and no session.abort ever reached the wrapper. It is fixed in fix(cloud-agent-next): own the stop cleanup deadline per hop #6281, and the matrix should go green once that fix is on main and cloud-agent-e2e-test is redeployed from it.
  • Counter-evidence that the harness itself is not the cause: production cloud-agent-next recorded 8,862 interruptSession calls over 7 days with 0 rejections, because it pins both functions and Durable Objects to one region. The e2e deployment does not share that incidental protection.

Not verified here:

  • The test:e2e-workers Miniflare suite and the deployed matrix are not wired into PR CI — ci.yml runs unit and integration only. The workflow is dispatched by hand.
  • The local Docker profile's full scenario does not complete in this worktree (sandbox egress proxy dials 127.0.0.1:3000, Next.js listens on 8300).
  • A cold-container flake (empty-response twice in 13 local runs) is not root-caused.
  • The retryable provider-error path has no coverage; llm-error asserts the terminal failure the product actually produces, because its original retry premise was stale.

Visual Changes

N/A

Reviewer Notes

Automated coverage: test:e2e-workers (Miniflare entry/surface tests in test/e2e/workers/), test/unit/e2e/** (deployed auth, capability gate, config renderer, shared scenario definitions, cleanup, client), and the test:fake-llm suite from the first PR.

  • The workflow cannot be dispatched yet. A workflow_dispatch workflow must exist on the default branch before GitHub offers it. It becomes runnable once this merges.
  • The workflow does not deploy anything. It runs the matrix against whatever is currently deployed, so the operator must deploy both Workers from the revision under test first; otherwise a pass proves the wrong revision. This is the coupling that makes the deployed matrix meaningful and also the easiest way to misread it.
  • Accepted risk, already documented in the runbook. The e2e Worker render clones production bindings — the production Hyperdrive/Postgres database, the kilocode-sessions R2 bucket and production service bindings — and its endpoints are public with valid-token admission only, with no per-user isolation. Dedicated Worker names keep the stack addressable separately; they do not isolate its resources.
  • Documentation defects in this PR's text, not fixed (follow-up). test/e2e/README.md names the Workers fake-llm-e2e-test and cloud-agent-next-e2e-test and uses a <sub>.workers.dev placeholder at line 439, while deploy/README.md hardcodes engineering-e11 and the deployment actually exercised is reached at a custom domain. The E2E_USER_ID row also reads as an access-control restriction; it is a plane selector (* by default), not an access-control boundary.

Comment thread services/cloud-agent-next/test/e2e/smoke.ts
Comment thread services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts
Comment thread services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts
Comment thread services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts Outdated
Comment thread services/cloud-agent-next/test/e2e/owned-gates.ts
Comment thread services/cloud-agent-next/test/e2e/deployed-auth.ts
@kilo-code-bot

kilo-code-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/test/e2e/smoke.ts 73 auth-reject is in the local DEFAULT_MATRIX but declares requires: ['deployedHttpAuthBoundary'] (scenarios-shared.ts:741), which createLocalScenarioEnvironment() does not supply, so runSharedScenario returns unsupported and an otherwise green local smoke run exits 2 instead of 0 (run.ts:130)

SUGGESTION

File Line Issue
services/cloud-agent-next/test/e2e/owned-gates.ts 86 withOwnedGates documents a throw-labeling contract it does not implement (the try has no catch), so a rejecting body escapes the runner instead of becoming a reported failure
services/cloud-agent-next/src/e2e-surface/allocation.ts 67 The fallback sandbox-id derivation omits devcontainer and sandboxAllocation, so an unset workspace.sandboxId can resolve the wrong SandboxControl
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 275 waiters-clean's own-tag conjunct is vacuous: the tag is already removed by the scenario's own release, so only liveResponses can fail
Files Reviewed (4 changed files)
  • services/cloud-agent-next/test/e2e/deployed-auth.ts - previous timeout finding fixed; no open issues
  • services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts - previous warm-up stream leak fixed; no open issues
  • services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts - 2 previous stream leaks fixed; 1 carried
  • services/cloud-agent-next/test/unit/e2e/deployed-auth.test.ts - timeout coverage added; no open issues

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit f692114)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit f692114)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 4
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/test/e2e/smoke.ts 73 auth-reject added to the local DEFAULT_MATRIX requires deployedHttpAuthBoundary, which the local profile does not supply, so an otherwise green local smoke run now exits 2 instead of 0
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 108 chunked-streaming never closes its WebSocket when requireContainer throws (no finally)
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 165 empty-response has the same unclosed-stream throw path
services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts 170 hot leaks the untracked warm-up WebSocket if requireContainer throws before the success-path close

SUGGESTION

File Line Issue
services/cloud-agent-next/test/e2e/owned-gates.ts 86 withOwnedGates documents a throw-labeling contract it does not implement (the try has no catch), so a rejecting body escapes the runner instead of becoming a reported failure
services/cloud-agent-next/test/e2e/deployed-auth.ts 413 fetchStreamTicket has no timeout or AbortSignal, so a hung backend can stall a scenario past its deadline
services/cloud-agent-next/src/e2e-surface/allocation.ts 67 The fallback sandbox-id derivation omits devcontainer and sandboxAllocation, so an unset workspace.sandboxId can resolve the wrong SandboxControl
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 261 waiters-clean's "own tag is gone" conjunct is vacuous: the tag is already removed by the scenario's own release, so only liveResponses can fail
Files Reviewed (55 files)
  • .github/workflows/e2e-deployed.yml
  • dev/local/cli.ts
  • dev/local/dashboard.tsx
  • dev/local/runner.ts
  • dev/local/services.test.ts
  • dev/local/services.ts
  • services/cloud-agent-next/AGENTS.md
  • services/cloud-agent-next/package.json
  • services/cloud-agent-next/src/e2e-entry.ts
  • services/cloud-agent-next/src/e2e-surface/allocation.ts - 1 issue
  • services/cloud-agent-next/src/e2e-surface/app.ts
  • services/cloud-agent-next/src/e2e-surface/callbacks.ts
  • services/cloud-agent-next/src/persistence/E2eCallbackSink.ts
  • services/cloud-agent-next/src/types.ts
  • services/cloud-agent-next/test/e2e/README.md
  • services/cloud-agent-next/test/e2e/auth.ts
  • services/cloud-agent-next/test/e2e/capabilities-deployed.ts
  • services/cloud-agent-next/test/e2e/capabilities-local.ts
  • services/cloud-agent-next/test/e2e/client.ts
  • services/cloud-agent-next/test/e2e/deploy/README.md
  • services/cloud-agent-next/test/e2e/deploy/deploy-e2e-worker.sh
  • services/cloud-agent-next/test/e2e/deploy/render-e2e-worker-config.mjs
  • services/cloud-agent-next/test/e2e/deployed-auth.ts - 1 issue
  • services/cloud-agent-next/test/e2e/e2e-internal-secret.ts
  • services/cloud-agent-next/test/e2e/e2e-surface-client.ts
  • services/cloud-agent-next/test/e2e/lifecycle-continuity.ts
  • services/cloud-agent-next/test/e2e/lifecycle-file-state.ts
  • services/cloud-agent-next/test/e2e/lifecycle.ts
  • services/cloud-agent-next/test/e2e/owned-gates.ts - 1 issue
  • services/cloud-agent-next/test/e2e/run.ts
  • services/cloud-agent-next/test/e2e/scenario-capabilities.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-callbacks.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-continuity.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-failures.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts - 1 issue
  • services/cloud-agent-next/test/e2e/scenarios-shared-queue.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts - 3 issues
  • services/cloud-agent-next/test/e2e/scenarios-shared.ts
  • services/cloud-agent-next/test/e2e/smoke-cleanup.ts
  • services/cloud-agent-next/test/e2e/smoke-deployed.ts
  • services/cloud-agent-next/test/e2e/smoke.ts - 1 issue
  • services/cloud-agent-next/test/e2e/workers/callback-sink.test.ts
  • services/cloud-agent-next/test/e2e/workers/e2e-entry.test.ts
  • services/cloud-agent-next/test/e2e/worktree-support.ts
  • services/cloud-agent-next/test/e2e/wrangler.fake-llm.jsonc
  • services/cloud-agent-next/test/unit/e2e/capabilities-deployed.test.ts
  • services/cloud-agent-next/test/unit/e2e/client.test.ts
  • services/cloud-agent-next/test/unit/e2e/deployed-auth.test.ts
  • services/cloud-agent-next/test/unit/e2e/render-e2e-worker-config.test.ts
  • services/cloud-agent-next/test/unit/e2e/run.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenario-capabilities.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenarios-shared.test.ts
  • services/cloud-agent-next/test/unit/e2e/smoke-cleanup.test.ts
  • services/cloud-agent-next/vitest.e2e-workers.config.ts
  • services/cloud-agent-next/wrangler.e2e-workers.jsonc

Fix these issues in Kilo Cloud

Previous review (commit 4cf15e9)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 4
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/test/e2e/smoke.ts 73 auth-reject added to the local DEFAULT_MATRIX requires deployedHttpAuthBoundary, which the local profile does not supply, so an otherwise green local smoke run now exits 2 instead of 0
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 108 chunked-streaming never closes its WebSocket when requireContainer throws (no finally)
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 165 empty-response has the same unclosed-stream throw path
services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts 170 hot leaks the untracked warm-up WebSocket if requireContainer throws before the success-path close

SUGGESTION

File Line Issue
services/cloud-agent-next/test/e2e/owned-gates.ts 86 withOwnedGates documents a throw-labeling contract it does not implement (the try has no catch), so a rejecting body escapes the runner instead of becoming a reported failure
services/cloud-agent-next/test/e2e/deployed-auth.ts 413 fetchStreamTicket has no timeout or AbortSignal, so a hung backend can stall a scenario past its deadline
services/cloud-agent-next/src/e2e-surface/allocation.ts 67 The fallback sandbox-id derivation omits devcontainer and sandboxAllocation, so an unset workspace.sandboxId can resolve the wrong SandboxControl
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 261 waiters-clean's "own tag is gone" conjunct is vacuous: the tag is already removed by the scenario's own release, so only liveResponses can fail
Files Reviewed (55 files)
  • .github/workflows/e2e-deployed.yml
  • dev/local/cli.ts
  • dev/local/dashboard.tsx
  • dev/local/runner.ts
  • dev/local/services.test.ts
  • dev/local/services.ts
  • services/cloud-agent-next/AGENTS.md
  • services/cloud-agent-next/package.json
  • services/cloud-agent-next/src/e2e-entry.ts
  • services/cloud-agent-next/src/e2e-surface/allocation.ts - 1 issue
  • services/cloud-agent-next/src/e2e-surface/app.ts
  • services/cloud-agent-next/src/e2e-surface/callbacks.ts
  • services/cloud-agent-next/src/persistence/E2eCallbackSink.ts
  • services/cloud-agent-next/src/types.ts
  • services/cloud-agent-next/test/e2e/README.md
  • services/cloud-agent-next/test/e2e/auth.ts
  • services/cloud-agent-next/test/e2e/capabilities-deployed.ts
  • services/cloud-agent-next/test/e2e/capabilities-local.ts
  • services/cloud-agent-next/test/e2e/client.ts
  • services/cloud-agent-next/test/e2e/deploy/README.md
  • services/cloud-agent-next/test/e2e/deploy/deploy-e2e-worker.sh
  • services/cloud-agent-next/test/e2e/deploy/render-e2e-worker-config.mjs
  • services/cloud-agent-next/test/e2e/deployed-auth.ts - 1 issue
  • services/cloud-agent-next/test/e2e/e2e-internal-secret.ts
  • services/cloud-agent-next/test/e2e/e2e-surface-client.ts
  • services/cloud-agent-next/test/e2e/lifecycle-continuity.ts
  • services/cloud-agent-next/test/e2e/lifecycle-file-state.ts
  • services/cloud-agent-next/test/e2e/lifecycle.ts
  • services/cloud-agent-next/test/e2e/owned-gates.ts - 1 issue
  • services/cloud-agent-next/test/e2e/run.ts
  • services/cloud-agent-next/test/e2e/scenario-capabilities.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-callbacks.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-continuity.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-failures.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts - 1 issue
  • services/cloud-agent-next/test/e2e/scenarios-shared-queue.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts - 3 issues
  • services/cloud-agent-next/test/e2e/scenarios-shared.ts
  • services/cloud-agent-next/test/e2e/smoke-cleanup.ts
  • services/cloud-agent-next/test/e2e/smoke-deployed.ts
  • services/cloud-agent-next/test/e2e/smoke.ts - 1 issue
  • services/cloud-agent-next/test/e2e/workers/callback-sink.test.ts
  • services/cloud-agent-next/test/e2e/workers/e2e-entry.test.ts
  • services/cloud-agent-next/test/e2e/worktree-support.ts
  • services/cloud-agent-next/test/e2e/wrangler.fake-llm.jsonc
  • services/cloud-agent-next/test/unit/e2e/capabilities-deployed.test.ts
  • services/cloud-agent-next/test/unit/e2e/client.test.ts
  • services/cloud-agent-next/test/unit/e2e/deployed-auth.test.ts
  • services/cloud-agent-next/test/unit/e2e/render-e2e-worker-config.test.ts
  • services/cloud-agent-next/test/unit/e2e/run.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenario-capabilities.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenarios-shared.test.ts
  • services/cloud-agent-next/test/unit/e2e/smoke-cleanup.test.ts
  • services/cloud-agent-next/vitest.e2e-workers.config.ts
  • services/cloud-agent-next/wrangler.e2e-workers.jsonc

Fix these issues in Kilo Cloud

Previous review

Status: 6 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/test/e2e/smoke.ts 73 auth-reject added to the local DEFAULT_MATRIX is unsupported under the local profile, so an otherwise green local smoke run now exits 2 instead of 0
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 104 chunked-streaming never closes its WebSocket when requireContainer throws (no finally)
services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts 157 empty-response has the same unclosed-stream throw path
services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts 176 hot leaks the untracked warm-up WebSocket if requireContainer throws before the success-path close

SUGGESTION

File Line Issue
services/cloud-agent-next/test/e2e/owned-gates.ts 86 withOwnedGates documents a throw-labeling contract it does not implement (the try has no catch), so a rejecting body escapes the runner instead of becoming a reported failure
services/cloud-agent-next/test/e2e/deployed-auth.ts 413 fetchStreamTicket has no timeout or AbortSignal, so a hung backend can stall a scenario past its deadline
Files Reviewed (55 files)
  • .github/workflows/e2e-deployed.yml
  • dev/local/cli.ts
  • dev/local/dashboard.tsx
  • dev/local/runner.ts
  • dev/local/services.test.ts
  • dev/local/services.ts
  • services/cloud-agent-next/AGENTS.md
  • services/cloud-agent-next/package.json
  • services/cloud-agent-next/src/e2e-entry.ts
  • services/cloud-agent-next/src/e2e-surface/allocation.ts
  • services/cloud-agent-next/src/e2e-surface/app.ts
  • services/cloud-agent-next/src/e2e-surface/callbacks.ts
  • services/cloud-agent-next/src/persistence/E2eCallbackSink.ts
  • services/cloud-agent-next/src/types.ts
  • services/cloud-agent-next/test/e2e/README.md
  • services/cloud-agent-next/test/e2e/auth.ts
  • services/cloud-agent-next/test/e2e/capabilities-deployed.ts
  • services/cloud-agent-next/test/e2e/capabilities-local.ts
  • services/cloud-agent-next/test/e2e/client.ts
  • services/cloud-agent-next/test/e2e/deploy/README.md
  • services/cloud-agent-next/test/e2e/deploy/deploy-e2e-worker.sh
  • services/cloud-agent-next/test/e2e/deploy/render-e2e-worker-config.mjs
  • services/cloud-agent-next/test/e2e/deployed-auth.ts - 1 issue
  • services/cloud-agent-next/test/e2e/e2e-internal-secret.ts
  • services/cloud-agent-next/test/e2e/e2e-surface-client.ts
  • services/cloud-agent-next/test/e2e/lifecycle-continuity.ts
  • services/cloud-agent-next/test/e2e/lifecycle-file-state.ts
  • services/cloud-agent-next/test/e2e/lifecycle.ts
  • services/cloud-agent-next/test/e2e/owned-gates.ts - 1 issue
  • services/cloud-agent-next/test/e2e/run.ts
  • services/cloud-agent-next/test/e2e/scenario-capabilities.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-callbacks.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-continuity.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-failures.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-micro.ts - 1 issue
  • services/cloud-agent-next/test/e2e/scenarios-shared-queue.ts
  • services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts - 2 issues
  • services/cloud-agent-next/test/e2e/scenarios-shared.ts
  • services/cloud-agent-next/test/e2e/smoke-cleanup.ts
  • services/cloud-agent-next/test/e2e/smoke-deployed.ts
  • services/cloud-agent-next/test/e2e/smoke.ts - 1 issue
  • services/cloud-agent-next/test/e2e/workers/callback-sink.test.ts
  • services/cloud-agent-next/test/e2e/workers/e2e-entry.test.ts
  • services/cloud-agent-next/test/e2e/worktree-support.ts
  • services/cloud-agent-next/test/e2e/wrangler.fake-llm.jsonc
  • services/cloud-agent-next/test/unit/e2e/capabilities-deployed.test.ts
  • services/cloud-agent-next/test/unit/e2e/client.test.ts
  • services/cloud-agent-next/test/unit/e2e/deployed-auth.test.ts
  • services/cloud-agent-next/test/unit/e2e/render-e2e-worker-config.test.ts
  • services/cloud-agent-next/test/unit/e2e/run.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenario-capabilities.test.ts
  • services/cloud-agent-next/test/unit/e2e/scenarios-shared.test.ts
  • services/cloud-agent-next/test/unit/e2e/smoke-cleanup.test.ts
  • services/cloud-agent-next/vitest.e2e-workers.config.ts
  • services/cloud-agent-next/wrangler.e2e-workers.jsonc

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch eshurakov/deployed-e2e-infra

@eshurakov
eshurakov force-pushed the eshurakov/jovial-starling branch 2 times, most recently from 9211a9e to e453de4 Compare September 17, 2026 20:31
@eshurakov
eshurakov force-pushed the eshurakov/jovial-starling branch from e453de4 to 4cf15e9 Compare September 17, 2026 21:01
Comment thread services/cloud-agent-next/src/e2e-surface/allocation.ts
Comment thread services/cloud-agent-next/test/e2e/scenarios-shared-streaming.ts
…ed stack

Give the harness one implementation per scenario that runs under either the
local or the deployed profile, and drive it through an e2e-only Worker surface
that uses only mechanisms production also has.

- Deployed profile: E2E_PROFILE=deployed drives a real Cloudflare stack. Auth
  resolves env-first and then from an ordinary personal-token file, so
  E2E_USER_TOKEN + FAKE_LLM_ADMIN_TOKEN alone are enough; the path never reads
  .dev.vars, root env files or Postgres, and never mints a credential.
  assertDeployedProfileEnv owns source precedence and resolveStreamTicket owns
  the connected-stream credential for both profiles.
- Shared scenarios: cold-hot, unknown-model, auth-reject, chunked-streaming,
  empty-response, waiters-clean, llm-error, the three callback scenarios and
  nine queue/continuity/micro scenarios now have one shared definition, so 19
  of the 34 scenarios run under either profile. scenario-capabilities.ts owns
  the gate (a missing injected environment, and a local profile without the
  mandatory `sandbox` capability, are errors before any side effect; a
  declared-but-absent capability is an explicit `unsupported`; a throwing
  capability stays a failure) and run.ts owns the 1/2/0 exit policy.
- E2e surface: an e2e-only entrypoint exposing /__e2e/*, reachable only behind
  the e2e-scoped INTERNAL_API_SECRET sent as x-internal-api-key, compared
  constant-time and failing closed when unset, with the caller's JWT still
  required on every route except the callback ingest route, which is
  authenticated by its own unguessable path token. The production entrypoint
  and its routes are untouched and the surface is unreachable there by
  construction, not by a flag. Callback bodies are read as raw bytes and
  cancelled past 64 KiB, bounded to 50 records with a one-hour TTL.
- Less duplicated ownership: worktree ownership is read from getSession instead
  of a second direct cli_sessions_v2 query, the transcript reduction skips CLI
  progress parts marked `kilocode.lifecycle == transient` so the echoed payload
  stays at the end of the observed text, gate tags are run-scoped with one
  release/leak owner, and API selection has one owner that fails a conflicting
  pin instead of skipping it.
- deploy-e2e-worker.sh no longer requires INTERNAL_API_SECRET on redeploy:
  wrangler never clears an existing Worker secret, so a supplied value now
  means "rotate" and its absence reports that the deployed value is kept.

Honest gaps: test/e2e/** is outside the package typecheck; the retryable
provider-error path stays uncovered because llm-error now asserts the terminal
failure the product actually produces (its retry premise was stale); the Docker
profile's full scenario remains unverified locally for an egress-proxy reason
(dialing 127.0.0.1:3000 while this worktree's Next.js is on 8300); and the
deployed matrix currently fails five interrupt/queue scenarios. That cause is now
established - a cross-machine deadline comparison in the product Worker - and is
fixed in #6281.

No behaviour change in this commit: the harness and dev-launcher files are also
reformatted to satisfy the repo-wide `oxfmt --list-different .` check, which the
package-level formatter (src only) does not cover.
- chunked-streaming / empty-response: hoist the stream and close it in a
  `finally`, so a throwing `requireContainer` cannot leave an open,
  subscribed WebSocket behind
- hot: track the warm-up stream so the existing `finally` closes it on the
  allocation-failure path too
- fetchStreamTicket: bound the ticket POST with AbortSignal.timeout(10s) so
  a backend that accepts but never responds cannot hang the scenario past
  its deadline, and report a stalled body-read as a timeout rather than as
  invalid JSON; the bound is injectable so tests can use a small value
@eshurakov
eshurakov force-pushed the eshurakov/jovial-starling branch from f692114 to b59387d Compare September 21, 2026 14:13
@eshurakov
eshurakov added this pull request to stack #6505 September 21, 2026 20:06
@eshurakov
eshurakov merged commit 3f9f7c6 into main Sep 22, 2026
27 checks passed
@eshurakov
eshurakov deleted the eshurakov/jovial-starling branch September 22, 2026 07:06
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