Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
04cecda7
Unverified
Commit
04cecda7
authored
Jan 20, 2026
by
ishandhanani
Committed by
GitHub
Jan 20, 2026
Browse files
fix(sglang): Fix YAML config parsing for store_true arguments (#5513)
parent
748fee6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
components/src/dynamo/sglang/args.py
components/src/dynamo/sglang/args.py
+21
-9
No files found.
components/src/dynamo/sglang/args.py
View file @
04cecda7
...
...
@@ -372,15 +372,27 @@ async def parse_args(args: list[str]) -> Config:
# Remove --config-key from args (not recognized by SGLang)
args
=
args
[:
key_index
]
+
args
[
key_index
+
2
:]
# Extract boolean actions from the parser to handle them correctly in YAML
boolean_actions
=
[]
for
action
in
parser
.
_actions
:
if
hasattr
(
action
,
"dest"
)
and
hasattr
(
action
,
"action"
):
if
action
.
action
in
[
"store_true"
,
"store_false"
]:
boolean_actions
.
append
(
action
.
dest
)
# Merge config file arguments with CLI arguments
config_merger
=
ConfigArgumentMerger
(
boolean_actions
=
boolean_actions
)
# Merge config file arguments with CLI arguments.
# ConfigArgumentMerger API changed after SGLang v0.5.7:
# - New API (post-v0.5.7): accepts parser= for proper store_true detection
# - Old API (v0.5.7 and earlier): only accepts boolean_actions=
# We use inspect.signature to detect the API rather than version checking
# since unreleased builds may have the new API while still reporting v0.5.7.
# Related upstream issue: https://github.com/sgl-project/sglang/issues/16256
# Upstream fix PR: https://github.com/sgl-project/sglang/pull/16638
import
inspect
sig
=
inspect
.
signature
(
ConfigArgumentMerger
.
__init__
)
if
"parser"
in
sig
.
parameters
:
config_merger
=
ConfigArgumentMerger
(
parser
=
parser
)
else
:
# Legacy path: extract store_true actions manually
boolean_actions
=
[
action
.
dest
for
action
in
parser
.
_actions
if
isinstance
(
action
,
argparse
.
_StoreTrueAction
)
]
config_merger
=
ConfigArgumentMerger
(
boolean_actions
=
boolean_actions
)
args
=
config_merger
.
merge_config_with_args
(
args
)
parsed_args
=
parser
.
parse_args
(
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment