fix: reuse bundled agent runtime resources

This commit is contained in:
mesalogo
2026-09-07 16:57:59 +08:00
parent d3947c79dd
commit 19086d656e
52 changed files with 1657 additions and 867 deletions
+2 -2
View File
@@ -542,7 +542,7 @@ describe('Agent CLI fixed command contract', () => {
runtimeId: 'opencode',
bundleDigest,
architecture: 'x64',
runtimeVersion: '1.18.9'
runtimeVersion: '1.18.29'
})
expect(
@@ -704,7 +704,7 @@ function verifiedRuntime(
manifest: {
runtimeId: 'opencode',
provider: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
architecture: 'x64',
signingKeyId: 'test-key',
bundleDigest,
@@ -384,7 +384,7 @@ function manifest(): RemoteRuntimeBundleManifest {
formatVersion: 2,
product: 'GoodBuddy',
runtimeId: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
provider: 'opencode',
platform: 'linux',
architecture: 'x64',
@@ -409,7 +409,7 @@ function manifest(): RemoteRuntimeBundleManifest {
licenses: [
{
package: 'opencode-ai',
version: '1.18.9',
version: '1.18.29',
spdx: 'MIT',
path: 'licenses/opencode.txt'
}
@@ -338,7 +338,7 @@ function createFixture(): {
formatVersion: 2,
product: 'GoodBuddy',
runtimeId: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
provider: 'opencode',
platform: 'linux',
architecture: 'x64',
@@ -373,7 +373,7 @@ function createFixture(): {
licenses: [
{
package: 'opencode-ai',
version: '1.18.9',
version: '1.18.29',
spdx: 'MIT',
path: 'licenses/opencode.txt'
}
+2 -2
View File
@@ -431,7 +431,7 @@ describe('AgentProtocolServer connection bounds', () => {
it('advertises only a verified Runtime with ACP control and data handlers', async () => {
const runtime = {
runtimeId: 'opencode',
version: '1.18.9',
version: '1.18.29',
bundleDigest: `sha256:${'b'.repeat(64)}`,
acpCapabilitiesDigest: `sha256:${'c'.repeat(64)}`,
sessionLoad: false,
@@ -481,7 +481,7 @@ describe('AgentProtocolServer connection bounds', () => {
it('advertises the critical model bridge only with blob composition', async () => {
const runtime = {
runtimeId: 'opencode',
version: '1.18.9',
version: '1.18.29',
bundleDigest: `sha256:${'b'.repeat(64)}`,
acpCapabilitiesDigest: `sha256:${'c'.repeat(64)}`,
sessionLoad: false,
@@ -25,13 +25,13 @@ afterEach(() => {
describe('Runtime bundle registry', () => {
it('registers and resolves the current signed digest atomically', () => {
const fixture = createRegistry()
const verified = runtimeBundle(fixture, '1.18.9', 'a')
const verified = runtimeBundle(fixture, '1.18.29', 'a')
const entry = fixture.registry.register(verified)
expect(entry).toMatchObject({
runtimeId: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
architecture: 'x64',
bundleDigest: verified.manifest.bundleDigest
})
@@ -54,7 +54,7 @@ describe('Runtime bundle registry', () => {
it('reuses an exact bundle and replaces it with another signed identity', () => {
const fixture = createRegistry()
const first = runtimeBundle(fixture, '1.18.9', 'a')
const first = runtimeBundle(fixture, '1.18.29', 'a')
const second = runtimeBundle(fixture, '1.19.0', 'b')
expect(fixture.registry.register(first)).toEqual(
@@ -87,7 +87,7 @@ describe('Runtime bundle registry', () => {
current: [{
runtimeId: 'opencode',
provider: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
releaseSequence: 3,
architecture: 'x64',
signingKeyId: 'test-key',
@@ -107,7 +107,7 @@ describe('Runtime bundle registry', () => {
formatVersion: 1,
current: [{
runtimeId: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
architecture: 'x64',
bundleDigest: `sha256:${'a'.repeat(64)}`,
manifestDigest: `sha256:${'b'.repeat(64)}`,
@@ -124,7 +124,7 @@ describe('Runtime bundle registry', () => {
const activator = new RuntimeBundleRegistry({
runtimeRoot: fixture.runtimeRoot
})
const first = runtimeBundle(fixture, '1.18.9', 'a')
const first = runtimeBundle(fixture, '1.18.29', 'a')
const firstEntry = activator.register(first)
expect(fixture.registry.current('x64')).toEqual([firstEntry])
@@ -31,7 +31,7 @@ export const TEST_REMOTE_RUNTIME_LOCK: RemoteRuntimeLock = {
formatVersion: 1,
runtimes: {
opencode: {
version: '1.18.9',
version: '1.18.29',
provider: 'opencode',
entrypoint: 'bin/opencode',
entrypointIdentity: 'opencode-acp',
@@ -87,7 +87,7 @@ export async function createRuntimeBundleTestFixture(
formatVersion: 2,
product: 'GoodBuddy',
runtimeId: 'opencode',
runtimeVersion: '1.18.9',
runtimeVersion: '1.18.29',
provider: 'opencode',
platform: 'linux',
architecture: 'x64',
@@ -127,7 +127,7 @@ export async function createRuntimeBundleTestFixture(
licenses: [
{
package: 'opencode-ai',
version: '1.18.9',
version: '1.18.29',
spdx: 'MIT',
path: 'licenses/opencode.txt'
}
@@ -188,7 +188,7 @@ describe('Remote Runtime bundle verifier', () => {
await expect(capabilities()).resolves.toEqual([
{
runtimeId: 'opencode',
version: '1.18.9',
version: '1.18.29',
bundleDigest: fixture.manifest.bundleDigest,
acpCapabilitiesDigest:
fixture.manifest.acpCapabilitiesDigest,
@@ -236,7 +236,7 @@ describe('Remote Runtime bundle verifier', () => {
options
)
).resolves.toMatchObject({
manifest: { runtimeVersion: '1.18.9' }
manifest: { runtimeVersion: '1.18.29' }
})
writeFileSync(
+1 -1
View File
@@ -101,7 +101,7 @@ describe('production Runtime composition', () => {
await expect(protocol.runtimes()).resolves.toEqual([
{
runtimeId: 'opencode',
version: '1.18.9',
version: '1.18.29',
bundleDigest: fixture.manifest.bundleDigest,
acpCapabilitiesDigest:
fixture.manifest.acpCapabilitiesDigest,