rtk-ai/rtk

github copilot (v1.0.24) now support modifiedArgs

Open

#1.839 geöffnet am 11. Mai 2026

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clibughelp wantedpriority:high

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

:robot: This was written by an AI agent on behalf of @paolomainardi.

Summary

Since Copilot CLI v1.0.24 (April 10, 2026), preToolUse hooks support modifiedArgs for transparent command rewriting — the same capability Claude Code has had via updatedInput. The official docs now list modifiedArgs as a supported output field.

However, rtk hook copilot (tested on RTK 0.39.0) is a complete no-op: it returns empty stdout + exit 0 for every command, regardless of whether a rewrite exists.

Reproduction

# Claude hook — works (transparent rewrite)
echo '{"tool_name":"bash","tool_input":{"command":"git status"}}' | rtk hook claude
# → {"hookSpecificOutput":{"hookEventName":"PreToolUse",...,"updatedInput":{"command":"rtk git status"}}}

# Copilot hook — no-op (empty output, exit 0)
echo '{"toolName":"terminal","toolInput":{"command":"git status"}}' | rtk hook copilot
# → (nothing)

# But the rewrite engine knows what to do:
rtk hook check --agent copilot git status
# → rtk git status

Expected behavior

rtk hook copilot should output modifiedArgs in the Copilot CLI format:

{"modifiedArgs":{"command":"rtk git status"}}

This would make the Copilot hook functionally equivalent to the Claude Code hook, enabling transparent rewrite instead of the current no-op behavior.

Context

  • The older deny-with-suggestion approach (from #593) was designed before Copilot CLI supported modifiedArgs. Now that it does, the hook should use it.
  • exclude_commands should also be respected in the copilot hook path, same as for Claude Code.
  • Related: #1774 (rtk init -g --copilot global setup), #1425 (run_in_terminal not recognized)
  • The current no-op means Copilot RTK integration relies entirely on instructions ("always prefix with rtk"), which teaches the AI to bypass safety patterns in tools like OpenCode that match on command prefixes.

Environment

  • RTK: 0.39.0
  • Copilot CLI: tested against v1.0.44 docs (installed version 0.0.405)
  • OS: Linux (Arch)

Contributor Guide