Skip to content

fix(gastown): bump @kilocode/cli to 7.3.1 + plumb auth env into prewarm#3372

Merged
jrf0110 merged 1 commit into
gastown-stagingfrom
fix/gastown-cli-bump-and-prewarm-auth
May 20, 2026
Merged

fix(gastown): bump @kilocode/cli to 7.3.1 + plumb auth env into prewarm#3372
jrf0110 merged 1 commit into
gastown-stagingfrom
fix/gastown-cli-bump-and-prewarm-auth

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented May 20, 2026

Summary

Fixes the two bugs that prevented PR #3307's session-ingest wiring from working in production.

Bug 1: kilo CLI version too old (smoking gun)

@kilocode/cli@7.2.14 doesn't read process.env.KILO_AUTH_CONTENT. Every kilo serve was hitting Auth.get("kilo") → undefined → "session bootstrap skipped: no client" and silently no-op'ing all session deltas.

Bumped to 7.3.1. Verified KILO_AUTH_CONTENT is present in the new binary's strings.

Bug 2: prewarm path missing auth env

buildPrewarmEnv didn't set the three env vars (KILO_AUTH_CONTENT, KILO_PLATFORM, KILO_ORG_ID). Even after the CLI bump, mayor sessions (which go through prewarm) would still be invisible. Now it mirrors buildAgentEnv via the extracted buildKiloAuthEnv helper.

Refactor: extracted buildKiloAuthEnv helper

The auth-env logic (KILO_AUTH_CONTENT, KILO_PLATFORM, KILO_ORG_ID) was duplicated between buildAgentEnv and buildPrewarmEnv. Extracted buildKiloAuthEnv(kilocodeToken, organizationId) in agent-runner.ts and called it from both functions.

Verification

  • pnpm --filter gastown-container typecheck passes
  • pnpm --filter gastown-container test passes (2 pre-existing failures in plugin/client.test.ts unrelated to this change)
  • Verified npm view @kilocode/cli@7.3.1 version returns 7.3.1 for all 6 packages
  • Verified KILO_AUTH_CONTENT string present in @kilocode/cli-linux-x64@7.3.1 binary

Visual Changes

N/A

Reviewer Notes

  • The buildKiloAuthEnv helper accepts organizationId: string | undefined | null to match the nullable type from MayorPrewarmContext.organizationId. Both null and undefined are falsy and correctly skip setting KILO_ORG_ID.
  • The process-manager.test.ts prewarm test now saves/restores KILO_ORG_ID from process.env to avoid interference from the container's own environment.

Bug 1: @kilocode/cli@7.2.14 doesn't read KILO_AUTH_CONTENT, causing all
kilo serve session-ingest to silently no-op. Bumped to 7.3.1 which has the
feature. Verified KILO_AUTH_CONTENT present in binary strings.

Bug 2: buildPrewarmEnv didn't set KILO_AUTH_CONTENT, KILO_PLATFORM, or
KILO_ORG_ID, so mayor sessions (which go through prewarm) were invisible.
Extracted buildKiloAuthEnv helper from buildAgentEnv and used it in both
buildAgentEnv and buildPrewarmEnv.

Refs #3307
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The refactor correctly extracts buildKiloAuthEnv from buildAgentEnv and wires it into buildPrewarmEnv, with well-targeted tests covering all edge cases; no security, correctness, or runtime issues found.

Files Reviewed (7 files)
  • services/gastown/container/src/agent-runner.ts — new buildKiloAuthEnv helper, buildAgentEnv updated to call it
  • services/gastown/container/src/agent-runner.test.ts — new buildKiloAuthEnv unit tests
  • services/gastown/container/src/process-manager.tsbuildPrewarmEnv updated with Object.assign(env, buildKiloAuthEnv(...))
  • services/gastown/container/src/process-manager.test.ts — prewarm test updated to capture/restore KILO_ORG_ID and assert auth env vars
  • services/gastown/container/Dockerfile — CLI bump 7.2.14 → 7.3.1
  • services/gastown/container/Dockerfile.dev — CLI bump 7.2.14 → 7.3.1
  • services/gastown/container/package.json — SDK bump 7.2.14 → 7.3.1
  • pnpm-lock.yaml — lockfile updated (generated, not reviewed in detail)

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-4.6 · 820,974 tokens

