fix: release runtime status probes after checks
Chat startup and Runtime switching previously cached status-only Runtime instances, leaving managed OpenCode servers running without active conversations. Status checks now resolve the selected or configured default Runtime through a disposable probe and release it immediately. Project execution Runtimes remain cached by model selection and execution space, preserving parallel work across different projects. Release note: 修复启动或切换 Runtime 后空闲 OpenCode 服务持续驻留的问题;状态检查完成后会立即回收,多个项目仍可并行执行。
This commit is contained in:
+10
-4
@@ -2837,12 +2837,18 @@ export function registerIpcHandlers(
|
||||
return tracked
|
||||
}, false)
|
||||
|
||||
registerHandler(ipcChannels.agentStatus, (event, input: unknown) => {
|
||||
registerHandler(ipcChannels.agentStatus, async (event, input: unknown) => {
|
||||
assertTrustedSender(event, window)
|
||||
const selection = agentRuntimeSelectionSchema.optional().parse(input)
|
||||
return selection && selectedRuntimes
|
||||
? selectedRuntimes.getStatus(selection)
|
||||
: runtime.getStatus()
|
||||
if (!selectedRuntimes) {
|
||||
return runtime.getStatus()
|
||||
}
|
||||
const effectiveSelection =
|
||||
selection ??
|
||||
getDefaultRuntimeSelection(
|
||||
await settingsStore.getResolvedSettings()
|
||||
)
|
||||
return selectedRuntimes.getStatus(effectiveSelection)
|
||||
})
|
||||
|
||||
registerHandler(ipcChannels.browserStop, async (event, input: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user