Repository navigation
fix(init): install VS Code Copilot Chat instructions on global copilot init - #4678
Open
ShryukGrandhi wants to merge 1 commit into
Open
ShryukGrandhi wants to merge 1 commit into
ShryukGrandhi wants to merge 1 commit into
Conversation
…t init rtk init -g --copilot only wrote ~/.copilot/copilot-instructions.md, which Copilot CLI reads but VS Code Copilot Chat ignores. Also write ~/.copilot/instructions/rtk.instructions.md with applyTo: "**" front matter, remove it on uninstall, and stop describing the global install as CLI-only. Fixes rtk-ai#2216 Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
📊 Automated PR Analysis
SummaryFixes global Review Checklist
Linked issues: #2216 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk init -g --copilotonly wrote the RTK block to~/.copilot/copilot-instructions.md. Copilot CLI reads that file, but VS Code Copilot Chat does not: it loads user-level instructions from~/.copilot/instructions/*.instructions.md, and only attaches a file to every request when its front matter hasapplyTo: "**". That is the workaround the reporter applied by hand. Global init now also writes~/.copilot/instructions/rtk.instructions.md(RTK-owned,applyTo: "**"front matter plus the same instructions). Global uninstall removes it, and--dry-runlists it.rtk init -gas "Claude Code / Copilot (default)", but that command installs Claude Code only. It now showsrtk init -g --copiloton its own line.supported-agents.mddocuments the new file and the uninstall behavior.The hook location (
~/.copilot/hooks/rtk-rewrite.json) and the user-scoped reporting were already fixed by #2101. This PR covers the part of the issue that is still open.Fixes #2216
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test --all(clean, all pass)test_copilot_global_install_writes_vscode_instructionsandtest_copilot_global_uninstall_removes_vscode_instructionsfail ondevelopand pass with the fix. The existing global dry-run test now also asserts that noinstructions/directory gets created.COPILOT_HOME=<tmp> rtk init -g --copilot --dry-run, then the real install, then--uninstall, and checked the file list, the front matter, and the cleanup. I could not test VS Code Copilot Chat loading the file end to end on this machine.