Describe the bug
GitHubCopilotAgent session behavior depends on which working directory the agent happens to run in.
The Copilot CLI supports file hooks defined in a checkout's .github/hooks/, controlled by the SDK enable_file_hooks session option. The agent never sets that option, so it inherits the runtime default and the surrounding checkout can change how a session behaves.
This makes runs harder to reason about and reproduce: the same agent, the same options, and the same prompt can behave differently depending only on the directory the process started in. It also sits outside the options the agent gives an explicit default (today just on_permission_request), so there is no single place a caller can see or control it.
Expected behavior
A session should behave the same way regardless of the working directory, unless the caller opts in. enable_file_hooks should have an explicit default of False in _build_session_kwargs, be surfaced as a documented GitHubCopilotOptions key, and remain settable through default_options or per-run options for callers that do want checkout-driven hooks.
Options that only shape prompt context, such as enable_host_git_operations, should be left alone.
Platform
- Language: Python
- Package:
agent-framework-github-copilot
Describe the bug
GitHubCopilotAgentsession behavior depends on which working directory the agent happens to run in.The Copilot CLI supports file hooks defined in a checkout's
.github/hooks/, controlled by the SDKenable_file_hookssession option. The agent never sets that option, so it inherits the runtime default and the surrounding checkout can change how a session behaves.This makes runs harder to reason about and reproduce: the same agent, the same options, and the same prompt can behave differently depending only on the directory the process started in. It also sits outside the options the agent gives an explicit default (today just
on_permission_request), so there is no single place a caller can see or control it.Expected behavior
A session should behave the same way regardless of the working directory, unless the caller opts in.
enable_file_hooksshould have an explicit default ofFalsein_build_session_kwargs, be surfaced as a documentedGitHubCopilotOptionskey, and remain settable throughdefault_optionsor per-run options for callers that do want checkout-driven hooks.Options that only shape prompt context, such as
enable_host_git_operations, should be left alone.Platform
agent-framework-github-copilot