Skip to content

Commit 699fd27

Browse files
committed
Fix liberate_extract timeout
1 parent ae2d7db commit 699fd27

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎apps/cli/ai/tools/data-liberation.ts‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { textResult } from './utils';
99

1010
const engineDir = path.join( import.meta.dirname, 'data-liberation-agent' );
1111

12+
// Engine ops (extract/screenshot/reconstruct) routinely run for minutes; the MCP SDK's
13+
// 60 s default times them out (-32001) even though the engine keeps working.
14+
const ENGINE_CALL_TIMEOUT_MS = 600_000;
15+
1216
let chromiumPromise: Promise< void > | null = null;
1317

1418
function ensureEngineChromium(): Promise< void > {
@@ -147,10 +151,14 @@ export const dataLiberationTool = defineTool(
147151

148152
await ensureEngineChromium();
149153

150-
const result = await client.callTool( {
151-
name: args.tool,
152-
arguments: normalizeArgs( args.args ),
153-
} );
154+
const result = await client.callTool(
155+
{
156+
name: args.tool,
157+
arguments: normalizeArgs( args.args ),
158+
},
159+
undefined,
160+
{ timeout: ENGINE_CALL_TIMEOUT_MS, resetTimeoutOnProgress: true }
161+
);
154162

155163
const rawContent = Array.isArray( result.content )
156164
? ( result.content as DataLiberationResultContent[] )

0 commit comments

Comments
 (0)