Shipped agent.md frontmatter hooks block is dead code: relative script paths, never scaffolded, not executed by any current host
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
調査の方向性
plugins/modernize-java/com.github.copilot/agents/modernize-java.agent.md から始め、issue で説明されている plugin payload と合わせて hooks frontmatter を調査します。出荷される hook carrier または script のいずれかがこれらのコマンドを提供しているか確認します。定義が機能しない hooks を宣伝しなくなっているか、参照されている scripts がパッケージ化され、有効な install-root パスを使用していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The hooks: frontmatter block in plugins/modernize-java/com.github.copilot/agents/modernize-java.agent.md is inherited from the VS Code extension era of this tooling. In the current plugin distribution it is dead code on every host, and the scripts it references are not provisioned anywhere.
What ships today (verbatim frontmatter block)
hooks:
UserPromptSubmit:
- type: command
command: APPMOD_AGENT=modernize-java-upgrade bash "$APPMOD_HOOK_SCRIPTS_DIR/sendTelemetry.sh"
windows: "powershell -ExecutionPolicy Bypass -NonInteractive -Command \"& (Join-Path $env:APPMOD_HOOK_SCRIPTS_DIR 'sendTelemetry.ps1') -AgentName modernize-java-upgrade\""
SubagentStart:
- type: command
command: APPMOD_AGENT=modernize-java-upgrade bash "$APPMOD_HOOK_SCRIPTS_DIR/sendTelemetry.sh"
windows: "powershell -ExecutionPolicy Bypass -NonInteractive -Command \"& (Join-Path $env:APPMOD_HOOK_SCRIPTS_DIR 'sendTelemetry.ps1') -AgentName modernize-java-upgrade\""
SubagentStop:
- type: command
command: APPMOD_AGENT=modernize-java-upgrade bash "$APPMOD_HOOK_SCRIPTS_DIR/sendTelemetry.sh"
windows: "powershell -ExecutionPolicy Bypass -NonInteractive -Command \"& (Join-Path $env:APPMOD_HOOK_SCRIPTS_DIR 'sendTelemetry.ps1') -AgentName modernize-java-upgrade\""
ErrorOccurred:
- type: command
command: APPMOD_AGENT=modernize-java-upgrade bash "$APPMOD_HOOK_SCRIPTS_DIR/sendTelemetry.sh"
windows: "powershell -ExecutionPolicy Bypass -NonInteractive -Command \"& (Join-Path $env:APPMOD_HOOK_SCRIPTS_DIR 'sendTelemetry.ps1') -AgentName modernize-java-upgrade\""
PostToolUse:
- type: command
command: "bash .github/modernize/java-upgrade/hooks/scripts/recordToolUse.sh"
windows: "powershell -NonInteractive -File .github/modernize/java-upgrade/hooks/scripts/recordToolUse.ps1"
Why the block is dead
- The Copilot CLI does not read it. The CLI's documented hook carriers are settings
hooks.*, repo-level.github/hooks/*.json, user-level~/.copilot/hooks/*.json, and plugin-levelhooks/hooks.json— and this plugin ships nohooks/hooks.json. The frontmatter schema the CLI's runtime (checked against the shipped bytes of 1.0.83 and 1.0.86) parses for these definition files has nohooksfield; unknown frontmatter fields are ignored. - The referenced scripts do not exist. The plugin payload is three files —
plugin.json,mcp.json, and the.mditself. Nothing in the repo, the plugin install, or the MCP package ever creates.github/modernize/java-upgrade/hooks/scripts/in the workspace: in@microsoft/github-copilot-app-modernization-mcp-server@1.24.0,recordToolUseand the hook path occur only inside the package's own.agent.mdtemplates, with no writer. - The telemetry legs' variable is never set here.
$APPMOD_HOOK_SCRIPTS_DIRis provided by the VS Code extension's hook environment, which is not part of this distribution, so the foursendTelemetrycommands cannot resolve their scripts either.
Observed behavior
- Plugin
modernize-java@modernize-javav1.24.0, installed from this repo's marketplace (copilot plugin marketplace add microsoft/modernize-java, thencopilot plugin install modernize-java@modernize-java): running a read+edit with a marker script planted at the exact hook path (both the.shand the.ps1leg) produced zero executions across 3 runs, while user-level hooks (~/.copilot/hooks/*.json) fired in the very same runs — session debug logs confirm the plugin's instructions were loaded and at least 3 tool uses completed per run (invoked with--agent modernize-java:modernize-java). A repo-level.github/hooks/postToolUse.jsonalso executed once its documented opt-in was set. The hooks engine is fully live on the documented carriers; the frontmatter block is simply not one of them. - The shipped PostToolUse command run verbatim in a clean workspace exits 127 with no visible diagnostic anywhere:
bash: .github/modernize/java-upgrade/hooks/scripts/recordToolUse.sh: No such file or directory.
Why this is worth cleaning up
- Five hook events silently ignore-or-fail on every session; the block reads as if tool-usage telemetry were configured, but it has never recorded anything in this distribution.
- If any host adds frontmatter
hookssupport, the shipped commands become live immediately — and they resolve their scripts relative to the session's working directory (the opened workspace), not the plugin's install root. A file committed to a repository at.github/modernize/java-upgrade/hooks/scripts/recordToolUse.shwould then be executed by the hook machinery on every tool use (the shipped command demonstrably executes a file planted at that relative path when run as-is; a copy placed only on PATH does not resolve). VS Code's experimental hooks support for custom chat participants already reads this exact frontmatter shape today, gated behind preview flags and workspace trust — so the gap between "ignored" and "live workspace-relative execution" is one host-side change.
Related: github/copilot-cli#3659 ("CLI cannot execute hooks shipped with plugins") covers the relative-path resolution problem on the documented JSON carrier; this issue is about the dead block shipped in this repo.
Suggested fix
Either of:
- strip the
hooks:block from the definition file (nothing in this distribution provisions the scripts it names), or - ship the hook scripts inside the plugin and reference them from the install root (
${PLUGIN_ROOT}-style) instead of a workspace-relative path.
Environment: Windows 11, Copilot CLI 1.0.83 (runtime source checked at 1.0.83 and 1.0.86), plugin v1.24.0, repo at b02350da (2026-09-20).
- 主要言語
- 言語のデータがありません
- スター
- 3
- フォーク
- 0
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/modernize-java のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
microsoft/modernize-java#19 ·
microsoft/modernize-java の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
from:qa priority:P2 reliability tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spec-kitty/spec-kitty#4874 ·
-
0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextcloud/fulltextsearch#1011 ·
-
automation code-quality cookie deep-report documentation improvement quick-win task-mining
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100