From 5a0a86dbeab67905ee07e1ef377522b5100cabcc Mon Sep 17 00:00:00 2001 From: K0IN Date: Wed, 17 Jun 2026 18:51:23 +0000 Subject: [PATCH 1/2] fix(copilot): add missing 'get' to kubectl example in init template The COPILOT_INSTRUCTIONS template translated 'kubectl get pods' to 'rtk kubectl pods', dropping the 'get' subcommand. This caused Copilot agents to run 'rtk kubectl pods' which fails since rtk expects 'rtk kubectl get pods'. Fix: change 'rtk kubectl pods' to 'rtk kubectl get pods' in the COPILOT_INSTRUCTIONS template string. Add regression test to prevent this class of typo in the future. Signed-off-by: K0IN --- src/hooks/init.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/hooks/init.rs b/src/hooks/init.rs index 28363f4ce6..98a869bc2f 100644 --- a/src/hooks/init.rs +++ b/src/hooks/init.rs @@ -3909,7 +3909,7 @@ git status rtk git status git log -10 rtk git log -10 cargo test rtk cargo test docker ps rtk docker ps -kubectl get pods rtk kubectl pods +kubectl get pods rtk kubectl get pods ``` ## Meta commands (use directly) @@ -6889,4 +6889,20 @@ mod tests { hook_path.display() ); } + + #[test] + fn test_copilot_instructions_kubectl_get_not_dropped() { + // Regression: COPILOT_INSTRUCTIONS template previously translated + // 'kubectl get pods' to 'rtk kubectl pods', dropping the 'get' subcommand. + // Copilot agents following the template would run a failing command. + assert!( + COPILOT_INSTRUCTIONS.contains("rtk kubectl get pods"), + "COPILOT_INSTRUCTIONS must include 'rtk kubectl get pods' (not 'rtk kubectl pods')" + ); + assert!( + !COPILOT_INSTRUCTIONS.contains("rtk kubectl pods\n") + && !COPILOT_INSTRUCTIONS.contains("rtk kubectl pods`"), + "COPILOT_INSTRUCTIONS must not contain 'rtk kubectl pods' without 'get'" + ); + } } From b49568ff730608d6ae815a11ed2ab230aecd5657 Mon Sep 17 00:00:00 2001 From: K0IN Date: Sat, 18 Jul 2026 14:27:15 +0200 Subject: [PATCH 2/2] fix(copilot): remove unnecessary test --- src/hooks/init.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/hooks/init.rs b/src/hooks/init.rs index 98a869bc2f..a864da75b9 100644 --- a/src/hooks/init.rs +++ b/src/hooks/init.rs @@ -6889,20 +6889,4 @@ mod tests { hook_path.display() ); } - - #[test] - fn test_copilot_instructions_kubectl_get_not_dropped() { - // Regression: COPILOT_INSTRUCTIONS template previously translated - // 'kubectl get pods' to 'rtk kubectl pods', dropping the 'get' subcommand. - // Copilot agents following the template would run a failing command. - assert!( - COPILOT_INSTRUCTIONS.contains("rtk kubectl get pods"), - "COPILOT_INSTRUCTIONS must include 'rtk kubectl get pods' (not 'rtk kubectl pods')" - ); - assert!( - !COPILOT_INSTRUCTIONS.contains("rtk kubectl pods\n") - && !COPILOT_INSTRUCTIONS.contains("rtk kubectl pods`"), - "COPILOT_INSTRUCTIONS must not contain 'rtk kubectl pods' without 'get'" - ); - } }