Prechádzať zdrojové kódy

refactor(acp): drop async from synchronous ACP.init (#25520)

Kit Langton 3 mesiacov pred
rodič
commit
0956b15c52

+ 1 - 1
packages/opencode/src/acp/agent.ts

@@ -130,7 +130,7 @@ async function sendUsageUpdate(
     })
 }
 
-export async function init({ sdk: _sdk }: { sdk: OpencodeClient }) {
+export function init({ sdk: _sdk }: { sdk: OpencodeClient }) {
   return {
     create: (connection: AgentSideConnection, fullConfig: ACPConfig) => {
       return new Agent(connection, fullConfig)

+ 1 - 1
packages/opencode/src/cli/cmd/acp.ts

@@ -52,7 +52,7 @@ export const AcpCommand = effectCmd({
     })
 
     const stream = ndJsonStream(input, output)
-    const agent = yield* Effect.promise(() => ACP.init({ sdk }))
+    const agent = ACP.init({ sdk })
 
     new AgentSideConnection((conn) => {
       return agent.create(conn, { sdk })