fix: XCOpenCodeWeb 启动时传入端口参数 --port 3002

This commit is contained in:
2026-03-13 23:17:52 +08:00
parent f692961823
commit 7c656785c8

View File

@@ -41,6 +41,10 @@ class XCOpenCodeWebService {
return path.join(basePath, 'services', 'xcopencodeweb', exeName);
}
private getExeArgs(): string[] {
return ['--port', this.port.toString()];
}
private async checkHealth(): Promise<boolean> {
try {
const controller = new AbortController();
@@ -79,9 +83,10 @@ class XCOpenCodeWebService {
try {
const exePath = this.getExePath();
log.info(`[XCOpenCodeWebService] Starting from: ${exePath}`);
const exeArgs = this.getExeArgs();
log.info(`[XCOpenCodeWebService] Starting from: ${exePath} with args: ${exeArgs.join(' ')}`);
this.process = spawn(exePath, [], {
this.process = spawn(exePath, exeArgs, {
stdio: 'pipe',
shell: true,
detached: false,