Repository navigation
Conversation
…mand "Copy Resume Command" copied `claude --resume <id>`, which resumes in whatever directory the terminal happens to be in — so users had to manually cd into the project first. Prefix the command with `cd "<cwd>"` using the project's resolved path (the encoded project dir is the session's launch cwd), quoted so paths with spaces survive the paste. Falls back to the bare command when the path can't be resolved. The command builder is extracted as a pure, unit-tested helper (buildResumeCommand).
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function buildResumeCommand to automatically change directories to the session's working directory before resuming a Claude Code session, updating the context menu to use this command. The feedback suggests normalizing Windows backslashes to forward slashes to prevent shell syntax errors on cross-platform environments, along with adding a corresponding unit test.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesResume Command with Project Path
Suggested labels: Merge Risk: ⚪ Minimal · up to The copied resume command now includes the resolved project directory with shell-safe quoting while preserving the fallback command when no path is available. No current merge-blocking risk is established. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
src/renderer/utils/resumeCommand.tsOops! Something went wrong! :( ESLint: 9.39.5 Error: Error while loading rule 'tailwindcss/no-contradicting-classname': Could not find tailwindcss test/renderer/utils/resumeCommand.test.tsESLint skipped: the matched ESLint configuration already failed (plugin-compatibility). 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
🧹 Nitpick comments (1)
test/renderer/utils/resumeCommand.test.ts (1)
3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the
@rendereralias for this import.Reaching into
srcvia../../../makes the test brittle and sidesteps the repo's import convention.@renderer/utils/resumeCommandkeeps this as a direct file import without coupling the test to directory depth.Suggested change
-import { buildResumeCommand } from '../../../src/renderer/utils/resumeCommand'; +import { buildResumeCommand } from '`@renderer/utils/resumeCommand`';As per coding guidelines, "Use path aliases for imports" and "Renderer utils, hooks, and types should NOT use barrel exports - import directly from specific files."
🤖 Prompt for 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. In `@test/renderer/utils/resumeCommand.test.ts` at line 3, The test import is using a brittle relative path instead of the repo’s renderer alias. Update the import in resumeCommand.test.ts to use `@renderer/utils/resumeCommand` directly, matching the import convention for renderer utils and avoiding coupling the test to directory depth.Source: Coding guidelines
🤖 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 `@src/renderer/utils/resumeCommand.ts`:
- Around line 10-15: The buildResumeCommand helper is inserting both cwd and
sessionId directly into a shell command, which can break on special characters
and allow shell expansion; update buildResumeCommand to use POSIX-safe single
quoting for both arguments before assembling the resume command. Keep the
existing command structure, but ensure the quoted cwd is used in the cd step and
the quoted sessionId is passed to claude --resume.
---
Nitpick comments:
In `@test/renderer/utils/resumeCommand.test.ts`:
- Line 3: The test import is using a brittle relative path instead of the repo’s
renderer alias. Update the import in resumeCommand.test.ts to use
`@renderer/utils/resumeCommand` directly, matching the import convention for
renderer utils and avoiding coupling the test to directory depth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7c366c4f-1b22-4afa-bcb4-759aaf8efd79
📒 Files selected for processing (3)
src/renderer/components/sidebar/SessionContextMenu.tsxsrc/renderer/utils/resumeCommand.tstest/renderer/utils/resumeCommand.test.ts
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Why
The sidebar copied
claude --resume <id>, so the resumed session started in whichever directory the terminal already used. Paths with spaces, quotes, shell variables, or Windows separators also made a pasted command unreliable.What
The copied command now changes to the session's resolved project directory first. Both the directory and session ID use POSIX-safe single quoting, and Windows backslashes are normalized before quoting. If no project path is available, the command stays as a bare resume command.
Validation
Raw logs
Refs #34
Summary by CodeRabbit
New Features
Bug Fixes