Review guidance: REVIEW.md from base branch gastown-staging

@jrf0110 jrf0110 merged commit 8553c88 into gastown-staging May 20, 2026
2 checks passed
@jrf0110 jrf0110 deleted the fix/gastown-cli-bump-and-prewarm-auth branch May 20, 2026 18:00
jrf0110 added a commit that referenced this pull request May 28, 2026
…rm (#3372)

Bug 1: @kilocode/cli@7.2.14 doesn't read KILO_AUTH_CONTENT, causing all
kilo serve session-ingest to silently no-op. Bumped to 7.3.1 which has the
feature. Verified KILO_AUTH_CONTENT present in binary strings.

Bug 2: buildPrewarmEnv didn't set KILO_AUTH_CONTENT, KILO_PLATFORM, or
KILO_ORG_ID, so mayor sessions (which go through prewarm) were invisible.
Extracted buildKiloAuthEnv helper from buildAgentEnv and used it in both
buildAgentEnv and buildPrewarmEnv.

Refs #3307

Co-authored-by: John Fawcett <john@kilcoode.ai>
jrf0110 added a commit that referenced this pull request May 28, 2026
…rm (#3372)

Bug 1: @kilocode/cli@7.2.14 doesn't read KILO_AUTH_CONTENT, causing all
kilo serve session-ingest to silently no-op. Bumped to 7.3.1 which has the
feature. Verified KILO_AUTH_CONTENT present in binary strings.

Bug 2: buildPrewarmEnv didn't set KILO_AUTH_CONTENT, KILO_PLATFORM, or
KILO_ORG_ID, so mayor sessions (which go through prewarm) were invisible.
Extracted buildKiloAuthEnv helper from buildAgentEnv and used it in both
buildAgentEnv and buildPrewarmEnv.

Refs #3307

Co-authored-by: John Fawcett <john@kilcoode.ai>
jrf0110 added a commit that referenced this pull request May 28, 2026
* fix(gastown): bump @kilocode/cli to 7.3.1 + plumb auth env into prewarm (#3372)

Bug 1: @kilocode/cli@7.2.14 doesn't read KILO_AUTH_CONTENT, causing all
kilo serve session-ingest to silently no-op. Bumped to 7.3.1 which has the
feature. Verified KILO_AUTH_CONTENT present in binary strings.

Bug 2: buildPrewarmEnv didn't set KILO_AUTH_CONTENT, KILO_PLATFORM, or
KILO_ORG_ID, so mayor sessions (which go through prewarm) were invisible.
Extracted buildKiloAuthEnv helper from buildAgentEnv and used it in both
buildAgentEnv and buildPrewarmEnv.

Refs #3307

Co-authored-by: John Fawcett <john@kilcoode.ai>

* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) (#3576)

* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0)

* fix(gastown): address PR review feedback on slingExistingPr

- Remove async from submitExternalPrToReviewQueue (no awaits inside)
- Add GitLab host validation in slingExistingPr URL parsing to prevent
  non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex
- Replace vacuous state validation tests with meaningful checkPRStatus
  integration tests that exercise the actual status resolution path

---------

Co-authored-by: John Fawcett <john@kilcoode.ai>

* feat(gastown): tRPC + HTTP for babysit PR (chunk 1)

Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query,
mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads,
and reconciler fast-track extension for babysat MR beads.

* chore: remove duplicate sling-existing-pr.test.ts

The file was a verbatim copy of the first 442 lines of
babysit-pr.test.ts, causing 24 tests to run twice with
zero added coverage.

* fix(gastown): resolve merge conflict markers in process-manager.test.ts

---------

Co-authored-by: John Fawcett <john@kilcoode.ai>
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.

1 participant