Skip to content

(janitor/dead-code): delete unused removeChatCompletionsReasoning helper - #7093

Merged
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dead-code-remove-chat-completions-reasoning
Oct 2, 2026
Merged

kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/dead-code-remove-chat-completions-reasoning

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What was deleted

removeChatCompletionsReasoning(request) from packages/web-shared/src/lib/ai-gateway/providers/openrouter/request-helpers.ts — a pure request-mutation helper that strips reasoning, reasoning_content, and reasoning_details from chat-completions messages.

Evidence it was unreachable

  • Repository-wide search for removeChatCompletionsReasoning (all file types, excluding node_modules/.git) returns exactly one hit: its own definition. No import, call, re-export, string reference, or dynamic access exists.
  • The Kilo-Org/kilocode consumer repo (cloned and searched) contains zero references.
  • Introduced in 825754ac7 ("feat(ai-gateway): add a standalone ai-gateway app… [AISAGE-502] feat(ai-gateway): add a standalone ai-gateway app serving /api/v1 from a web-shared package #6806") and never referenced since (git log -S confirms the symbol was only ever added, never removed from a caller).
  • The adjacent helpers in the same file are all wired: fixResponsesRequest and mapReasoningDetailsToReasoningContent are called from apply-provider-specific-logic.ts, and removeChatCompletionsToolNames is exercised by apps/web/src/tests/openrouter-request-helpers.test.ts. This function is the only one with no consumer.

Dynamic and configured entry points checked

  • @kilocode/web-shared is private: true with no exports/main map; files are reached only via direct @/-alias imports from apps/web/apps/ai-gateway, not a barrel. No re-export path references the symbol.
  • Not a Next.js convention file (not page/route/layout); it is a plain utility module, so no framework file discovery applies.
  • Not a Cloudflare Worker/Durable Object/binding/queue/cron/alarm/RPC target — web-shared is server code for Next.js apps, with no wrangler config reference.
  • Not referenced by tests, scripts, CI, or deployment tooling (the one stale mention is a git-ignored build artifact under packages/trpc/dist/tsc, regenerated on build).

Contract and compatibility considerations

  • The function is not exported from any published package (all workspace packages are private; kilocode does not consume @kilocode/web-shared).
  • Deleting it removes no module-load side effects: the body only mutates the passed argument and is never invoked.
  • No persisted data, migration, or compatibility surface is affected.

Validation performed

  • pnpm --filter @kilocode/web-shared typecheck (tsgo -p tsconfig.lib.json) — passes.
  • pnpm -w exec oxlint --config .oxlintrc.json <file> — 0 errors / 0 warnings.
  • pnpm -w exec oxfmt --list-different <file> and git diff --check — clean.
  • The unit test for this module (openrouter-request-helpers.test.ts) does not reference the deleted function; the suite itself could not be run here because the app-wide Jest setup (workerSetup.ts) requires PostgreSQL, which is unavailable in this environment.

Unreferenced anywhere in the repo or the kilocode consumer; introduced in #6806 and never wired up.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Oct 2, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) October 2, 2026 07:53
@kilo-code-bot

kilo-code-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The PR deletes the unreferenced removeChatCompletionsReasoning helper from request-helpers.ts; a repository-wide search confirms zero callers, and all remaining imports in the file are still used by sibling helpers.

Files Reviewed (1 file)
  • packages/web-shared/src/lib/ai-gateway/providers/openrouter/request-helpers.ts

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

Review guidance: REVIEW.md from base branch main

@kilo-code-bot
kilo-code-bot Bot merged commit 9b52698 into main Oct 2, 2026
27 checks passed
@kilo-code-bot
kilo-code-bot Bot deleted the janitor/dead-code-remove-chat-completions-reasoning branch October 2, 2026 08:11
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