Skip to content

fix: send --agents to Claude Code as an object keyed by agent name - #105

Open
35C4n0r wants to merge 2 commits into
open-gitagent:mainfrom
35C4n0r:35C4n0r/fix/claude-runner-subagents
Open

35C4n0r wants to merge 2 commits into
open-gitagent:mainfrom
35C4n0r:35C4n0r/fix/claude-runner-subagents

Conversation

@35C4n0r

@35C4n0r 35C4n0r commented Oct 4, 2026 •

Copy link
Copy Markdown

What

The claude runner passed sub-agents as an array of {name, description, instructions, triggers}. Claude Code expects an object keyed by agent name, where each entry needs description and prompt.
Key each sub-agent by name, rename instructions to prompt, and fold delegation triggers into the description, since Claude Code has no triggers field.

Why

Since v2.1.242 it validates this at startup and exits with "Invalid --agents configuration: Invalid input: expected record, received array", so opengap run -a claude failed for any agent with an agents: block. https://code.claude.com/docs/en/errors#invalid-agents-configuration

How Tested

  • npm run build passes
  • gitagent validate passes on example agents
  • Manual testing (describe below)
    • Tested on examples/full using run -d examples/full -a claude -p "hello"

Checklist

  • My code follows the existing style of this project
  • I have added/updated tests (if applicable)
  • I have updated documentation (if applicable)
  • I have read the CONTRIBUTING.md

Closes #106

The claude runner passed sub-agents as an array of
{name, description, instructions, triggers}. Claude Code expects an
object keyed by agent name, where each entry needs `description` and
`prompt`. Since v2.1.242 it validates this at startup and exits with
"Invalid --agents configuration: Invalid input: expected record,
received array", so `opengap run -a claude` failed for any agent with
an `agents:` block, including examples/full and
examples/nvidia-deep-researcher.

Key each sub-agent by name, rename `instructions` to `prompt`, and fold
delegation triggers into the description, since Claude Code has no
`triggers` field.
Run runWithClaude against a fake claude binary that records its argv,
and check that sub-agents are passed as an object keyed by name with
`description` and `prompt`, carrying the sub-agent's SOUL.md and its
delegation triggers, and that --agents is omitted when the manifest
declares no sub-agents.

These are the first tests for a runner. They run with `npm test` after
`npm run build`, and are skipped on Windows, where the shebang-based
fake binary can't run.
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.

[Bug] opengap run -a claude fails for any agent with sub-agents (invalid --agents format)

1 participant