Skip to content

--agent code-review fails before inference with "Selected custom agent system prompt callback is unavailable" #5178

Open

Description

@tmolina90

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:

  1. If direct built-in selection is supported, execute the selected profile with the supplied prompt.
  2. If code-review is 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions