Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jun 25, 2025

Description

Fixes #5100

Resolves the issue where Roo Code hangs when users attempt to send images to the Claude Code provider. The root cause was a missing case in the useSelectedModel hook for the "claude-code" provider, which caused it to fall through to the default case and return incorrect model information.

Changes Made

  • Added missing "claude-code" case in useSelectedModel hook - The hook now properly handles the claude-code provider and returns the correct model information
  • Ensures proper model capabilities are reported - Claude Code models correctly report supportsImages: false
  • Prevents UI from allowing image uploads - The image input is now properly disabled when Claude Code provider is selected
  • Maintains consistency with other providers - Follows the same pattern as other provider cases in the switch statement

Testing

  • All existing tests pass (487 tests passed)
  • Specific tests for useSelectedModel hook pass (9 tests)
  • No linting errors
  • Type checking passes
  • Manual testing completed:
    • Verified Claude Code provider selection works correctly
    • Confirmed image input is disabled when Claude Code is selected
    • Tested that other providers still work as expected

Verification of Acceptance Criteria

  • Application no longer hangs - Fixed by preventing image upload attempts to Claude Code
  • Image input properly disabled - The UI now correctly disables image input when Claude Code provider is selected
  • Clear user experience - Users can no longer attempt to send images to a provider that doesn't support them
  • No breaking changes - Other providers and functionality remain unaffected

Code Quality

  • Code follows project style guidelines
  • Self-review completed
  • Minimal, targeted fix that addresses the specific issue
  • No breaking changes
  • Maintains backward compatibility
  • Follow existing code patterns and conventions

Files Changed

  • webview-ui/src/components/ui/hooks/useSelectedModel.ts - Added claude-code case to properly return model info with supportsImages: false

Impact

  • Performance: No impact, minimal code change
  • Security: No security implications
  • User Experience: Significantly improved - eliminates hanging and provides proper UI state
  • Compatibility: Fully backward compatible

This fix implements the suggested solution from the issue description by preventing users from encountering the hanging issue when using the Claude Code provider.


Important

Fixes hanging issue with claude-code provider by updating useSelectedModel to handle it correctly and disable image support.

  • Behavior:
    • Fixes hanging issue when sending images to claude-code provider by adding a missing case in useSelectedModel in useSelectedModel.ts.
    • claude-code models now correctly report supportsImages: false.
    • Disables image input in UI when claude-code is selected.
  • Testing:
    • Added tests in useSelectedModel.spec.ts to verify claude-code behavior, including default model handling and image support.
  • Misc:
    • Ensures consistency with other providers in the switch statement of getSelectedModel().

This description was created by Ellipsis for 552e04e. You can customize this summary. It will automatically update as commits are pushed.

- Add missing claude-code case in useSelectedModel hook
- Ensures proper model info is returned with supportsImages: false
- Prevents UI from allowing image uploads to claude-code provider
- Fixes application hang when attempting to send images to claude-code
@Copilot Copilot AI review requested due to automatic review settings June 25, 2025 05:30
@hannesrudolph hannesrudolph requested review from cte, jr and mrubens as code owners June 25, 2025 05:30
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jun 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the hang issue when using the Claude Code provider by adding a missing case in the useSelectedModel hook. The changes include adding the claude-code case, importing the necessary default model ID and models, and ensuring proper model capabilities are returned so that image uploads are correctly disabled for the provider.

  • Added "claude-code" case in the useSelectedModel hook.
  • Imported claudeCodeDefaultModelId and claudeCodeModels to support the new case.
  • Returns the correct model information to disable image uploads.

webview-ui/src/components/ui/hooks/useSelectedModel.ts Outdated Show resolved Hide resolved
Copy link

delve-auditor bot commented Jun 25, 2025

No security or compliance issues detected. Reviewed everything up to 2bd3b91.

Security Overview
  • 🔎 Scanned files: 2 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► useSelectedModel.spec.ts
    Add claude-code provider tests
► useSelectedModel.ts
    Add claude-code provider support

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 25, 2025
- Add comprehensive test cases for claude-code provider in useSelectedModel hook
- Verify that claude-code models correctly report supportsImages: false
- Test default model selection when no modelId is specified
- Add inline documentation explaining claude-code's disabled features
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 25, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 25, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 25, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 25, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jun 25, 2025
@mrubens mrubens merged commit 83c19ce into main Jun 25, 2025
17 checks passed
@mrubens mrubens deleted the fix/issue-5100-claude-code-image-hang branch June 25, 2025 20:08
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 25, 2025
daniel-lxs added a commit that referenced this pull request Jun 25, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Alorse pushed a commit to Alorse/Roo-Code that referenced this pull request Jun 27, 2025
…deInc#5105)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
hannesrudolph added a commit that referenced this pull request Jul 3, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
@kaizendevsio
Copy link

Can we not have the ability to paste pictures into roo code using the claude code provider? Isnt this possible? #5100 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug: Roo hangs when sending an image to the Claude Code provider

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.