Skip to content

fix: forward CLI args to AppLauncher in state machine scripts (#5572)#5654

Open
dparikh79 wants to merge 1 commit into
isaac-sim:mainfrom
dparikh79:fix/5572-forward-cli-args-to-applauncher
Open

fix: forward CLI args to AppLauncher in state machine scripts (#5572)#5654
dparikh79 wants to merge 1 commit into
isaac-sim:mainfrom
dparikh79:fix/5572-forward-cli-args-to-applauncher

Conversation

@dparikh79
Copy link
Copy Markdown

Summary

Fixes #5572.

The three state machine scripts under scripts/environments/state_machine/ register the full AppLauncher CLI surface via AppLauncher.add_app_launcher_args(parser) and parse it into args_cli, but then instantiate AppLauncher with only the headless flag:

app_launcher = AppLauncher(headless=args_cli.headless)

This drops every other parsed AppLauncher argument. The most visible symptom (the one @agundogdu-bdai reported in #5572) is that --viz kit on Isaac Lab 3.0 beta is silently ignored: the process stays alive, GPU goes into compute+graphics mode, but no Kit / Isaac Sim window opens. The same gap also drops --kit-args, --device, --enable_cameras, --livestream, and any other registered AppLauncher flag.

Every other Isaac Lab 3 script that calls add_app_launcher_args passes the full args_cli namespace through. Aligning the three state machine scripts to that pattern fixes the reported --viz kit regression and the silent drop of the other flags. Credit to @agundogdu-bdai for the root-cause analysis and the proposed one-line fix in the issue body; this PR applies that fix and extends it to the two sibling state machine scripts that have the same bug.

What changed

Three one-line changes, identical across the three scripts:

-app_launcher = AppLauncher(headless=args_cli.headless)
+app_launcher = AppLauncher(args_cli)

Files:

  • scripts/environments/state_machine/lift_cube_sm.py
  • scripts/environments/state_machine/open_cabinet_sm.py
  • scripts/environments/state_machine/lift_teddy_bear.py

No breaking change: callers using only --headless see no behavior difference because args_cli.headless is still respected by the AppLauncher when reading the full namespace. Callers using --viz, --kit-args, --device, etc., now have those flags reach the launcher as the parser already advertised.

Pattern verification

Sample of in-tree precedent (the canonical pattern for Isaac Lab 3 scripts):

$ grep -rn "AppLauncher(" scripts/tutorials/00_sim/
scripts/tutorials/00_sim/spawn_prims.py:29:app_launcher = AppLauncher(args_cli)
scripts/tutorials/00_sim/set_rendering_mode.py:31:app_launcher = AppLauncher(args_cli)
scripts/tutorials/00_sim/log_time.py:32:app_launcher = AppLauncher(args_cli)
scripts/tutorials/00_sim/create_empty.py:29:app_launcher = AppLauncher(args_cli)
scripts/tutorials/00_sim/launch_app.py:39:app_launcher = AppLauncher(args_cli)

How to verify

@agundogdu-bdai's repro from the issue:

./isaaclab.sh -p scripts/environments/state_machine/lift_cube_sm.py \
  --num_envs 1 \
  --viz kit

Before: process stays alive, no Kit window opens.
After: Kit visualizer opens as expected, matching scripts/tutorials/00_sim/create_empty.py --viz kit.

Checklist

  • DCO-signed commit (-s)
  • Diff is the minimal three-line change
  • Verified the canonical pattern in tutorials and tools
  • No public API surface change; no doc update needed

AI Assistance Disclosure

This PR was drafted with AI assistance (Claude Code). I read the issue, verified the issue author's analysis by tracing all 7 sites where AppLauncher is instantiated under scripts/, confirmed the tutorials canonical pattern, and applied the same one-line fix the author proposed to the two sibling state machine scripts that have the same bug. The fix is the minimum change to align these three scripts with the rest of the codebase.

The three state machine scripts under scripts/environments/state_machine/
register the full AppLauncher CLI surface via
AppLauncher.add_app_launcher_args(parser) and parse it into args_cli, but
then instantiate AppLauncher with only the headless flag:

  app_launcher = AppLauncher(headless=args_cli.headless)

This drops every other parsed AppLauncher argument. The most visible
symptom (reported in isaac-sim#5572) is that --viz kit on Isaac Lab 3.0 beta is
silently ignored: the process stays alive, GPU goes into compute+graphics
mode, but no Kit / Isaac Sim window opens. The same gap also drops
--kit-args, --device, --enable_cameras, --livestream and others.

Every other Isaac Lab 3 script that calls add_app_launcher_args passes
the full args namespace through (e.g. scripts/tutorials/00_sim/*.py uses
AppLauncher(args_cli)). Align the three state machine scripts
(lift_cube_sm.py, open_cabinet_sm.py, lift_teddy_bear.py) to that
pattern so --viz and the other registered flags reach the launcher.

Fixes isaac-sim#5572

Signed-off-by: Dhruvil <dhruvilparikh79@gmail.com>
@dparikh79 dparikh79 requested a review from ooctipus as a code owner May 16, 2026 16:21
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels May 16, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR fixes a bug in the three state machine scripts under scripts/environments/state_machine/ where AppLauncher was instantiated with only the headless keyword argument, silently dropping every other CLI flag registered by AppLauncher.add_app_launcher_args (e.g. --viz, --device, --livestream, --kit-args). The fix aligns all three scripts with the canonical Isaac Lab pattern used everywhere else in the codebase.

  • lift_cube_sm.py, lift_teddy_bear.py, open_cabinet_sm.py: Each receives an identical one-line change replacing AppLauncher(headless=args_cli.headless) with AppLauncher(args_cli), so the full parsed namespace is forwarded to the launcher.
  • The fix is backward-compatible: callers passing only --headless see no behavior change, while callers using --viz kit or other flags now have those arguments correctly applied.

Confidence Score: 5/5

Three identical one-line corrections to script-level launcher invocations — no library code, no API surface, no data path touched.

The change is minimal and mechanical: it removes a single keyword filter and passes the already-parsed argparse namespace directly to AppLauncher, exactly as every other comparable script in the tree does. All three changed files are standalone scripts with no shared state, and the fix is verified against the canonical tutorial precedents cited in the PR.

No files require special attention.

Important Files Changed

Filename Overview
scripts/environments/state_machine/lift_cube_sm.py One-line fix: passes full args_cli namespace to AppLauncher instead of only headless, aligning with the canonical codebase pattern.
scripts/environments/state_machine/lift_teddy_bear.py Identical one-line fix as sibling scripts: AppLauncher(args_cli) replaces AppLauncher(headless=args_cli.headless).
scripts/environments/state_machine/open_cabinet_sm.py Identical one-line fix: full args_cli namespace forwarded to AppLauncher, restoring --viz, --device, --livestream, and other registered flags.

Sequence Diagram

sequenceDiagram
    participant User
    participant argparse
    participant AppLauncher
    participant SimApp

    User->>argparse: parse_args() (--headless, --viz, --device, --livestream, ...)
    argparse-->>User: args_cli (full namespace)

    Note over User,AppLauncher: Before fix
    User->>AppLauncher: "AppLauncher(headless=args_cli.headless)"
    Note right of AppLauncher: --viz, --device, --livestream silently dropped

    Note over User,AppLauncher: After fix
    User->>AppLauncher: AppLauncher(args_cli)
    AppLauncher->>SimApp: Launch with full CLI config
    SimApp-->>AppLauncher: simulation_app
    AppLauncher-->>User: app_launcher.app
Loading

Reviews (1): Last reviewed commit: "fix: forward CLI args to AppLauncher in ..." | Re-trigger Greptile

Copy link
Copy Markdown

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This PR correctly fixes issue #5572 by aligning the three state machine scripts with the canonical AppLauncher initialization pattern used throughout Isaac Lab.

✅ What Works Well

  1. Minimal, targeted fix: The change is exactly one line per file, replacing AppLauncher(headless=args_cli.headless) with AppLauncher(args_cli). This matches the established pattern in tutorial scripts.

  2. Backward compatibility preserved: Since AppLauncher reads headless from the namespace object, existing callers using only --headless see no behavior change.

  3. Root cause addressed: The original code registered AppLauncher CLI arguments via add_app_launcher_args(parser) but then ignored them during instantiation. This fix ensures all parsed arguments (--viz, --device, --kit-args, --enable_cameras, --livestream, etc.) are properly forwarded.

  4. Good PR documentation: The description includes pattern verification with grep examples, clear reproduction steps, and links to the issue.

📋 Observations

  • No test changes: Understandable given these are example scripts rather than core library code. The manual verification steps in the PR description are appropriate.

  • Consistent with codebase patterns: Verified that scripts/tutorials/00_sim/ and other directories use AppLauncher(args_cli) as the standard pattern.

Verdict

LGTM ✅ — Clean, minimal bug fix that properly aligns these scripts with established Isaac Lab conventions. The change is low-risk and directly addresses the reported issue.

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

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] lift_cube_sm.py ignores --viz kit in Isaac Lab 3.0 beta

1 participant