Skip to content

Invalid Model Name Causes Silent Failures in Claude Code Sessions #7

@sldx

Description

@sldx

Claudia successfully detects and connects to Claude CLI but fails to display
responses when users send prompts. The interface appears to "hang" or "sit there
doing nothing" with no error messages shown to the user.

Root Cause

Claudia is passing an invalid model name "claude-4-sonnet" to the Claude CLI,
which returns a 400 error: "Invalid model name". However, this error is not
displayed in the UI, causing the session to appear unresponsive.

Reproduction Steps

  1. Install Claudia and ensure Claude CLI is in PATH (may require symlink to
    /usr/local/bin/claude)
  2. Open any project in Claudia
  3. Start a new Claude Code session
  4. Type any prompt and press Enter
  5. Observe: Loading indicator appears but no response is ever displayed

Expected Behavior

  • Prompt should receive a response from Claude
  • If there's an API error, it should be displayed to the user

Actual Behavior

  • Interface shows loading state indefinitely
  • No response appears
  • No error message shown to user
  • Session appears "hung"

Technical Details

CLI Command Being Executed:
claude -p "hello" --model "claude-4-sonnet" --output-format stream-json --verbose
--dangerously-skip-permissions

Actual Error Response:
{
"type": "assistant",
"message": {
"content": [{"type": "text", "text": "API Error: 400 {"type":"error","er
ror":{"type":"invalid_request_error","message":"system: Invalid model
name"}}"}]
}
}

Correct Model Name:
The valid model name should be "claude-sonnet-4-20250514" (confirmed by running
Claude CLI without --model flag).

Suggested Fix

  1. Update model name: Change "claude-4-sonnet" to "claude-sonnet-4-20250514" in
    the frontend model selection
  2. Improve error handling: Ensure API errors from Claude CLI are properly
    displayed in the UI instead of causing silent failures
  3. Add model validation: Consider validating model names or providing a dropdown
    with valid options

Code Locations (Likely)

  • Frontend model selection logic in React components
  • Default model configuration
  • Error handling in ClaudeCodeSession.tsx around the event listeners for
    claude-output

System Info

  • macOS (Darwin 24.5.0)
  • Claude CLI version: 1.0.30
  • Issue affects both new sessions and resumed sessions

Workaround

Manually changing the model name to "claude-sonnet-4-20250514" in the code should
resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions