u
This commit is contained in:
@@ -4,7 +4,7 @@ import jwt from 'jsonwebtoken';
|
||||
import { defineTool, ToolError } from 'libllmorbiter';
|
||||
import env from '../config/env.js';
|
||||
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
|
||||
import { createVfs, prepareVfs, syncVfsToDb } from './vfs.js';
|
||||
import { createVfs, prepareVfs } from './vfs.js';
|
||||
import { runSandboxJob } from '../services/javascriptSandbox.js';
|
||||
|
||||
const DEFAULT_TIMEOUT_MS = 20_000;
|
||||
@@ -367,19 +367,14 @@ export function createJavascriptExecuteTool({ googleAuthId }) {
|
||||
const isApplet = hasApplet;
|
||||
const applet = isApplet ? readApplet(vfsRoot, appletvfsfile) : null;
|
||||
const source = isApplet ? applet.source : code;
|
||||
let report;
|
||||
try {
|
||||
report = await runInWorker({
|
||||
code: source,
|
||||
timeoutMs: hardTimeout,
|
||||
vfsRoot,
|
||||
googleAuthId,
|
||||
appletInput: isApplet ? (applet_input ?? {}) : undefined,
|
||||
appletFile: isApplet ? appletvfsfile.trim() : undefined,
|
||||
});
|
||||
} finally {
|
||||
await syncVfsToDb({ googleAuthId, vfsRoot });
|
||||
}
|
||||
const report = await runInWorker({
|
||||
code: source,
|
||||
timeoutMs: hardTimeout,
|
||||
vfsRoot,
|
||||
googleAuthId,
|
||||
appletInput: isApplet ? (applet_input ?? {}) : undefined,
|
||||
appletFile: isApplet ? appletvfsfile.trim() : undefined,
|
||||
});
|
||||
|
||||
if (report.timedOut) {
|
||||
throw new ToolError(
|
||||
|
||||
Reference in New Issue
Block a user