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:
@@ -6277,6 +6277,23 @@ describe('registerIpcHandlers agent terminal state', () => {
|
||||
expect(selectedRuntimes.getStatus).toHaveBeenCalledWith(
|
||||
secondSelection
|
||||
)
|
||||
harness.getResolvedSettings.mockResolvedValueOnce({
|
||||
provider: 'opencode',
|
||||
defaultModelProfileId: firstProfileId,
|
||||
opencodeBaseUrl: '',
|
||||
opencodeEmbedded: true,
|
||||
opencodeModelSource: { kind: 'platform' },
|
||||
continueModelSource: { kind: 'platform' }
|
||||
})
|
||||
await expect(
|
||||
harness.statusHandler?.(event)
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({ label: 'model-two' })
|
||||
)
|
||||
expect(selectedRuntimes.getStatus).toHaveBeenLastCalledWith({
|
||||
provider: 'opencode'
|
||||
})
|
||||
expect(fallbackRuntime.getStatus).not.toHaveBeenCalled()
|
||||
|
||||
await Promise.all([
|
||||
harness.handler?.(event, {
|
||||
|
||||
Reference in New Issue
Block a user