File tree Expand file tree Collapse file tree
scorpio.ai/src/Agents/ACP Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os from 'os' ;
2+ import { existsSync , mkdirSync } from 'fs' ;
23import { type StructuredToolInterface } from '@langchain/core/tools' ;
34import {
45 ServiceContainer ,
@@ -75,6 +76,7 @@ export class AgentRunner {
7576 const assetsDir = config . getConfigPath ( 'assets' , true ) ;
7677 const httpUrl = config . getHttpUrl ( ) ;
7778 const workPath = options . workPath ?? `${ assetsDir } /${ threadId } ` ;
79+ if ( ! existsSync ( workPath ) ) mkdirSync ( workPath , { recursive : true } ) ;
7880
7981 /** 静态 system prompts(可缓存):instruction → environment */
8082 const extraPrompts : string [ ] = [
Original file line number Diff line number Diff line change 11import { ChildProcess , spawn } from "child_process" ;
2- import { existsSync , mkdirSync } from "fs" ;
32import { Readable , Writable } from "stream" ;
43import { ClientSideConnection , ndJsonStream } from "@agentclientprotocol/sdk" ;
54import type * as schema from "@agentclientprotocol/sdk" ;
@@ -54,9 +53,6 @@ export abstract class ACPAgentServiceBase extends AgentServiceBase {
5453 this . env = env ?? { } ;
5554 this . workPath = workPath ;
5655 this . initTimeoutMs = initTimeoutMs ;
57- if ( workPath && ! existsSync ( workPath ) ) {
58- mkdirSync ( workPath , { recursive : true } ) ;
59- }
6056 }
6157
6258 // ── stream ───────────────────────────────────────────────────────────
You can’t perform that action at this time.
0 commit comments