Repository navigation
--agent code-review fails before inference with "Selected custom agent system prompt callback is unavailable" #5178
Description
Describe the bug
Selecting the built-in code-review profile with copilot --agent code-review fails with an internal system-prompt callback error before inference. A normal CLI coordinator can successfully invoke code-review as a synchronous task in the same environment.
It is unclear whether direct selection of this built-in is supported. If it is intentionally subagent-only, the CLI should reject this selection with actionable guidance rather than an internal callback failure.
Affected version
GitHub Copilot CLI 1.0.98.
Steps to reproduce the behavior
Run a code-free prompt with the built-in selected:
env -u GH_TOKEN -u GITHUB_TOKEN copilot \
--agent code-review \
--model gpt-6.1-sol \
--reasoning-effort xhigh \
--silent --stream off --log-level error \
--no-ask-user \
-p 'Reply with exactly OK. Do not read files or call tools.'The reproduction uses the existing Copilot login and does not require a pull request, source files, or an actual code review.
Observed result:
- Exit status:
1. - Stdout: empty.
- Stderr:
Error executing prompt: Error: GenericFailure, host interaction call failed: Error: Selected custom agent system prompt callback is unavailable
Separately captured usage output reported:
{
"totalUserRequests": 0,
"totalApiDurationMs": 0,
"modelMetrics": {},
"agentMetrics": {},
"lastCallInputTokens": 0,
"lastCallOutputTokens": 0
}These are selected fields, not the complete usage document.
Expected behavior
Either:
- If direct built-in selection is supported, execute the selected profile with the supplied prompt.
- If
code-reviewis intentionally subagent-only, fail early with a clear message explaining the restriction and the supported invocation route.
Please clarify the intended support for built-in agents with --agent.
Additional context
- Operating system: macOS 26.6.2.
- Architecture: arm64.
- Requested model and reasoning effort:
gpt-6.1-sol,xhigh. - Successful comparison: a normal CLI coordinator invoked exactly one synchronous task with
agent_type: code-review. The reviewer completed and its final response was returned to the coordinator. - Direct selection and task delegation are distinct routes. The successful delegated run does not establish the cause of the direct-selection failure.
- The root cause is unknown. This report does not assume that a missing custom agent file is responsible.
- The failure also occurred in a separate review invocation; the code-free reproduction above removes the need to disclose that repository or its contents.
- No private source code, repository identifiers, credentials, session identifiers, or raw execution logs are included.
Activity