Add managed SSH Hosts and projects with signed side-by-side GoodBuddy Agent and OpenCode Runtime installation, Ask and Execute workspace access, a Main-owned model bridge, detached Agent lifecycle, durable ACP output recovery, and project activation UI. Use protocol v2 with bounded FIFO frames over SSH instead of custom credit, priority, batching, or model-message chunking. Mismatched Host Agents now upgrade automatically, an exactly verified Node runtime is reused on-host, and local Portable builds can embed strictly verified Agent artifacts. Release note: 新增托管 SSH 远程项目,可自动安装或升级签名 Agent/OpenCode Runtime,并在 SSH 断线后继续 Agent 工作和同步未确认输出。
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
parseLinuxProcStat,
|
|
parseSerializedLinuxRuntimeProcessIdentity,
|
|
sameLinuxRuntimeProcessIdentity,
|
|
serializeLinuxRuntimeProcessIdentity
|
|
} from './runtime-process-identity'
|
|
|
|
describe('Linux Runtime process identity', () => {
|
|
it('parses proc stat command names containing spaces and parentheses', () => {
|
|
const fields = ['S', '10', '20', '30', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '987654', '0']
|
|
const parsed = parseLinuxProcStat(`123 (bwrap worker (one)) ${fields.join(' ')}`)
|
|
expect(parsed).toMatchObject({
|
|
pid: 123,
|
|
command: 'bwrap worker (one)',
|
|
parentPid: 10,
|
|
processGroupId: 20,
|
|
sessionId: 30,
|
|
startTimeTicks: 987654n
|
|
})
|
|
})
|
|
|
|
it('round trips the minimal owner identity and detects PID reuse', () => {
|
|
const identity = {
|
|
bootId: '11111111-1111-1111-1111-111111111111',
|
|
pid: 42,
|
|
startTimeTicks: 100n,
|
|
processGroupId: 42,
|
|
executablePath: '/usr/bin/bwrap'
|
|
}
|
|
expect(
|
|
parseSerializedLinuxRuntimeProcessIdentity(
|
|
serializeLinuxRuntimeProcessIdentity(identity)
|
|
)
|
|
).toEqual(identity)
|
|
expect(
|
|
sameLinuxRuntimeProcessIdentity(identity, {
|
|
...identity,
|
|
startTimeTicks: 101n
|
|
})
|
|
).toBe(false)
|
|
})
|
|
})
|