Skip to content

(janitor/dead-code): remove unused getProfileByName and getProfileIdByName - #5930

Merged
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dead-code/cloud-agent-profile-by-name
Sep 7, 2026
Merged

(janitor/dead-code): remove unused getProfileByName and getProfileIdByName#5930
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dead-code/cloud-agent-profile-by-name

Conversation

@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

What was deleted

Two exported functions from the private @kilocode/cloud-agent-profile package, plus their re-exports from the package barrel:

  • getProfileByName (packages/cloud-agent-profile/src/profile-service.ts)
  • getProfileIdByName (packages/cloud-agent-profile/src/profile-service.ts)

Both are removed from src/index.ts. Net change is 42 deletions, no production behavior change.

Evidence they were unreachable

  • A repository-wide grep for getProfileByName and getProfileIdByName (all file types, excluding node_modules/.git) returns only the two definitions and the two barrel re-export lines. No call sites exist in apps/web, apps/mobile, apps/extension, services/*, packages/*, scripts/*, dev/*, or tools/*.
  • The @kilocode/kilocode repo (the primary external consumer) was cloned and searched: zero occurrences of either symbol.
  • The functions' own doc comment claims use in "the prepare session API", but the actual consumer services/cloud-agent-next/src/router/handlers/session-prepare.ts does not import them; it resolves profiles through getEffectiveDefaultProfileId/getDefaultProfile/mergeProfileConfiguration instead. The comment was stale.

Dynamic and configured entry points checked

  • Next.js / Expo / framework file conventions: these are plain named exports in a package module, not route/entry files. No import(), require(), or string-based lookup references either symbol anywhere.
  • Cloudflare bindings, Durable Objects, queues, cron, alarms, RPC, workflows, Wrangler config: @kilocode/cloud-agent-profile is a Postgres query helper package. Neither symbol appears in any wrangler.toml/wrangler.jsonc, binding list, or service config.
  • Code generation / registries: no generator, registry map, or plugin references either name.
  • Re-exports: no export * from '@kilocode/cloud-agent-profile' exists; the only namespace importers (apps/web/src/routers/agent-profiles-router.ts via import * as profileService) access members by name, and neither name is referenced there.

Contract and compatibility considerations

  • The package is declared "private": true and is not published to npm, so these exports are not part of any published SDK/CLI/plugin surface.
  • Both functions are pure read-query wrappers with no module-load side effects; removing them changes no initialization order. The module (profile-service.ts) retains many other used exports, so nothing else is orphaned (getProfile, ProfileResponse, ProfileOwner, and all imports remain used by other functions in the file).
  • No migrations, persisted data, or compatibility shims depend on them.

Validation performed

  • pnpm --filter @kilocode/cloud-agent-profile typecheck — passed
  • pnpm --filter @kilocode/cloud-agent-profile test — 3 files, 36 tests passed
  • pnpm --filter @kilocode/cloud-agent-profile lint — 0 warnings, 0 errors
  • pnpm --filter @kilocode/trpc typecheck — passed (direct dependent)
  • pnpm --filter cloud-agent-next typecheck — passed (documented consumer + wrapper)
  • git diff --check — clean; files formatted with oxfmt

…Name

Both functions are exported from @kilocode/cloud-agent-profile but have no
consumers anywhere in the monorepo. Their doc comment claimed use in the
prepare session API, but that code now resolves profiles via
getEffectiveDefaultProfileId / getDefaultProfile instead.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 7, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 7, 2026 07:54
@kilo-code-bot

kilo-code-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Dead-code removal of unused getProfileByName and getProfileIdByName from the private @kilocode/cloud-agent-profile package; no remaining call sites and no issues found.

Files Reviewed (2 files)
  • packages/cloud-agent-profile/src/index.ts
  • packages/cloud-agent-profile/src/profile-service.ts

Reviewed by grok-4.6 · Input: 54.8K · Output: 3.8K · Cached: 181.4K

Review guidance: REVIEW.md from base branch main

@kilo-code-bot
kilo-code-bot Bot merged commit 9aff0a3 into main Sep 7, 2026
19 checks passed
@kilo-code-bot
kilo-code-bot Bot deleted the janitor/dead-code/cloud-agent-profile-by-name branch September 7, 2026 13:31
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.

1 participant