Skip to content

Commit ad1972a

Browse files
dwc1997claude
andcommitted
fix(hooks): add type check for hook model config
Add typeof check for hookConfig.model to ensure it's a string before passing to generateSlugViaLLM. This fixes the TypeScript type error where unknown was not assignable to string | undefined. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent eed1d2a commit ad1972a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/hooks/bundled/session-memory/handler.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ async function saveSessionMemoryNow(event: Parameters<HookHandler>[0]): Promise<
233233
if (sessionContent && cfg && allowLlmSlug) {
234234
log.debug("Calling generateSlugViaLLM...");
235235
// Use LLM to generate a descriptive slug, honoring hook-level model override
236-
slug = await generateSlugViaLLM({ sessionContent, cfg, model: hookConfig?.model });
236+
const hookModel = typeof hookConfig?.model === "string" ? hookConfig.model : undefined;
237+
slug = await generateSlugViaLLM({ sessionContent, cfg, model: hookModel });
237238
log.debug("Generated slug", { slug });
238239
}
239240
}

0 commit comments

Comments
 (0)