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:
@@ -51,10 +51,10 @@ export type ModelRequestJsonValue = CanonicalJsonValue
|
||||
|
||||
export type ModelRequestBody = Record<string, ModelRequestJsonValue>
|
||||
|
||||
function hasControlCharacter(value: string): boolean {
|
||||
function hasInvalidHeaderValueCharacter(value: string): boolean {
|
||||
return [...value].some((character) => {
|
||||
const code = character.charCodeAt(0)
|
||||
return code <= 31 || code === 127
|
||||
return code <= 31 || code === 127 || code > 255
|
||||
})
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ function isModelRequestHeaders(value: unknown): value is ModelRequestHeaders {
|
||||
typeof headerValue !== 'string' ||
|
||||
headerValue.length >
|
||||
MODEL_REQUEST_CUSTOMIZATION_LIMITS.maximumHeaderValueLength ||
|
||||
hasControlCharacter(headerValue)
|
||||
hasInvalidHeaderValueCharacter(headerValue)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
@@ -227,16 +227,6 @@ export function mergeModelRequestHeaders(
|
||||
return headers
|
||||
}
|
||||
|
||||
export function canonicalModelRequestHeaders(
|
||||
headers: Headers
|
||||
): Record<string, string> {
|
||||
return Object.fromEntries(
|
||||
[...headers.entries()].sort(([left], [right]) =>
|
||||
left.localeCompare(right)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
export function mergeModelRequestBody(
|
||||
customBody: ModelRequestBody,
|
||||
runtimeBody: Record<string, unknown>
|
||||
|
||||
Reference in New Issue
Block a user