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
@@ -23,6 +23,47 @@ afterEach(async () => {
})
describe('getWorkspaceChanges', () => {
it('reads unborn repositories, nested untracked files, index and worktree diffs separately', async () => {
const directory = await mkdtemp(join(tmpdir(), 'goodbuddy-changes-'))
temporaryDirectories.push(directory)
await execute('git', ['init'], { cwd: directory })
expect(await getWorkspaceChanges(directory)).toMatchObject({ available: true, files: [], patch: '' })
await mkdir(join(directory, 'new directory'))
const path = 'new directory/[file].txt'
await writeFile(join(directory, path), 'index\n')
expect((await getWorkspaceChanges(directory)).files).toContainEqual({ path, status: '??' })
expect((await getWorkspaceChanges(directory, path)).patch).toContain('+index')
await execute('git', ['add', '--', path], { cwd: directory })
await writeFile(join(directory, path), 'worktree\n')
const diff = await getWorkspaceChanges(directory, path)
expect(diff).toMatchObject({ available: true })
expect(diff.stagedPatch).toContain('+index')
expect(diff.patch).toContain('-index')
expect(diff.patch).toContain('+worktree')
})
it('reads deleted and renamed paths literally without including unrelated changes', async () => {
const directory = await mkdtemp(join(tmpdir(), 'goodbuddy-changes-'))
temporaryDirectories.push(directory)
const git = (...args: string[]) => execute('git', args, { cwd: directory })
await git('init')
await writeFile(join(directory, 'old name.txt'), 'original\n')
await writeFile(join(directory, 'other.txt'), 'other\n')
await git('add', '.')
await git('-c', 'user.name=Test', '-c', 'user.email=test@example.invalid', 'commit', '-m', 'initial')
await git('mv', 'old name.txt', '[new].txt')
await writeFile(join(directory, '[new].txt'), 'edited\n')
await writeFile(join(directory, 'other.txt'), 'unrelated\n')
const renamed = await getWorkspaceChanges(directory, '[new].txt')
expect(renamed.stagedPatch).toContain('rename from old name.txt')
expect(renamed.stagedPatch).toContain('rename to [new].txt')
expect(renamed.patch).toContain('+edited')
expect(renamed.patch).not.toContain('unrelated')
await rm(join(directory, '[new].txt'))
expect((await getWorkspaceChanges(directory, '[new].txt')).patch).toContain('-original')
await git('add', '-u')
expect((await getWorkspaceChanges(directory, 'old name.txt')).stagedPatch).toContain('-original')
})
it('returns tracked and untracked Git workspace changes', async () => {
const directory = await mkdtemp(join(tmpdir(), 'goodbuddy-changes-'))
temporaryDirectories.push(directory)