fix(cli): stop ogx run --port argparse default from overriding config#5885
Merged
Merged
Conversation
The argparse default for --port was always set to 8321 (or OGX_PORT), so args.port was never None and config.server.port was never consulted. Change the argparse default to None and resolve port with explicit precedence: CLI flag > OGX_PORT env var > config file > 8321. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Sébastien Han <[email protected]>
leseb
requested review from
bbrowning,
cdoern,
franciscojavierarceo,
mattf and
raghotham
as code owners
May 18, 2026 18:24
mattf
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a bug where
ogx runalways ignores theserver.portvalue from config files. The argparse--portdefault was hardcoded to8321(orOGX_PORT), soargs.portwas neverNoneand theargs.port or config.server.portexpression always picked the argparse default.The fix changes the argparse default to
Noneand resolves the port with explicit precedence:--portflag (explicit user intent)OGX_PORTenvironment variableserver.port8321Test Plan
test_stack_run.py):--portand withoutOGX_PORT: config file port is now respected--port 9000: CLI flag wins over configOGX_PORT=9000(no--port): env var wins over config