fix: finalize 0.11.5 compatibility paths
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (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 Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (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 Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
Legacy key-only environment deployments retain their historical model endpoint, name, and protocol while generic model variables continue to take precedence. Agent inventory scanning now overlaps the signed catalog check instead of waiting for the network first. The separate LoongArch preview builder derives node-pty from the candidate lockfile and verifies the installed version before cross-compiling it, preventing stale preview-only pins.
This commit is contained in:
@@ -191,7 +191,7 @@ export class AgentPackageManager {
|
||||
latestVersion,
|
||||
updateAvailable: this.#updateAvailable(
|
||||
latestVersion,
|
||||
record
|
||||
record?.verified.descriptor.version ?? null
|
||||
),
|
||||
remoteRuntimeVersion:
|
||||
record?.verified.descriptor.remoteRuntime.version ?? null,
|
||||
@@ -210,8 +210,27 @@ export class AgentPackageManager {
|
||||
async getSnapshot(
|
||||
options: { refresh?: boolean } = {}
|
||||
): Promise<AgentPackageInventory> {
|
||||
await this.#checkCatalog()
|
||||
return this.getInventory(options)
|
||||
const catalogCheck = this.#checkCatalog()
|
||||
const inventory = await this.getInventory(options)
|
||||
await catalogCheck
|
||||
return agentPackageInventorySchema.parse({
|
||||
...inventory,
|
||||
checkedAt: this.#now().toISOString(),
|
||||
catalog: this.#publicCatalogState(),
|
||||
entries: inventory.entries.map((entry) => {
|
||||
const latestVersion = this.#latestVersion(
|
||||
entry.architecture
|
||||
)
|
||||
return {
|
||||
...entry,
|
||||
latestVersion,
|
||||
updateAvailable: this.#updateAvailable(
|
||||
latestVersion,
|
||||
entry.version
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async getExpectedCatalog(
|
||||
@@ -791,13 +810,13 @@ export class AgentPackageManager {
|
||||
|
||||
#updateAvailable(
|
||||
latestVersion: string | null,
|
||||
installed: InstalledRecord | undefined
|
||||
installedVersion: string | null
|
||||
): boolean {
|
||||
return installed !== undefined &&
|
||||
return installedVersion !== null &&
|
||||
latestVersion !== null &&
|
||||
compareSemanticVersions(
|
||||
latestVersion,
|
||||
installed.verified.descriptor.version
|
||||
installedVersion
|
||||
) > 0
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,27 @@ describe('RuntimeSettingsStore', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('preserves the historical connection for a legacy environment key', async () => {
|
||||
const { filePath, store } = await createStore()
|
||||
await store.update(settings())
|
||||
const version19 = JSON.parse(
|
||||
await readFile(filePath, 'utf8')
|
||||
) as Record<string, unknown>
|
||||
version19.version = 19
|
||||
await writeFile(filePath, JSON.stringify(version19), 'utf8')
|
||||
|
||||
const migrated = new RuntimeSettingsStore(filePath, cipher, {
|
||||
GOODBUDDY_BIGTOKEN_API_KEY: 'legacy-key'
|
||||
})
|
||||
await expect(migrated.getResolvedSettings()).resolves.toMatchObject({
|
||||
modelBaseUrl: 'https://bigtoken.ai',
|
||||
modelName: 'sonnet-5',
|
||||
modelProtocol: 'anthropic-messages',
|
||||
modelAuthentication: 'api-key',
|
||||
apiKey: 'legacy-key'
|
||||
})
|
||||
})
|
||||
|
||||
it('restores an exact credential-bearing snapshot after a failed activation', async () => {
|
||||
const { store } = await createStore()
|
||||
await store.update(
|
||||
|
||||
@@ -375,6 +375,9 @@ const encryptSavedApiKey = (
|
||||
})
|
||||
|
||||
const platformHarnessProfileId = 'goodbuddy-platform-harness'
|
||||
const historicalDefaultModelBaseUrl = 'https://bigtoken.ai'
|
||||
const historicalDefaultModelName = 'sonnet-5'
|
||||
const historicalDefaultModelProtocol = 'anthropic-messages'
|
||||
|
||||
export type CredentialCipher = SettingsCredentialCipher
|
||||
|
||||
@@ -694,9 +697,9 @@ function migrateVersion19(
|
||||
modelProfiles: settings.modelProfiles.map((profile) =>
|
||||
profile.id === defaultModelProfileId &&
|
||||
profile.name === '默认模型' &&
|
||||
profile.baseUrl === 'https://bigtoken.ai' &&
|
||||
profile.modelName === 'sonnet-5' &&
|
||||
profile.protocol === 'anthropic-messages' &&
|
||||
profile.baseUrl === historicalDefaultModelBaseUrl &&
|
||||
profile.modelName === historicalDefaultModelName &&
|
||||
profile.protocol === historicalDefaultModelProtocol &&
|
||||
profile.authentication === 'api-key' &&
|
||||
profile.supportsImageInput === false &&
|
||||
profile.imageGenerationQuality === 'auto' &&
|
||||
@@ -1480,23 +1483,47 @@ export class RuntimeSettingsStore {
|
||||
throw new Error(`模型连接不存在:${profile.id}`)
|
||||
}
|
||||
const environmentManaged = credential.source === 'environment'
|
||||
const environmentBaseUrl =
|
||||
this.environment.GOODBUDDY_MODEL_BASE_URL?.trim() ||
|
||||
const genericEnvironmentApiKey =
|
||||
this.environment.GOODBUDDY_MODEL_API_KEY?.trim()
|
||||
const legacyEnvironmentApiKey =
|
||||
this.environment.GOODBUDDY_BIGTOKEN_API_KEY?.trim()
|
||||
const genericEnvironmentBaseUrl =
|
||||
this.environment.GOODBUDDY_MODEL_BASE_URL?.trim()
|
||||
const legacyEnvironmentBaseUrl =
|
||||
this.environment.GOODBUDDY_BIGTOKEN_BASE_URL?.trim()
|
||||
const environmentModel =
|
||||
this.environment.GOODBUDDY_MODEL_NAME?.trim() ||
|
||||
const genericEnvironmentModel =
|
||||
this.environment.GOODBUDDY_MODEL_NAME?.trim()
|
||||
const legacyEnvironmentModel =
|
||||
this.environment.GOODBUDDY_BIGTOKEN_MODEL?.trim()
|
||||
const legacyEnvironmentConnection =
|
||||
environmentManaged &&
|
||||
!genericEnvironmentApiKey &&
|
||||
Boolean(legacyEnvironmentApiKey) &&
|
||||
!genericEnvironmentBaseUrl &&
|
||||
!genericEnvironmentModel
|
||||
const environmentBaseUrl =
|
||||
genericEnvironmentBaseUrl || legacyEnvironmentBaseUrl
|
||||
const environmentModel =
|
||||
genericEnvironmentModel || legacyEnvironmentModel
|
||||
const baseUrl = environmentManaged
|
||||
? environmentBaseUrl || defaultRuntimeSettings.modelBaseUrl
|
||||
? environmentBaseUrl ||
|
||||
(legacyEnvironmentConnection
|
||||
? historicalDefaultModelBaseUrl
|
||||
: defaultRuntimeSettings.modelBaseUrl)
|
||||
: profile.baseUrl
|
||||
const model = environmentManaged
|
||||
? environmentModel || defaultRuntimeSettings.modelName
|
||||
? environmentModel ||
|
||||
(legacyEnvironmentConnection
|
||||
? historicalDefaultModelName
|
||||
: defaultRuntimeSettings.modelName)
|
||||
: profile.modelName
|
||||
return {
|
||||
apiKey: credential.activeApiKey,
|
||||
baseUrl,
|
||||
model,
|
||||
protocol: profile.protocol,
|
||||
protocol: legacyEnvironmentConnection
|
||||
? historicalDefaultModelProtocol
|
||||
: profile.protocol,
|
||||
authentication: environmentManaged
|
||||
? 'api-key'
|
||||
: profile.authentication,
|
||||
|
||||
Reference in New Issue
Block a user