fix: stabilize Runtime workflows for 0.12.3

OpenCode status checks could cold-start throwaway servers, unrelated
conversations could block each other, and model, Continue, or remote paths
could replay or duplicate work under failure and backlog conditions. Settings
could also lose edits or overwrite unrelated model fields.

This update makes status checks passive, keeps per-conversation ordering while
allowing concurrency, preserves native long-running work with bounded display
capture and backpressure, narrows retries to known pre-dispatch failures, and
aligns remote Ask permissions without reducing Execute. It also keeps
Embedding updates narrow, improves settings and browser guidance, removes the
unused legacy Main gateway state, and records the validated Desktop 0.12.3 and
Agent 0.11.17 release metadata.

Release note: 改善 OpenCode 切换、多会话长任务、模型重试、远程 Ask/Execute 与设置保存可靠性,并完成 Desktop 0.12.3 / Agent 0.11.17 发布准备。
This commit is contained in:
mesalogo
2026-09-04 08:05:29 +08:00
parent 374968d50b
commit 4490e5fd15
60 changed files with 1639 additions and 3839 deletions
+5 -13
View File
@@ -195,22 +195,14 @@ const maxToolArgumentBytes = 128 * 1024
const maxToolContextBytes = 1024 * 1024
const defaultModelRequestTimeoutMs = 10 * 60_000
const modelRequestRetryDelaysMs = [500, 1_000, 2_000] as const
const retryableModelNetworkErrorCodes = new Set([
const retryablePreDispatchNetworkErrorCodes = new Set([
'EAI_AGAIN',
'ECONNABORTED',
'ECONNREFUSED',
'ECONNRESET',
'EHOSTDOWN',
'EHOSTUNREACH',
'ENETDOWN',
'ENETRESET',
'ENETUNREACH',
'EPIPE',
'ETIMEDOUT',
'UND_ERR_BODY_TIMEOUT',
'UND_ERR_CONNECT_TIMEOUT',
'UND_ERR_HEADERS_TIMEOUT',
'UND_ERR_SOCKET'
'UND_ERR_CONNECT_TIMEOUT'
])
const noModelTools: ModelToolProviderLike = {
@@ -617,7 +609,7 @@ function isRetryableModelRequestError(error: unknown): boolean {
const record = current as Record<string, unknown>
if (
typeof record.code === 'string' &&
retryableModelNetworkErrorCodes.has(
retryablePreDispatchNetworkErrorCodes.has(
record.code.toLocaleUpperCase()
)
) {
@@ -625,8 +617,8 @@ function isRetryableModelRequestError(error: unknown): boolean {
}
if (typeof record.message === 'string') {
if (
record.message === '模型接口请求超时' ||
/(?:fetch failed|failed to fetch|network(?: request)? (?:error|failed)|socket disconnected|connection (?:closed|reset)|\bECONNRESET\b|\bETIMEDOUT\b)/iu.test(
record.code === 'ECONNRESET' &&
/before secure TLS connection was established/iu.test(
record.message
)
) {