fix: 修复 OpenCode 运行时启动与本地打包
This commit is contained in:
@@ -30,7 +30,7 @@ import { registerZoomShortcuts } from './zoom-shortcuts';
|
||||
import { appUpdater, registerUpdateHandlers } from './updater';
|
||||
import { logger } from '../utils/logger';
|
||||
import { warmupNetworkOptimization } from '../utils/uv-env';
|
||||
import { resolvePythonRuntime } from '../utils/python-runtime';
|
||||
import { resolvePythonRuntime, resolveUvRuntime } from '../utils/python-runtime';
|
||||
import { initTelemetry } from '../utils/telemetry';
|
||||
import {
|
||||
getOrCreateAgentGatewaySessionClientId,
|
||||
@@ -578,6 +578,13 @@ if (gotTheLock) {
|
||||
arch: process.arch,
|
||||
configuredPath: process.env.NIANCODE_PYTHON_PATH,
|
||||
});
|
||||
const uvRuntime = resolveUvRuntime({
|
||||
isPackaged: app.isPackaged,
|
||||
resourcesPath: process.resourcesPath,
|
||||
appPath: app.getAppPath(),
|
||||
platform: process.platform,
|
||||
arch: process.arch,
|
||||
});
|
||||
const bundledSuperpowersDir = resolveBundledSuperpowersDir({
|
||||
isPackaged: app.isPackaged,
|
||||
resourcesPath: process.resourcesPath,
|
||||
@@ -594,13 +601,15 @@ if (gotTheLock) {
|
||||
appPath: app.getAppPath(),
|
||||
});
|
||||
opencodeManager = new OpencodeManager({
|
||||
port: 4096,
|
||||
port: getPort('OPENCODE_RUNTIME'),
|
||||
binPath: opencodePaths.binPath,
|
||||
preflightPreferredPort: true,
|
||||
userDataDir: app.getPath('userData'),
|
||||
bundledSuperpowersDir,
|
||||
bundledCourseSkillsDir,
|
||||
bundledAgentBrowserPluginPath,
|
||||
pythonRuntime,
|
||||
uvRuntime,
|
||||
runtimeConfigProvider: async () => {
|
||||
const runtime = await buildOpencodeRuntimeConfigFromNianCodeProviders({
|
||||
mcpServers: {
|
||||
|
||||
Reference in New Issue
Block a user