Repository navigation
fix: don't pass --continue on first run - #667
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughStarts fresh Claude sessions by default: continuation name is now undefined and a continue-fallback is added. Also increments plugin/package versions from 3.260318.5 to 3.260318.6 across manifests. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented Claude Code from initializing correctly on its first execution due to an erroneous attempt to resume a non-existent conversation. By modifying the session creation logic to only apply the continuation flag for established sessions, the system now starts new conversations seamlessly. Additionally, this change includes a routine version bump across several project files. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a bug where the --continue flag was incorrectly passed when creating a new session, leading to an error. The fix, located in the createSession function within src/genie-commands/session.ts, correctly omits this flag on the initial run by passing undefined for the continueName parameter to buildClaudeCommand. The associated log message has also been updated for consistency. The logic for subsequent runs, which correctly use the --continue flag, is unaffected. The change is precise and effectively resolves the reported issue.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5f48e2fcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| console.log(`Continuing session by name: ${continueName}`); | ||
| const cmd = buildClaudeCommand(windowName, systemPromptFile || undefined, continueName); | ||
| // First run — no session to continue, just start fresh with --name | ||
| const cmd = buildClaudeCommand(windowName, systemPromptFile || undefined, undefined); |
There was a problem hiding this comment.
Restore --continue for restarted tmux sessions
This hard-codes continueName to undefined, so every createSession launch starts a fresh Claude conversation. createSession runs any time tmux.findSessionByName(...) returns null (for example after a tmux server restart or if the session was killed), which means a later genie run from the same directory can no longer resume the prior named session context. That contradicts the “only on first run” intent and regresses persistence for returning sessions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/genie-commands/session.ts`:
- Line 190: Replace the console.log call that prints "Started Claude Code as
${agentName} in ${workspaceDir}" with the project's structured logger (e.g., use
the existing logger or processLogger instance used elsewhere in session.ts) and
log at an appropriate level (info). Ensure you keep the same message and include
agentName and workspaceDir variables, and add/import the logger (or use the
file's existing logger variable) if it's not already present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 39759266-d682-42ed-8326-c8736eac1b50
📒 Files selected for processing (6)
.claude-plugin/marketplace.jsonopenclaw.plugin.jsonpackage.jsonplugins/genie/.claude-plugin/plugin.jsonplugins/genie/package.jsonsrc/genie-commands/session.ts
| const cmd = buildClaudeCommand(windowName, systemPromptFile || undefined, undefined); | ||
| await tmux.executeTmux(`send-keys -t ${shellQuote(target)} ${shellQuote(cmd)} Enter`); | ||
| console.log(`Started Claude Code as ${agentName}@${continueName} in ${workspaceDir}`); | ||
| console.log(`Started Claude Code as ${agentName} in ${workspaceDir}`); |
There was a problem hiding this comment.
Replace console.log in source TypeScript.
Line 190 uses console.log, which violates the source logging guideline for .ts files.
Proposed fix
- console.log(`Started Claude Code as ${agentName} in ${workspaceDir}`);
+ process.stdout.write(`Started Claude Code as ${agentName} in ${workspaceDir}\n`);As per coding guidelines "**/*.ts: No console.log statements in source code (relaxed in test files)".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| console.log(`Started Claude Code as ${agentName} in ${workspaceDir}`); | |
| process.stdout.write(`Started Claude Code as ${agentName} in ${workspaceDir}\n`); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/genie-commands/session.ts` at line 190, Replace the console.log call that
prints "Started Claude Code as ${agentName} in ${workspaceDir}" with the
project's structured logger (e.g., use the existing logger or processLogger
instance used elsewhere in session.ts) and log at an appropriate level (info).
Ensure you keep the same message and include agentName and workspaceDir
variables, and add/import the logger (or use the file's existing logger
variable) if it's not already present.
…d-pane relaunch
Bug 1: Inside-tmux path always passed --continue with a random-suffixed name
that could never match an existing conversation, causing "No conversation found"
errors. Removed --continue since the random suffix guarantees a fresh session.
Bug 2: focusTeamWindow had no else branch — when a tmux window existed but
Claude Code had exited, nothing relaunched it. Added dead-pane detection via
#{pane_current_command} and relaunch with --continue fallback.
Extracted launchWithContinueFallback() helper used by both the created=true
path and the new dead-pane else branch. Tries --continue first, waits 3s,
falls back to fresh if CC isn't running.
fix(session): fallback to fresh session when --continue fails
First run has no session to continue — CC fails with 'No conversation found'. Now only passes --continue on subsequent runs. Merge commit only.
Summary by CodeRabbit
Chores
Bug Fixes
Tests