Skip to content

fix: merge agent command with args in parseAgents config#199

Open
log-li wants to merge 1 commit intoopenclaw:mainfrom
log-li:fix/parseagents-args
Open

fix: merge agent command with args in parseAgents config#199
log-li wants to merge 1 commit intoopenclaw:mainfrom
log-li:fix/parseagents-args

Conversation

@log-li
Copy link
Copy Markdown

@log-li log-li commented Mar 29, 2026

Summary

Fixes parseAgents() in src/config.ts to merge the args array with the command field when configuring agents in ~/.acpx/config.json.

Problem

When an agent is configured with both command and args:

{
  "agents": {
    "cursor": {
      "command": "/usr/local/bin/agent",
      "args": ["acp"]
    }
  }
}

The args field was silently ignored — only command was read. This caused the spawned agent to run without the required arguments, leading to ACP protocol initialization failures.

Changes

  • src/config.ts: Updated parseAgents() to read raw.args, validate it as an optional string array, and merge it with command
  • src/config.ts: Updated ConfigAgentEntry type to include args?: string[]
  • test/config.test.ts: Added 3 new tests for args merging, backward compatibility, and validation

Testing

  • All 443 tests pass (440 existing + 3 new)
  • All lint checks pass
  • Backward compatible: agents without args continue to work

Related

@log-li log-li force-pushed the fix/parseagents-args branch 3 times, most recently from 8a6aa3e to 30eb296 Compare March 29, 2026 16:43
- Updated parseAgents() in src/config.ts to read raw.args and merge
  it with command as "{command} {args.join(' ')}"
- Updated ConfigAgentEntry type to include args?: string[]
- Added 3 tests: args merging, backward compat, invalid type validation
- All 443 tests pass, lint clean

Fixes openclaw#198
@log-li log-li force-pushed the fix/parseagents-args branch from 30eb296 to f832d0c Compare March 29, 2026 16:44
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.

fix: parseAgents() ignores 'args' field in ~/.acpx/config.json agents config

1 participant