fix(init): only show 'Restart your IDE' hint for IDE-embedded tools - #1610
fix(init): only show 'Restart your IDE' hint for IDE-embedded tools#1610clay-good wants to merge 5 commits into
Conversation
displaySuccessMessage accessed tool.requiresIdeRestart on objects derived from results.createdTools / results.refreshedTools, but the parameter type was an inline anonymous shape that didn't include the field. Use the existing SelectedTool type so the access is type-safe.
# Conflicts: # src/core/config.ts # src/core/init.ts # test/core/init.test.ts
|
Warning Review limit reached
Next review available in: 19 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesIDE restart guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 `@src/core/init.ts`:
- Around line 1279-1287: Update the restart-hint logic around
anyRequiresIdeRestart so eligibility is calculated per successful tool,
requiring tool.requiresIdeRestart together with that tool’s corresponding
shouldGenerateCommands and shouldGenerateSkills results; derive the message’s
commands/skills wording from those same IDE-tool artifacts rather than
aggregated totals. Add a regression test covering mixed restart-marked and CLI
tools, including the case where only skills are generated.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1165dfcc-9f8e-4977-8ee3-24b3da820c56
📒 Files selected for processing (4)
.changeset/restart-ide-hint.mdsrc/core/config.tssrc/core/init.tstest/core/init.test.ts
…E tools Address CodeRabbit's Major finding on the restart-hint gate: the previous condition checked "some tool is IDE-resident" AND "some tool generated a surface" as independent aggregates, so a CLI tool's output could trigger the hint for an unrelated IDE tool, and the message could say "commands" when the IDE tool only generated skills. Compute restartCommandsGenerated / restartSkillsGenerated per-tool, coupling "requiresIdeRestart" and the shouldGenerate* result to the SAME tool; drive both the gate and the wording from them. Also flag four high-confidence standalone-IDE tools that main added after #1097 was written (Antigravity, Kiro, Lingma, Qoder) so genuine IDEs keep their restart hint instead of silently losing it under the unflagged default. The two genuinely dual-surface tools (CodeArts, ZCode) are left unflagged: under-flagging only costs a missing hint, over-flagging reintroduces #1067. Add a mixed CLI+IDE regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Second review pass follow-ups: - Expand the requiresIdeRestart doc comment to record that a per-tool boolean cannot distinguish the IDE vs CLI variant of tools that ship both (Continue, Amazon Q); they are flagged as IDE because that is the common case. - Add two tests pinning the hint wording branches: an IDE tool with a command surface says "…new commands…"; the same tool under skills-only delivery says "…new skills…". Previously only the presence/absence of the line was covered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Status: Merge-ready. Supersedes #1097 (rebased onto current
main, conflicts resolved, regression gate verified, hardened). Fixes #1067.This is a conflict-resolved, hardened continuation of @mvanhorn's #1097 — original authorship is preserved in the commit history. #1097 was opened against an older
mainand went stale (tool list renamed/expanded, restart-message logic changed).What was wrong
After
openspec init, the success screen always printed "Restart your IDE for slash commands to take effect." — even for CLI tools (Claude Code, Codex, Gemini CLI, …) that have no editor process to restart. Their commands/skills work as soon as the files exist. #1067 reports the confusing always-on message.How it's fixed
requiresIdeRestart?: booleantoAIToolOption(src/core/config.ts) and marks the IDE/editor-resident tools.validateToolsinto the validated tool objects (src/core/init.ts).Tool classification (15 flagged)
IDE/editor-resident (get the hint): Amazon Q, Antigravity, Cline, Continue, CoStrict, Cursor, Devin Desktop (Windsurf), GitHub Copilot, Junie, Kilo Code, Kiro, Lingma, Qoder, Trae, Zoo Code (RooCode).
All terminal-invoked tools are left unflagged (Claude Code, Codex, Gemini CLI, Qwen, Kimi, Crush, OpenCode, Rovo, Hermes, …). Two genuinely dual-surface tools — CodeArts and ZCode — are deliberately left unflagged: under-flagging only costs a missing hint, while over-flagging a CLI tool would reintroduce #1067. Maintainers can flip either with a one-line change.
Merge-resolution notes (vs. original #1097)
mainuses aValidatedInitTooltype; the flag was added there and the PR's parallelSelectedTooltype was dropped (no dangling refs).mainhad already made the message conditional on generated surfaces and varied its wording ("…for the new commands/skills"); the IDE gate is composed with that.Proof it works
claude) shows no restart line; IDE tool (cursor) does; mixed CLI+IDE (claude,cursor) does; a pre-existingmaintest that assertedcodex(a CLI) should show the line was corrected to assert no line.eslint✅, full suite green locally and on CI (linux/macos/windows all ✅). The only 2 failures seen onmain(artifact-workflow"creates skills for Cursor tool",config-profilePATH-resolution) reproduce identically on untouchedmain— pre-existing, unrelated.Follow-up (out of scope)
openspec updatestill prints the restart hint unconditionally (src/core/update.ts:390) — the same bug on the other command. Tracked separately in #1608.Related: #1076 (empty
/opsx:slash menu) is a different root cause — command discovery, not the message — so it is not fixed here.AI was used for assistance.
Summary by CodeRabbit
New Features
openspec initguidance by showing IDE restart instructions only for supported IDE-based tools that require a restart.Bug Fixes
Tests