Fix: script-default visualizers not cleared in headless mode (--headless and HEADLESS=1) - #7444
Conversation
Greptile SummaryThis PR distinguishes script-defined argparse visualizer defaults from explicit
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified. The new intent marker correctly separates parser defaults from explicit CLI input while retaining direct-kwargs detection, and downstream handling prevents non-explicit defaults from reaching the explicit-visualizer error path. Important Files Changed
Reviews (1): Last reviewed commit: "Fix headless visualizer bug related to p..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The explicitness sentinel correctly distinguishes argparse defaults from explicit --viz input and direct kwargs, but it introduces a regression: a script-defined default such as visualizer=["kit"] no longer contributes to headless intent, so an ordinary launch is forced headless when visualizer_intent is absent.
- Design and architecture: The tri-state explicitness handling is appropriate, but script-defined visualizer defaults are demoted without being transferred to the existing configuration-intent path. Their selected backend remains recorded while headless resolution behaves as though no visualizer was selected.
- API: Explicit
--vizandAppLauncher(visualizer=[...])retain their existing explicit-selection behavior. However, the argparse integration surface changes materially:parser.set_defaults(visualizer=["kit"])now causes a normal launch to resolve as headless unless the script separately suppliesvisualizer_intent. - Implementation: Because
visualizer_explicit=Falsebypasses the presence fallback,_resolve_headless_settingsreaches its non-explicit branch and consults only_cfg_has_any_visualizersand_cfg_has_kit_visualizer. With novisualizer_intent, both are false, forcing headless even though_cli_visualizer_typescontainskit. Non-explicit argparse defaults should feed the configuration-intent state or otherwise preserve their normal-launch semantics.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| visualizer_explicit = bool(launcher_args.pop("visualizer_explicit", False)) | ||
| if not visualizer_explicit and "visualizer" in launcher_args: | ||
| visualizer_explicit = raw_visualizers is not None | ||
| visualizer_explicit = launcher_args.pop("visualizer_explicit", None) |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Script default visualizers now silently force headless
With visualizer_explicit=False always present in the parsed namespace, a script using parser.set_defaults(visualizer=["kit"]) takes the else branch of _resolve_headless_settings (lines 938-954). That branch consults only visualizer_intent, which such scripts do not set, so _headless becomes True even on a plain non-headless run, while _cli_visualizer_types still holds kit. Map non-explicit argparse visualizer defaults into _cfg_has_any_visualizers/_cfg_has_kit_visualizer instead of discarding them.
There was a problem hiding this comment.
non-explicit argparse visualizer defaults are now properly mapped into _cfg_has_any_visualizers and _cfg_has_kit_visualizer
998fdca to
5aaa51b
Compare
5aaa51b to
b82fd8a
Compare
Summary
Fixes a runtime crash in
AppLauncherwhen a task script registers a default visualizer viaparser.set_defaults(visualizer=["kit"])and the process is launched in headless mode.Fixes #7403
Root cause
_resolve_visualizer_settingsincorrectly promotedset_defaults()values to explicit user intent (_cli_visualizer_explicit = True), even though the user never typed--vizon the command line.Fix
develop's newly supportedHEADLESS=1+ Kit visualizer livestreaming lifecycle), this PR fixes the root cause directly by tracking whether the arguments came fromset_defaults.parser.set_defaults(visualizer_explicit=False)inadd_app_launcher_args._resolve_visualizer_settingsto correctly respectvisualizer_explicit=Falsewhile preserving the presence-based fallback for programmatic kwargs (e.g.,AppLauncher(visualizer=["kit"])).Testing
test_visualizer_argparse_set_defaults_is_not_explicitandtest_visualizer_direct_kwargs_is_explicitto verify intent resolution logic.test_matrix_headless_with_viz_names_takes_precedenceto align with the newdeveloplifecycle (expecting visualizers not to be unconditionally cleared under headless modes).Checklist
./isaaclab.sh -f)CHANGELOG.rstupdated (via changelog fragment)