fix: make Agent updates reliable and visible
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Valid Agent packages could be rejected when packaged trusted-key JSON used CRLF, and Settings could not show whether a newer compatible Agent existed. Registry formatting is now parsed independently of cryptographic trust, and Settings reads only the signed catalog to report local and latest versions. New installations use a credential-free local Ollama-compatible profile. The v20 migration changes only untouched historical defaults, while explicit profiles and legacy environment aliases remain compatible. Magic Notes count badges no longer shift navigation rows. Release note: 修复 Agent 下载兼容性并在设置中显示更新状态;新安装默认连接本地模型,保留显式用户配置;魔法笔记待办数字不再改变侧栏菜单高度。
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { createHash, randomUUID } from 'node:crypto'
|
||||
import { lstat, readFile } from 'node:fs/promises'
|
||||
import {
|
||||
agentReleaseKeyRegistrySchema,
|
||||
type AgentArchitecture,
|
||||
type AgentBundleManifest,
|
||||
type AgentReleaseKeyRegistry
|
||||
@@ -31,6 +30,8 @@ import {
|
||||
import {
|
||||
assertAgentManifestMatchesRuntimeLock,
|
||||
canonicalAgentReleaseKeyRegistryBytes,
|
||||
parseAgentReleaseKeyRegistry,
|
||||
parseAgentReleaseKeyRegistryBytes,
|
||||
readAgentReleaseKeyRegistry,
|
||||
readAgentRuntimeLock,
|
||||
verifyAgentManifestSignature,
|
||||
@@ -599,7 +600,7 @@ export class AgentInstallationManager {
|
||||
)
|
||||
}
|
||||
const canonicalRegistry =
|
||||
agentReleaseKeyRegistrySchema.parse(loaded.registry)
|
||||
parseAgentReleaseKeyRegistry(loaded.registry)
|
||||
return {
|
||||
bundle: loaded.bundle,
|
||||
registry: canonicalRegistry,
|
||||
@@ -627,7 +628,7 @@ export class AgentInstallationManager {
|
||||
verificationEnvironment: this.#verificationEnvironment
|
||||
}
|
||||
)
|
||||
const canonicalRegistry = agentReleaseKeyRegistrySchema.parse(
|
||||
const canonicalRegistry = parseAgentReleaseKeyRegistry(
|
||||
registry
|
||||
)
|
||||
return {
|
||||
@@ -648,14 +649,14 @@ export class AgentInstallationManager {
|
||||
},
|
||||
signal: AbortSignal
|
||||
): Promise<AgentInstallationIdentity> {
|
||||
const [canonicalRegistryBytes, runtimeLock] = await Promise.all([
|
||||
readFile(this.#resourcePaths.keyRegistryPath),
|
||||
const [registry, runtimeLock] = await Promise.all([
|
||||
readAgentReleaseKeyRegistry(
|
||||
this.#resourcePaths.keyRegistryPath
|
||||
),
|
||||
readAgentRuntimeLock(this.#resourcePaths.runtimeLockPath)
|
||||
])
|
||||
const registry = parseCanonicalAgentReleaseKeyRegistry(
|
||||
canonicalRegistryBytes,
|
||||
'Agent trusted key registry'
|
||||
)
|
||||
const canonicalRegistryBytes =
|
||||
canonicalAgentReleaseKeyRegistryBytes(registry)
|
||||
|
||||
let metadataSftp: StagedSftp | undefined
|
||||
let installationSftp: StagedSftp | undefined
|
||||
@@ -706,7 +707,7 @@ export class AgentInstallationManager {
|
||||
signal
|
||||
)
|
||||
const remoteReleaseKeyRegistry =
|
||||
parseCanonicalAgentReleaseKeyRegistry(
|
||||
parseAgentReleaseKeyRegistryBytes(
|
||||
remoteReleaseKeyBytes,
|
||||
'Installed Agent release-key registry'
|
||||
)
|
||||
@@ -851,21 +852,6 @@ function parseJsonBytes(
|
||||
}
|
||||
}
|
||||
|
||||
function parseCanonicalAgentReleaseKeyRegistry(
|
||||
value: Buffer,
|
||||
description: string
|
||||
): AgentReleaseKeyRegistry {
|
||||
const registry = agentReleaseKeyRegistrySchema.parse(
|
||||
parseJsonBytes(value, description)
|
||||
)
|
||||
const canonicalBytes =
|
||||
canonicalAgentReleaseKeyRegistryBytes(registry)
|
||||
if (!canonicalBytes.equals(value)) {
|
||||
throw new Error(`${description} is not canonical`)
|
||||
}
|
||||
return registry
|
||||
}
|
||||
|
||||
function decodeDetachedSignature(
|
||||
value: Buffer,
|
||||
description: string
|
||||
|
||||
Reference in New Issue
Block a user