refactor: remove AI slop from refactored files
Behavior-preserving cleanup of AI-generated code smells in 5 files authored/moved by this PR: - src/hooks/model-fallback/fallback-state-controller.ts (-47/+47 net reorganization, redundant defensiveness removed) - src/shared/model-string-parser.ts (-4 LOC obvious-comment cleanup) - src/shared/ripgrep-cli.ts (-13 LOC obvious comments + redundant defensive checks) - src/tools/delegate-task/tool-description.ts (-6 LOC) - src/tools/look-at/look-at-input-preparer.ts (-6 LOC) Targets: obvious comments that restate code, over-defensive null checks on guaranteed values, redundant existence checks. No public API signatures changed, no type hints removed, no new abstractions introduced. Full test suite still passes.
This commit is contained in:
@@ -13,28 +13,26 @@ export interface DelegateTaskPresentation {
|
||||
export function createDelegateTaskPresentation(options: DelegateTaskToolOptions): DelegateTaskPresentation {
|
||||
const { userCategories } = options
|
||||
const allCategories = mergeCategories(userCategories)
|
||||
const categoryNames = Object.keys(allCategories)
|
||||
const categoryEntries = Object.entries(allCategories).map(([name, categoryConfig]) => ({
|
||||
name,
|
||||
categoryConfig,
|
||||
description: userCategories?.[name]?.description || CATEGORY_DESCRIPTIONS[name],
|
||||
}))
|
||||
const categoryNames = categoryEntries.map(({ name }) => name)
|
||||
const categoryExamples = categoryNames.join(", ")
|
||||
|
||||
const availableCategories: AvailableCategory[] = options.availableCategories
|
||||
?? Object.entries(allCategories).map(([name, categoryConfig]) => {
|
||||
const userDescription = userCategories?.[name]?.description
|
||||
const builtinDescription = CATEGORY_DESCRIPTIONS[name]
|
||||
const description = userDescription || builtinDescription || "General tasks"
|
||||
|
||||
?? categoryEntries.map(({ name, categoryConfig, description }) => {
|
||||
return {
|
||||
name,
|
||||
description,
|
||||
description: description || "General tasks",
|
||||
model: categoryConfig.model,
|
||||
}
|
||||
})
|
||||
|
||||
const availableSkills: AvailableSkill[] = options.availableSkills ?? []
|
||||
|
||||
const categoryList = categoryNames.map(name => {
|
||||
const userDescription = userCategories?.[name]?.description
|
||||
const builtinDescription = CATEGORY_DESCRIPTIONS[name]
|
||||
const description = userDescription || builtinDescription
|
||||
const categoryList = categoryEntries.map(({ name, description }) => {
|
||||
return description ? ` - ${name}: ${description}` : ` - ${name}`
|
||||
}).join("\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user