{"record":{"id":"086c4ac6acdd546b","repo":"deepseek-ai/deepseek-harness","slug":"dynamic-package-code-host-failed-to-parse-con","errorCode":null,"errorMessage":"dynamic package `code.host` failed to parse:\n${context}\nNote: it runs as the BODY of an async function (line numbers are offset by the 1-line wrapper). Check bracket balance — ending the returned plugin object with `});` closes a call that was never opened; a plain `return { … }` ends with `}` (an optional `;`), never `).","messagePattern":"dynamic package `code\\.host` failed to parse:\n(.+?)\nNote: it runs as the BODY of an async function \\(line numbers are offset by the 1-line wrapper\\)\\. Check bracket balance — ending the returned plugin object with `\\}\\);` closes a call that was never opened; a plain `return (.+?)` ends with `\\}` \\(an optional `;`\\), never `\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extensions/cordis-host-runner/src/sandbox.ts","lineNumber":263,"sourceCode":" * bounds the SYNCHRONOUS portion; an async body escapes it — acceptable under the module's\n * trust stance. Parse errors include the offending line and a TypeScript-removal or bracket-\n * balance hint.\n * @param sandbox - the contextified object from {@link createSandbox}.\n * @param code - the model-written function body; must `return` a plugin.\n * @param id - the package id, used as the vm filename (`cordis-dyn-<id>.js`).\n * @param vmTimeoutMs - the synchronous evaluation bound in milliseconds.\n * @returns whatever the code returned, still un-narrowed (the run lifecycle checks plugin shape).\n */\nexport async function evaluateHostCode(sandbox: object, code: string, id: string, vmTimeoutMs: number): Promise<unknown> {\n  try {\n    return await runInContext(\n      `(async () => {\\n${code}\\n})()`,\n      sandbox,\n      { filename: `cordis-dyn-${id}.js`, timeout: vmTimeoutMs },\n    )\n  } catch (error) {\n    if (!isSyntaxError(error)) throw error\n    throw new Error(parseErrorMessage('code.host', syntaxErrorContext(error)))\n  }\n}\n","sourceCodeStart":245,"sourceCodeEnd":266,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/extensions/cordis-host-runner/src/sandbox.ts#L245-L266","documentation":"Error \"dynamic package `code.host` failed to parse:\n${context}\nNote: it runs as the BODY of an async function (line numbers are offset by the 1-line wrapper). Check bracket balance — ending the returned plugin object with `});` closes a call that was never opened; a plain `return { … }` ends with `}` (an optional `;`), never `).\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/extensions/cordis-host-runner/src/sandbox.ts:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}