{"record":{"id":"1d0ae134ae709d2a","repo":"NousResearch/hermes-agent","slug":"expected-expected-preloaded-history-messages-g","errorCode":null,"errorMessage":"expected ${expected} preloaded history messages, got ${mounted}","messagePattern":"expected (.+?) preloaded history messages, got (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/scripts/perf/scenarios/stream.mjs","lineNumber":151,"sourceCode":"    const historySettleMs = Number(opts.historySettleMs ?? 1500)\n\n    await cdp.send('Runtime.enable')\n\n    // Mount the settled history BEFORE the recorders start, so the measurement\n    // window contains only streaming work — not the one-off mount cost.\n    if (historyTurns > 0) {\n      if (real) {\n        throw new Error('--historyTurns is only supported by the synthetic stream path')\n      }\n\n      await cdp.eval(`window.__PERF_DRIVE__.loadTranscript(${historyTurns})`)\n      await sleep(historySettleMs)\n\n      const mounted = Number(await cdp.eval('window.__PERF_DRIVE__.snapshotMsgs()'))\n      const expected = historyTurns * 2\n\n      if (mounted !== expected) {\n        throw new Error(`expected ${expected} preloaded history messages, got ${mounted}`)\n      }\n    }\n\n    await cdp.eval(RECORDERS)\n\n    if (real) {\n      // Backend path: fire a real prompt and wait for the stream to appear.\n      const baseCount = await cdp.eval(\n        `document.querySelectorAll(${JSON.stringify(SELECTORS.assistantMessage)}).length`\n      )\n      await typeIntoComposer(cdp, opts.prompt ?? 'count from 1 to 80, one number per line', { cps: 40 })\n      await cdp.eval(`(() => {\n        const el = document.querySelector(${JSON.stringify(SELECTORS.composer)})\n        el && el.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', code: 'Enter', bubbles: true, cancelable: true }))\n      })()`)\n\n      const deadline = Date.now() + Number(opts.timeoutMs ?? 60000)\n      let started = false","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/scripts/perf/scenarios/stream.mjs#L133-L169","documentation":"Error \"expected ${expected} preloaded history messages, got ${mounted}\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/scripts/perf/scenarios/stream.mjs:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the synthetic history setup; fewer messages mounted than requested.","Verify the session preload data matches the expected message count and rerun."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}