{"record":{"id":"73d03eeeb4675ca7","repo":"NousResearch/hermes-agent","slug":"session-switch-needs-a-sessionid-b-sessioni","errorCode":null,"errorMessage":"session-switch needs --a <sessionId> --b <sessionId>","messagePattern":"session-switch needs --a <sessionId> --b <sessionId>","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/scripts/perf/scenarios/session-switch.mjs","lineNumber":20,"sourceCode":"// two real stored session ids and a live backend. Report-only.\n//\n//   node scripts/perf/run.mjs session-switch --a <sidA> --b <sidB> [--rounds 2]\n\nimport { SELECTORS, sleep } from '../lib/cdp.mjs'\nimport { summarize } from '../lib/stats.mjs'\n\nexport default {\n  name: 'session-switch',\n  tier: 'backend',\n  description: 'Route to a session and wait for first-paint + settle of its transcript.',\n  requiredOpts: ['a', 'b'],\n  async run(cdp, opts = {}) {\n    const { a, b } = opts\n    const rounds = Number(opts.rounds ?? 2)\n    const settleTimeoutMs = Number(opts.settleTimeoutMs ?? 30000)\n\n    if (!a || !b) {\n      throw new Error('session-switch needs --a <sessionId> --b <sessionId>')\n    }\n\n    await cdp.send('Runtime.enable')\n\n    const switchTo = async sid => {\n      const t0 = await cdp.eval(`(() => { location.hash = '#/' + ${JSON.stringify(sid)}; return performance.now() })()`)\n      const deadline = Date.now() + settleTimeoutMs\n      let firstPaint = null\n      let stable = 0\n      let lastCount = -1\n\n      while (Date.now() < deadline) {\n        await sleep(50)\n        const s = await cdp.eval(`({\n          t: performance.now(),\n          route: location.hash,\n          msgs: document.querySelectorAll(${JSON.stringify(SELECTORS.assistantMessage)}).length\n        })`)","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/scripts/perf/scenarios/session-switch.mjs#L2-L38","documentation":"Error \"session-switch needs --a <sessionId> --b <sessionId>\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/scripts/perf/scenarios/session-switch.mjs:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass both --a <sessionId> and --b <sessionId> with two existing session ids."],"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-15T17:31:12.345Z"}