feat: support native subagents and long-running prompts
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
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
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
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
OpenCode Task calls now appear as first-class subagents in local and managed SSH conversations, with stable status, persistence, terminal handling, and true event ordering instead of duplicate generic tool entries. GoodBuddy no longer applies a fixed outer wall-clock total to OpenCode, Continue, DeepSeek Harness, or managed SSH Prompts. Runtime-owned limits, user cancellation, bounded control operations, output limits, and released Agent protocol compatibility remain intact. Desktop and Agent release metadata are synchronized at 0.11.13 with approved bilingual notes. Release note: OpenCode 原生 Task 现在以独立子 Agent 展示;长任务不再被 GoodBuddy 固定总时限中止,并修复 OpenCode 启动识别、可配置 HTTP 服务地址与发布说明读取问题。
This commit is contained in:
@@ -5,6 +5,9 @@ import { join } from 'node:path'
|
||||
import { PassThrough } from 'node:stream'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { RemoteRuntimeBundleManifest } from '../shared/remote-runtime-launch-contracts'
|
||||
import {
|
||||
UNBOUNDED_REMOTE_PROMPT_DEADLINE
|
||||
} from '../shared/remote-agent-contracts'
|
||||
import {
|
||||
launchDirectLinuxStdioProcessOwner,
|
||||
reconcileOrphanedDirectLinuxStdioProcesses,
|
||||
@@ -249,6 +252,48 @@ describe('direct Linux stdio Runtime ownership', () => {
|
||||
registry.close()
|
||||
})
|
||||
|
||||
it('does not stop an active prompt at the unbounded Runtime deadline', async () => {
|
||||
vi.useFakeTimers()
|
||||
try {
|
||||
const registry = createRegistry()
|
||||
const child = fakeChild()
|
||||
const launched = identity()
|
||||
const sendSignal = vi.fn<typeof process.kill>(() => true)
|
||||
const owner = await launchDirectLinuxStdioProcessOwner({
|
||||
manifest: manifest(),
|
||||
profile: profile(),
|
||||
identity: { launchId: 'launch-long', processId: 'process-long' },
|
||||
installationId: 'installation-1',
|
||||
registry,
|
||||
deadlineAt: UNBOUNDED_REMOTE_PROMPT_DEADLINE,
|
||||
maximumInputBytes: 1024,
|
||||
platform: 'linux',
|
||||
spawn: () => {
|
||||
queueMicrotask(() => child.emit('spawn'))
|
||||
return child
|
||||
},
|
||||
randomOwnerToken: () => 'a'.repeat(32),
|
||||
readProcessIdentity: async () => launched,
|
||||
listPidNamespaceMembers: async () => [],
|
||||
sendSignal
|
||||
})
|
||||
|
||||
await vi.advanceTimersByTimeAsync(25 * 60 * 60_000)
|
||||
expect(sendSignal).not.toHaveBeenCalled()
|
||||
expect(await owner.reconcile()).toMatchObject({
|
||||
state: 'running',
|
||||
processTree: 'running'
|
||||
})
|
||||
await owner.stop({
|
||||
reason: 'user-cancelled',
|
||||
deadlineAt: new Date(Date.now() + 10_000).toISOString()
|
||||
})
|
||||
registry.close()
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('startup reconciles only owners from the current installation', async () => {
|
||||
const registry = createRegistry()
|
||||
const reservation = {
|
||||
|
||||
@@ -8,6 +8,9 @@ import {
|
||||
sha256DigestSchema
|
||||
} from '../shared/agent-protocol/contracts'
|
||||
import { canonicalJson } from '../shared/agent-protocol/canonical'
|
||||
import {
|
||||
UNBOUNDED_REMOTE_PROMPT_DEADLINE
|
||||
} from '../shared/remote-agent-contracts'
|
||||
import {
|
||||
remoteRuntimeBundleManifestSchema,
|
||||
type RemoteRuntimeBundleManifest
|
||||
@@ -511,6 +514,10 @@ export class DirectLinuxStdioProcessOwner {
|
||||
}
|
||||
|
||||
#scheduleDeadline(deadlineAt: string): void {
|
||||
if (deadlineAt === UNBOUNDED_REMOTE_PROMPT_DEADLINE) {
|
||||
this.#clearDeadline()
|
||||
return
|
||||
}
|
||||
const remaining = remainingMilliseconds(deadlineAt, this.#now())
|
||||
this.#clearDeadline()
|
||||
const generation = this.#promptGeneration
|
||||
@@ -551,7 +558,10 @@ export async function launchDirectLinuxStdioProcessOwner(
|
||||
now(),
|
||||
limits.maximumPromptRuntimeMilliseconds
|
||||
)
|
||||
const timeoutMs = remainingMilliseconds(effectiveDeadlineAt, now())
|
||||
const timeoutMs =
|
||||
effectiveDeadlineAt === UNBOUNDED_REMOTE_PROMPT_DEADLINE
|
||||
? DEFAULT_LAUNCH_IDENTITY_TIMEOUT_MS
|
||||
: remainingMilliseconds(effectiveDeadlineAt, now())
|
||||
const baseProfile = resolveProfile(options, manifest)
|
||||
const ownerToken = (options.randomOwnerToken ?? (() => randomBytes(16).toString('hex')))()
|
||||
if (!/^[a-f0-9]{32}$/u.test(ownerToken)) {
|
||||
@@ -1097,6 +1107,9 @@ function boundedPromptDeadline(
|
||||
now: number,
|
||||
maximumRuntimeMilliseconds: number
|
||||
): string {
|
||||
if (requestedDeadlineAt === UNBOUNDED_REMOTE_PROMPT_DEADLINE) {
|
||||
return requestedDeadlineAt
|
||||
}
|
||||
const requested = Date.parse(requestedDeadlineAt)
|
||||
if (!Number.isFinite(requested) || requested <= now) {
|
||||
throw new DirectLinuxStdioProcessOwnerError(
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
type AcpJournalCursor,
|
||||
type RemotePromptOperationPreparation
|
||||
type RemotePromptOperationPreparation,
|
||||
UNBOUNDED_REMOTE_PROMPT_DEADLINE
|
||||
} from '../shared/remote-agent-contracts'
|
||||
import type { RemoteRuntimeBundleManifest } from '../shared/remote-runtime-launch-contracts'
|
||||
import type { ControllerLease } from './controller-registry'
|
||||
@@ -813,6 +814,28 @@ describe('RuntimeAcpBackend', () => {
|
||||
).rejects.toMatchObject({ code: 'deadline' })
|
||||
})
|
||||
|
||||
it('keeps an unbounded Runtime prompt alive without a wall-clock timer', async () => {
|
||||
vi.useFakeTimers()
|
||||
try {
|
||||
const fixture = harness()
|
||||
await open(fixture)
|
||||
await invoke(
|
||||
fixture,
|
||||
'runtime/preparePrompt',
|
||||
fixture.preparation({
|
||||
deadlineAt: UNBOUNDED_REMOTE_PROMPT_DEADLINE
|
||||
})
|
||||
)
|
||||
|
||||
await vi.advanceTimersByTimeAsync(30 * 24 * 60 * 60_000)
|
||||
expect(fixture.process.stops).toEqual([])
|
||||
await fixture.process.emit('stdout', 'still-running')
|
||||
expect(fixture.outputFrames).toEqual(['still-running'])
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('stops the process when its output quota is exceeded', async () => {
|
||||
const fixture = harness({ maximumOutputBytes: 3 })
|
||||
await open(fixture)
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
acpJournalCursorSchema,
|
||||
remotePromptOperationAcceptanceSchema,
|
||||
remotePromptOperationPreparationSchema,
|
||||
UNBOUNDED_REMOTE_PROMPT_DEADLINE,
|
||||
type AcpJournalCursor,
|
||||
type RemotePromptOperationAcceptance,
|
||||
type RemotePromptOperationPreparation
|
||||
@@ -1676,6 +1677,10 @@ export class RuntimeAcpBackend {
|
||||
#scheduleDeadline(binding: BindingState, deadlineAt: string): void {
|
||||
if (binding.deadlineTimer !== undefined) {
|
||||
clearTimeout(binding.deadlineTimer)
|
||||
binding.deadlineTimer = undefined
|
||||
}
|
||||
if (deadlineAt === UNBOUNDED_REMOTE_PROMPT_DEADLINE) {
|
||||
return
|
||||
}
|
||||
const delay = Math.max(
|
||||
1,
|
||||
|
||||
Reference in New Issue
Block a user