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

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:
mesalogo
2026-08-30 17:18:33 +08:00
parent 7c6f15d3c0
commit efd304fa1d
42 changed files with 2776 additions and 528 deletions
+70 -41
View File
@@ -38,7 +38,6 @@ import { deepSeekHarnessStartupBudget } from './deepseek-harness-control-protoco
const ACP_PACKAGE_NAME = '@agentclientprotocol/sdk'
const DEFAULT_INITIALIZATION_TIMEOUT_MS = 10_000
const DEFAULT_PROMPT_TIMEOUT_MS = 10 * 60_000
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 2_000
const DEFAULT_MAX_STDERR_BYTES = 64 * 1024
const DEFAULT_MAX_EVENT_CHARACTERS = 64 * 1024
@@ -486,8 +485,8 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
)
}
private get promptTimeoutMs(): number {
return this.options.promptTimeoutMs ?? DEFAULT_PROMPT_TIMEOUT_MS
private get promptTimeoutMs(): number | undefined {
return this.options.promptTimeoutMs
}
private get shutdownTimeoutMs(): number {
@@ -1435,6 +1434,8 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
} else {
toolNames.delete(callId)
}
const input = safeStringify(update.rawInput)
const output = safeStringify(update.rawOutput)
return {
requestId,
type: 'tool',
@@ -1442,12 +1443,8 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
name,
state,
summary: `DeepSeek Harness 工具:${name}`,
...(safeStringify(update.rawInput)
? { input: safeStringify(update.rawInput) }
: {}),
...(safeStringify(update.rawOutput)
? { output: safeStringify(update.rawOutput) }
: {})
...(input ? { input } : {}),
...(output ? { output } : {})
}
}
return undefined
@@ -1505,8 +1502,10 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
| { stopReason?: string }
| undefined
let promptError: unknown
const promptController = new AbortController()
const cancel = (): void => {
run!.closed = true
run!.wake?.()
run!.wake = undefined
void state!.agent
.cancel({
sessionId: sessionId!
@@ -1514,33 +1513,47 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
.catch(() => undefined)
}
signal.addEventListener('abort', cancel, { once: true })
await withTimeout(
state.agent.extMethod(GOODBUDDY_PREPARE, {
sessionId,
requestId: request.requestId,
mode:
request.workMode === 'execute' ? 'execute' : 'ask'
}),
this.initializationTimeoutMs,
'请求准备'
)
const prompt = withTimeout(
state.agent.prompt({
sessionId,
prompt: [
{
type: 'text',
text: flattenPrompt(request)
},
...(request.images ?? []).map((image) => ({
type: 'image' as const,
data: image.data,
mimeType: image.mediaType
}))
]
}),
this.promptTimeoutMs,
'请求'
if (signal.aborted) {
cancel()
}
try {
await withTimeout(
state.agent.extMethod(GOODBUDDY_PREPARE, {
sessionId,
requestId: request.requestId,
mode:
request.workMode === 'execute' ? 'execute' : 'ask'
}),
this.initializationTimeoutMs,
'请求准备'
)
signal.throwIfAborted()
} catch (error) {
signal.removeEventListener('abort', cancel)
throw error
}
const promptOperation = state.agent.prompt({
sessionId,
prompt: [
{
type: 'text',
text: flattenPrompt(request)
},
...(request.images ?? []).map((image) => ({
type: 'image' as const,
data: image.data,
mimeType: image.mediaType
}))
]
})
const prompt = (
this.promptTimeoutMs === undefined
? promptOperation
: withTimeout(
promptOperation,
this.promptTimeoutMs,
'请求'
)
)
.then((value) => {
response = value
@@ -1555,9 +1568,15 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
})
try {
while (!completed || run.updates.length > 0) {
signal.throwIfAborted()
if (this.fatalError) {
throw this.fatalError
}
if (run.closed && !completed) {
throw new Error(
'DeepSeek Harness 请求在完成前已关闭'
)
}
if (run.updates.length === 0) {
await this.waitForUpdate(run)
continue
@@ -1588,11 +1607,21 @@ export class DeepSeekHarnessRuntime implements AgentRuntime {
sessionId
}
} finally {
promptController.abort(
new Error('DeepSeek Harness 流式消费已结束')
)
if (!completed) {
cancel()
}
signal.removeEventListener('abort', cancel)
await prompt
if (completed) {
await prompt
} else {
await withTimeout(
prompt,
this.shutdownTimeoutMs,
'取消请求'
).catch(async () => {
await this.terminate(state!.child)
})
}
}
} finally {
signal.removeEventListener('abort', abortTools)