Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds getSuggestionMode(...) and applies it to normalize follow-up suggestion modes across types, backend task payloads, ChatView/FollowUpSuggest rendering, and related tests. ChangesSuggestion Mode Normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/types/src/followup.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/types/src/followup.ts`:
- Around line 25-36: The getSuggestionMode function currently validates strings
by trimming but returns the original untrimmed values; update it so both return
paths return trimmed strings: when mode is a string trim and return it, and when
extracting mode_slug (modeSlug) trim and return that trimmed value if non-empty;
otherwise return undefined. Ensure you reference getSuggestionMode, the mode
parameter and modeSlug extraction to locate and change the two return points.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bb6f49e6-a71c-45b3-b76c-8d7ab0983f2f
📒 Files selected for processing (7)
packages/types/src/followup.tssrc/core/tools/AskFollowupQuestionTool.tssrc/core/tools/__tests__/askFollowupQuestionTool.spec.tswebview-ui/src/components/chat/ChatView.tsxwebview-ui/src/components/chat/FollowUpSuggest.tsxwebview-ui/src/components/chat/__tests__/ChatView.spec.tsxwebview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Related GitHub Issue
Closes: #413
Description
Fixes a webview crash when rendering follow-up suggestions whose
modevalue is malformed as an object, such as{ "mode_slug": "code" }, instead of a string.The issue reported React error #31 from
FollowUpSuggest, where React attempted to render the malformed object directly. This PR hardens the follow-up flow in two places:AskFollowupQuestionToolbefore follow-up data is stored/sent to the webview.Test Procedure
Validated locally with Node
v20.20.2and pnpm10.8.1:pnpm --dir webview-ui exec vitest run src/components/chat/__tests__/FollowUpSuggest.spec.tsxpnpm --dir src exec vitest run core/tools/__tests__/askFollowupQuestionTool.spec.tspnpm --filter zoo-code check-typespnpm --filter @roo-code/vscode-webview check-typespnpm --filter @roo-code/vscode-webview test -- src/components/chat/__tests__/FollowUpSuggest.spec.tsxPre-Submission Checklist
Screenshots / Videos
Not applicable. This is a crash fix covered by focused React and tool tests.
Documentation Updates
Additional Notes
pnpm --filter zoo-code test -- core/tools/__tests__/askFollowupQuestionTool.spec.tswas also attempted through the package script, but that script ran the broadersrcsuite in this workspace. The focused regression test passed directly, and the broader run failed only on unrelated local/environment tests.Get in Touch
N/A
Summary by CodeRabbit
Bug Fixes
Tests