Skip to content

fix(cli): forward OpenClaw arguments unchanged - #477

Open
elyasmnvidian wants to merge 1 commit into
mainfrom
emehtabuddin/switch-866-openclaw-forwarded-args
Open

fix(cli): forward OpenClaw arguments unchanged#477
elyasmnvidian wants to merge 1 commit into
mainfrom
emehtabuddin/switch-866-openclaw-forwarded-args

Conversation

@elyasmnvidian

@elyasmnvidian elyasmnvidian commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
switchyard launch openclaw --model switchyard -- --version

Switchyard currently starts this command:

openclaw chat --version

The launcher inserts chat before every forwarded argument, so OpenClaw receives the root --version option under the chat subcommand instead of unchanged after the executable.

Fix

Arguments after -- now form the complete OpenClaw argument list. With no forwarded arguments, the launcher still starts openclaw chat, so ordinary interactive launches do not change.

Callers that intend to pass chat-specific options now include the subcommand explicitly:

switchyard launch openclaw --model switchyard -- chat --help

Compatibility note: a caller that relied on the launcher to insert chat before forwarded options must now forward chat explicitly. Launches without forwarded arguments are unchanged.

Evidence

Before: ['openclaw', 'chat', '--version']
After:  ['openclaw', '--version']
Default: ['openclaw', 'chat']
Explicit chat: ['openclaw', 'chat', '--help']

Testing

uv run pytest tests/test_launchers.py -q runs the parser-to-command regression and reports 12 passed.

Fixes: ba72705

Summary by CodeRabbit

  • Bug Fixes

    • Updated OpenClaw command handling so explicitly provided arguments are passed through exactly as entered.
    • Preserved the default chat command when no arguments are supplied.
  • Tests

    • Added coverage for default behavior and custom argument forwarding.

Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com>
@elyasmnvidian
elyasmnvidian requested a review from a team as a code owner August 18, 2026 22:33
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de08004f-1197-4b11-aeb6-161c78773837

📥 Commits

Reviewing files that changed from the base of the PR and between 479ca9a and 2119e2d.

📒 Files selected for processing (2)
  • switchyard/cli/launchers/openclaw_launcher.py
  • tests/test_launchers.py

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The OpenClaw launcher now uses chat only when no arguments are supplied. New tests verify default behavior and direct forwarding of explicit arguments.

Changes

OpenClaw command forwarding

Layer / File(s) Summary
Command forwarding and contract tests
switchyard/cli/launchers/openclaw_launcher.py, tests/test_launchers.py
The launcher defaults to ["openclaw", "chat"] for empty arguments. Supplied arguments replace the default command arguments. Parameterized tests verify both cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2119e

The launcher now preserves forwarded OpenClaw arguments while keeping the default interactive command unchanged; no actionable merge-blocking risk remains beyond normal checks and review.

Poem

I’m a rabbit with commands to send,
chat appears when args all end.
Supplied words hop straight ahead,
Tests guard the path they tread.
Sniff, commit, and rest my head!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: forwarding OpenClaw arguments unchanged.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

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.

1 participant