fix: complete subagent output and file workspace interactions

OpenCode child cards now show ordered text, reasoning and tool progress,
with the final result displayed separately. Local SDK and remote ACP paths
share child tracking, including progress retained across recovery and cancellation.
Remote live progress requires an Agent package containing the event plugin;
older Agent packages still expose final results without inventing missing history.

Knowledge-library rows remain clickable when native label activation changes
focus. File workspace changes use colored Git status letters and per-file
staged/unstaged diffs, including deleted, renamed and untracked files.
Refreshing reloads the selected diff and expanded directories, and more than
50 changes remain accessible through incremental loading.

Validated with 3552 passing tests, typecheck, lint, desktop build, current-source
Linux Host scenarios and isolated Windows desktop UI interactions.

Release note: 展开 OpenCode 子代理卡片可查看执行过程、工具详情与独立最终结果;知识库支持整行勾选。工作区支持单文件暂存与未暂存差异,刷新会更新当前差异,更多变更可继续加载。远端实时过程需要更新 GoodBuddy Agent。
This commit is contained in:
mesalogo
2026-09-06 22:13:45 +08:00
parent b03c25685c
commit d08ba33c3e
43 changed files with 1118 additions and 141 deletions
+17 -2
View File
@@ -63,7 +63,7 @@ import {
requestProcessTreeTermination,
waitForProcessExit
} from './child-process-termination'
import { toOpenCodeSubagentEvent } from './opencode-subagent'
import { OpenCodeSubagentProgress, toOpenCodeSubagentEvent } from './opencode-subagent'
import { promptWithUntrustedConversationHistory } from './runtime-conversation-history'
const STARTUP_TIMEOUT_MS = 30_000
@@ -2217,6 +2217,7 @@ export class OpenCodeRuntime implements AgentRuntime {
}
>()
const reasoningPartIds = new Set<string>()
const subagentProgress = new OpenCodeSubagentProgress(request.requestId, sessionId)
const reportedQuestionIds = new Map<string, string>()
let aggregateOutputBytes = 0
let outputTruncated = false
@@ -2315,6 +2316,18 @@ export class OpenCodeRuntime implements AgentRuntime {
const repliedPermissionIds = new Set<string>()
const reportedMessageIds = new Set<string>()
for await (const event of subscription.stream) {
const childProgress = subagentProgress.update(event)
if (
childProgress &&
'sessionID' in event.properties &&
event.properties.sessionID !== sessionId
) {
const task = childProgress.runtimeCallId
? toolStates.get(childProgress.runtimeCallId)
: undefined
if (task) task.subagent = childProgress
yield childProgress
}
if (
event.type === 'message.updated' &&
event.properties.sessionID === sessionId &&
@@ -2424,7 +2437,9 @@ export class OpenCodeRuntime implements AgentRuntime {
...(subagent ? { subagent } : {})
})
if (subagent) {
yield subagent
const retained = subagentProgress.retain(subagent)
toolStates.get(callId)!.subagent = retained
yield retained
} else {
yield {
requestId: request.requestId,