Skip to content

No way to restrict which agent types the task tool can dispatch per custom agent. #2812

Description

@BeyondImaginati0n

Summary
There is no supported way to limit which agent types a given custom agent may delegate to through the task tool. The agent_type enum of the task tool is built per session. It lists every built-in agent and every discovered or registered custom agent, whichever agent is calling.

A frontmatter property like agents: [...] would be the natural place to configure this,same as vscode agent mode discovers it (https://code.visualstudio.com/docs/agent-customization/custom-agents). Now It is not supported in either of the two ways agents are defined:

1.Auto-discovered .github/agents/*.agent.md with enable_config_discovery=True. "agents" property in agents.md is silently ignored.

2.Manual custom_agents=[...]: CustomAgentConfig has no "agents" field, and an extra "agents" key is silently dropped.

Verified in Environment:
github-copilot-sdk 1.0.16 (Python), pinned CLI 1.0.90
Linux, Python 3.12

Expected behaviour
One of these should exist:

-With enableConfigDiscovery=True: agents: [worker-a] in an .agent.md limits the agent_type values the task tool accepts when that agent calls it. The tool schema and the runtime validation ("Unknown agent_type … Valid types are") would both reflect it.
-SDK config: CustomAgentConfig gains the same field (for example agents: list[str]), mapped to the CLI wire format.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions