mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-10 19:42:21 +00:00
feat(session): validate agents and browse workspace directories
This commit is contained in:
@@ -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,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',
|
||||
|
||||
Reference in New Issue
Block a user