fix: keep valid older agent packages usable after desktop updates

Accept package-declared OpenCode, Node and koffi versions instead of desktop release pins. Preserve signature, hash, protocol and package-internal version consistency checks.

Validate both cached 0.11.18 packages and Linux x64 installation, bootstrap, health and stop. Related regression suite: 326 passed, 1 skipped; unrelated full-workspace check failures are recorded in the remote Host design.

Release note: Desktop updates no longer reject intact older Agent packages solely because their bundled runtime versions differ.
This commit is contained in:
mesalogo
2026-09-16 19:04:54 +08:00
parent 441f14b5f7
commit 1698d9fd3e
9 changed files with 100 additions and 24 deletions
@@ -74,19 +74,33 @@ async function createFixture(): Promise<{
}
describe('remote Runtime verification metadata loader', () => {
it('loads canonical verification metadata without Runtime payloads', async () => {
it.each(['1.18.9', '1.18.29'])('loads canonical verification metadata for Runtime %s without payloads', async (version) => {
const fixture = await createFixture()
const packageLock = structuredClone(runtimeLock)
packageLock.runtimes.opencode.version = version
await writeFile(fixture.paths.runtimeLockPath, canonical(packageLock))
await expect(
loadRemoteRuntimeVerificationMetadata(fixture.paths)
).resolves.toEqual({
releaseKeyRegistry: registry,
runtimeLock,
runtimeLock: packageLock,
canonicalReleaseKeyRegistryBytes: canonical(registry),
canonicalRemoteRuntimeLockBytes: canonical(runtimeLock)
canonicalRemoteRuntimeLockBytes: canonical(packageLock)
})
})
it.each(['', 'latest', '^1.18.9', '1.18'])('rejects invalid Runtime version %j', async (version) => {
const fixture = await createFixture()
const packageLock = structuredClone(runtimeLock)
packageLock.runtimes.opencode.version = version
await writeFile(fixture.paths.runtimeLockPath, canonical(packageLock))
await expect(
loadRemoteRuntimeVerificationMetadata(fixture.paths)
).rejects.toThrow('Remote Runtime lock contract is invalid')
})
it('canonicalizes equivalent release-key registry formatting', async () => {
const fixture = await createFixture()
await writeFile(