Skip to content

Fix: Skip tools validation for custom agent files with array-format tools#9307

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-importing-custom-agents
Jan 8, 2026
Merged

Fix: Skip tools validation for custom agent files with array-format tools#9307
pelikhan merged 3 commits intomainfrom
copilot/fix-importing-custom-agents

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 8, 2026

Custom agent files (.github/agents/*.md) use GitHub Copilot's format where tools is an array of strings, while workflows expect an object. Importing these files caused schema validation errors.

# Custom agent format (array)
tools: ["edit", "search", "read"]

# Workflow format (object)
tools:
  bash: null
  github: {...}

Changes

  • Added isCustomAgentFile() helper to detect agent files under .github/agents/
  • Skip validation for agent files in include_processor.go - they have a different schema
  • Skip tools extraction during import - agent tools aren't merged into workflow configuration
  • Added tests for agent file detection, array-format tools processing, and integration flows

Agent files are passed directly to AI engines (e.g., via --agent flag) and shouldn't be validated against workflow schemas.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login 2040108811 refs/tags/v2 /usr/bin/infocmp -json GO111MODULE 64/bin/go infocmp -1 k/gh-aw/gh-aw/.github/workflows go /usr/bin/infocmp 2323241/run-5 GO111MODULE tions/setup/node/repos/actions/github-script/git/ref/tags/v8 infocmp (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login xterm-color go /usr/bin/infocmp '**/*.ts' '**/*.gh GO111MODULE 64/pkg/tool/linu/repos/actions/github-script/git/ref/tags/v8 infocmp -1 xterm-color 64/pkg/tool/linu--jq /usr/bin/infocmp -json GO111MODULE 64/pkg/tool/linu-c infocmp (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login runs/20260108-043357-72167/test-668715913/.githu99c8f7c4e5923f2e885ec86ed035d8ba0671ce7211c81a9dinfocmp --jq (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Issues when importing custom agents with tools (due to incompatible tools format)</issue_title>
<issue_description>Hi, I'm trying to reuse a custom agent by importing it, for e.g.:

imports:
  - ../agents/feature-flag-remover.agent.md

This agent specifies the following tools:

---
description: "Blah"
tools:
  [
    "edit",
    "search",
    "execute/getTerminalOutput",
    "execute/runInTerminal",
    "read/terminalLastCommand",
    "read/terminalSelection",
    "execute/createAndRunTask",
    "execute/getTaskOutput",
    "execute/runTask",
    "read/problems",
    "search/changes",
    "agent",
    "runTasks",
    "problems",
    "changes",
    "runSubagent",
  ]
---

Error during gh aw compile:

⚠ Invalid configuration in /my-repo/.github/agents/feature-flag-remover.agent.md: .github/agents/feature-flag-remover.agent.md:3:7: error: at '/tools': got array, want object. Expected format: {"bash":null,"cache-memory":null,"playwright":null}

Ignoring that error message, I've also tried actually using that Agentic workflow, but it just results in tool issues. For instance,safe-outputs.create-pull-request doesn't work anymore, complains that it does not exist.

safe-outputs:
  create-pull-request:
    title-prefix: "chore(feature-flag-cleanup): "
    labels: [feature-flag-cleanup, automation]
    draft: true

Should gh aw ignore the tool property of custom agents? Since the tools in custom agents is an array vs tools in the workflow is an object. And conceptually, it'd make sense that only the workflow tools takes effect.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 8, 2026 04:24
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues when importing custom agents due to tools format Fix: Skip tools validation for custom agent files with array-format tools Jan 8, 2026
Copilot AI requested a review from mnkiefer January 8, 2026 04:40
@pelikhan pelikhan marked this pull request as ready for review January 8, 2026 04:44
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Jan 8, 2026

@copilot format, lint

@pelikhan pelikhan merged commit ce911c4 into main Jan 8, 2026
128 of 129 checks passed
@pelikhan pelikhan deleted the copilot/fix-importing-custom-agents branch January 8, 2026 04:46
Copilot stopped work on behalf of pelikhan due to an error January 8, 2026 04:47
Copilot AI requested a review from pelikhan January 8, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues when importing custom agents with tools (due to incompatible tools format)

3 participants