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
@@ -0,0 +1,56 @@
/**
* OpenCode's ACP adapter omits native child sessions. This plugin forwards
* their SDK events as ACP metadata on the owning Task, using the same stdio
* stream and prompt lifetime as the built-in adapter.
*/
export function openCodeSubagentPluginSource(): string {
return `export default ${plugin.toString()}`
}
function plugin() {
const tasks = new Map<string, { sessionId: string; callId: string }>()
return Promise.resolve({
event: async ({ event }: { event: {
type: string
properties: {
sessionID?: string
part?: {
type: string
tool?: string
callID?: string
state?: {
metadata?: { sessionId?: string }
}
}
}
} }) => {
const properties = event.properties
const part = properties.part
let owner = properties.sessionID ? tasks.get(properties.sessionID) : undefined
if (
!owner && event.type === 'message.part.updated' &&
part?.type === 'tool' && part.tool === 'task' &&
part.callID && properties.sessionID
) {
owner = { sessionId: properties.sessionID, callId: part.callID }
const child = part.state?.metadata?.sessionId
if (child) tasks.set(child, owner)
}
if (!owner || ![
'message.updated', 'message.part.updated', 'message.part.delta'
].includes(event.type)) return
process.stdout.write(JSON.stringify({
jsonrpc: '2.0',
method: 'session/update',
params: {
sessionId: owner.sessionId,
update: {
sessionUpdate: 'tool_call_update',
toolCallId: owner.callId,
_meta: { goodbuddySubagentEvent: event }
}
}
}) + '\n')
}
})
}