Skip to content

(janitor/dedupe): consolidate web sandboxIdFromUserId onto worker-utils - #6070

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dedupe-web-sandbox-id
Open

(janitor/dedupe): consolidate web sandboxIdFromUserId onto worker-utils#6070
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dedupe-web-sandbox-id

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

apps/web/src/lib/kiloclaw/sandbox-id.ts re-declared sandboxIdFromUserId and inlined isValidInstanceId / sandboxIdFromInstanceId, with comments stating they "must stay in sync" with @kilocode/worker-utils.

The canonical implementation already lives in @kilocode/worker-utils/sandbox-id (re-exporting from ./instance-id), and apps/web already imports that package's subpaths elsewhere (e.g. @kilocode/worker-utils/hostname-label, @kilocode/worker-utils/instance-id). The stale "Next.js moduleResolution can't resolve the worker-utils subpath export" comment was no longer accurate.

This deletes the 52-line duplicate and points the single consumer (a test) at the canonical module.

Changes

  • Delete apps/web/src/lib/kiloclaw/sandbox-id.ts
  • apps/web/src/routers/kiloclaw-billing-router.test.ts: import sandboxIdFromUserId from @kilocode/worker-utils/sandbox-id

Verification

  • tsgo --noEmit -p apps/web/tsconfig.json — pass
  • oxlint on the changed test file — 0 warnings / 0 errors
  • git diff --check — clean

Postgres/Redis-backed tests could not be run in this environment.

apps/web re-declared sandboxIdFromUserId and inlined isValidInstanceId /
sandboxIdFromInstanceId with comments saying they "must stay in sync" with
@kilocode/worker-utils. The canonical implementation already lives in
@kilocode/worker-utils/sandbox-id (and /instance-id), and web already imports
that package's subpaths elsewhere. Delete the duplicate and point the single
test consumer at the canonical module.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 11, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 11, 2026 07:08
@kilo-code-bot

kilo-code-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/lib/kiloclaw/sandbox-id.ts - deleted duplicate; canonical sandboxIdFromUserId in @kilocode/worker-utils/sandbox-id is byte-for-byte equivalent (TextEncoder + base64url, 63-char limit)
  • apps/web/src/routers/kiloclaw-billing-router.test.ts - import retargeted; subpath export exists in packages/worker-utils/package.json and is already used by apps/web/src/lib/kiloclaw/instance-url.test.ts

No remaining consumers of the deleted module (isValidInstanceId/sandboxIdFromInstanceId re-exported from worker-utils), and no other references found in the repo.


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

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants