feat(session): validate agents and browse workspace directories

This commit is contained in:
weishu
2026-08-25 16:12:29 +08:00
parent a04275b51d
commit e5a8212f4a
77 changed files with 3409 additions and 312 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { logger } from '@/ui/logger';
import { spawnWithTerminalGuard } from '@/utils/spawnWithTerminalGuard';
import { getAgentLaunchCommand } from '@/agent/agentLaunchCommand';
export async function opencodeLocal(opts: {
path: string;
@@ -18,7 +19,7 @@ export async function opencodeLocal(opts: {
logger.debug(`[OpencodeLocal] Spawning opencode with args: ${JSON.stringify(args)}`);
await spawnWithTerminalGuard({
command: 'opencode',
command: getAgentLaunchCommand('opencode'),
args,
cwd: opts.path,
env: opts.env,
+2 -1
View File
@@ -2,6 +2,7 @@ import { createServer } from 'node:net';
import { AcpSdkBackend } from '@/agent/backends/acp';
import { buildOpencodeEnv } from './config';
import { getInvokedCwd } from '@/utils/invokedCwd';
import { getAgentLaunchCommand } from '@/agent/agentLaunchCommand';
function filterEnv(env: NodeJS.ProcessEnv): Record<string, string> {
const result: Record<string, string> = {};
@@ -61,7 +62,7 @@ export function createOpencodeBackend(opts: {
}
return new AcpSdkBackend({
command: 'opencode',
command: getAgentLaunchCommand('opencode'),
args,
env: filterEnv(env),
textChunkMode: 'delta',