-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Bug: analyze-prompt fails with "does not support thinking" error when using Haiku model
Environment
- vibe-log-cli: v0.7.2
- Claude Code SDK: @anthropic-ai/claude-code v1.0.128
- Claude Code settings:
alwaysThinkingEnabled: true
Issue
The analyze-prompt command fails when called from the UserPromptSubmit hook with exit code 1:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"'claude-3-5-haiku-20241022' does not support thinking."}}
Root Cause
The SDK query uses haiku as the default model, but when Claude Code has alwaysThinkingEnabled: true in settings, the SDK enables thinking mode globally. Haiku doesn't support thinking, causing the API request to fail.
Reproduction
- Set
alwaysThinkingEnabled: truein~/.claude/settings.json - Configure
UserPromptSubmithook:npx vibe-log-cli analyze-prompt --stdin --silent - Submit any prompt in Claude Code
- Hook fails with "does not support thinking" error
Proposed Fix
In src/lib/prompt-analyzer.ts, either:
Option 1: Use Sonnet instead of Haiku for analysis
const selectedModel = options.model || 'sonnet'; // Supports thinkingOption 2: Explicitly disable thinking in queryOptions
const queryOptions = {
maxTurns: 1,
model: selectedModel,
disallowedTools: ["*"],
maxThinkingTokens: 0, // Disable thinking for Haiku compatibility
cwd: tempAnalysisDir
};Option 3: Check Claude Code settings and choose model accordingly
const claudeSettings = readClaudeSettings();
const selectedModel = claudeSettings.alwaysThinkingEnabled
? 'sonnet' // Use Sonnet if thinking is enabled
: 'haiku'; // Use Haiku otherwiseWorkaround
Users can manually patch the installed package or set alwaysThinkingEnabled: false in their Claude Code settings (though this affects the entire Claude Code experience).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels