fix(init): only show 'Restart your IDE' hint for IDE-embedded tools - #1610
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (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
alfred-openspec
left a comment
There was a problem hiding this comment.
The restart hint now follows explicit IDE-tool metadata and only appears when a successful IDE tool receives artifacts; CLI-only and mixed-tool cases are covered. Exact-head checks pass.
Reconstructed on current main (the original branch predated the Codex .agents rename, Command Code, Rovo Dev, Antigravity, Zoo Code, and the Kimi/Windsurf changes, so a direct rebase conflicted heavily in config.ts/init.ts/init.test.ts). Adds requiresIdeRestart to AIToolOption and gates the success-screen restart hint so it shows only when an IDE-resident tool actually received a surface. Wording follows that tool's own surface. Closes #1067. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
af80903 to
5c65d85
Compare
|
Rebased onto current main by reconstruction: the original branch predated several AI_TOOLS changes (Codex→ |
Deploying openspec-docs with
|
| Latest commit: |
6554ce3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://683f430d.openspec-docs.pages.dev |
| Branch Preview URL: | https://claude-pr-1097-merge-ready-9.openspec-docs.pages.dev |
alfred-openspec
left a comment
There was a problem hiding this comment.
Revalidated the refreshed head: the restart metadata and decision logic are unchanged from the approved version; the main integration only adds Command Code coverage and type cleanup. Five restart-focused tests and the exact-head hosted matrix pass.
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