fix: guard against undefined modelID in anthropic-effort hook

Add early return when model.modelID or model.providerID is nullish,
preventing TypeError at runtime when chat.params receives incomplete
model data.
This commit is contained in:
YeonGyu-Kim
2026-02-06 21:55:13 +09:00
parent ec520e6228
commit cb2169f334
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -39,6 +39,7 @@ export function createAnthropicEffortHook() {
output: ChatParamsOutput
): Promise<void> => {
const { model, message } = input
if (!model?.modelID || !model?.providerID) return
if (message.variant !== "max") return
if (!isClaudeProvider(model.providerID, model.modelID)) return
if (!isOpus46(model.modelID)) return