@@ -5,12 +5,12 @@ import { describeCodexNativeWebSearch } from "../agents/codex-native-web-search.
55import { formatCliCommand } from "../cli/command-format.js" ;
66import { formatPortRangeHint } from "../cli/error-format.js" ;
77import { commitConfigWithPendingPluginInstalls } from "../cli/plugins-install-record-commit.js" ;
8+ import { parsePort } from "../cli/shared/parse-port.js" ;
89import { readConfigFileSnapshot , resolveGatewayPort } from "../config/config.js" ;
910import { logConfigUpdated } from "../config/logging.js" ;
1011import { ConfigMutationConflictError } from "../config/mutate.js" ;
1112import type { OpenClawConfig } from "../config/types.openclaw.js" ;
1213import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js" ;
13- import { parseStrictPositiveInteger } from "../infra/parse-finite-number.js" ;
1414import { resolvePluginContributionOwners } from "../plugins/plugin-registry.js" ;
1515import type { RuntimeEnv } from "../runtime.js" ;
1616import { defaultRuntime } from "../runtime.js" ;
@@ -65,8 +65,7 @@ const setupPluginConfigModuleLoader = createLazyImportLoader<SetupPluginConfigMo
6565) ;
6666
6767function validateGatewayPortInput ( value : unknown ) : string | undefined {
68- const port = Number ( typeof value === "string" ? value . trim ( ) : value ) ;
69- if ( ! Number . isInteger ( port ) || port < 1 || port > 65_535 ) {
68+ if ( parsePort ( value ) === null ) {
7069 return formatPortRangeHint ( ) ;
7170 }
7271 return undefined ;
@@ -641,7 +640,7 @@ export async function runConfigureWizard(
641640 } ) ,
642641 runtime ,
643642 ) ;
644- gatewayPort = parseStrictPositiveInteger ( portInput ) ?? gatewayPort ;
643+ gatewayPort = parsePort ( portInput ) ?? gatewayPort ;
645644 } ;
646645
647646 if ( selectedSections ) {
0 commit comments