You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent host: repo hooks silently skipped when workspace is opened via a symlinked path (/tmp) #347733
In the Copilot harness (agent host), repository hooks in .github/hooks/*.json silently don't run when the workspace is opened through a symlinked path, for example /tmp/... on macOS, which resolves to /private/tmp/.... Hooks load and appear in the Customizations view, but none of their commands execute, and no warning is shown.
Impact
Anyone who opens a repo through a symlinked path (/tmp, a symlinked home or projects folder) gets no repo hooks, including security guards like PreToolUse deny hooks, with no indication anything is wrong.
Repro (macOS, VS Code Insiders 1.147.0, runtime 1.0.110-0)
Create a git repo at /tmp/hook-probe with .github/hooks/hook.json:
{"hooks":{"SessionStart":[{"type":"command","command":"echo ran >> /tmp/hook-marker.log"}],
"UserPromptSubmit":[{"type":"command","command":"echo ran >> /tmp/hook-marker.log"}]}}
code-insiders -n /tmp/hook-probe, pick the Copilot harness, send "Say hi".
Expected:/tmp/hook-marker.log has two lines. Actual: the file is never created.
Repeat with the same repo at ~/hook-probe (a non-symlinked path, also not in trustedFolders): both hooks run.
What I observed
agenthost.log: Granting the runtime 'session' trust for trusted working directory /tmp/hook-probe
The runtime session's cwd (session-state workspace.yaml) is /private/tmp/hook-probe.
The Customizations view lists the repo hooks as loaded.
Session events show only VS Code's SDK-callback hooks firing, not the repo file hooks.
The Copilot CLI with COPILOT_ALLOW_ALL=true in the same /tmp folder runs the hooks.
Likely cause (not confirmed in code)
VS Code grants trust for the unresolved path (/tmp/...) while the runtime tracks the resolved path (/private/tmp/...), so the trust doesn't match and repo hooks are skipped. VS Code side: src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts (getCopilotWorkingDirectoryTrust).
Suggested fix
Canonicalize (realpath) the working directory before granting trust to the runtime. If repo hooks are skipped for trust reasons, show a warning in the session, as the CLI does ("Skipped repository hooks ... not trusted").
Activity
agentHost: give the Copilot runtime the real path of a symlinked folder
agentHost: give the Copilot runtime the real path of a symlinked folder
agentHost: give the Copilot runtime the real path of a symlinked folder
agentHost: give the Copilot runtime the real path of a symlinked folder
agentHost: give the Copilot runtime the real path of a symlinked fold…