NousResearch/hermes-agent · error · Error

session-switch needs --a <sessionId> --b <sessionId>

Error message

session-switch needs --a <sessionId> --b <sessionId>

What it means

Error "session-switch needs --a <sessionId> --b <sessionId>" thrown in NousResearch/hermes-agent.

Source

Thrown at apps/desktop/scripts/perf/scenarios/session-switch.mjs:20

// two real stored session ids and a live backend. Report-only.
//
//   node scripts/perf/run.mjs session-switch --a <sidA> --b <sidB> [--rounds 2]

import { SELECTORS, sleep } from '../lib/cdp.mjs'
import { summarize } from '../lib/stats.mjs'

export default {
  name: 'session-switch',
  tier: 'backend',
  description: 'Route to a session and wait for first-paint + settle of its transcript.',
  requiredOpts: ['a', 'b'],
  async run(cdp, opts = {}) {
    const { a, b } = opts
    const rounds = Number(opts.rounds ?? 2)
    const settleTimeoutMs = Number(opts.settleTimeoutMs ?? 30000)

    if (!a || !b) {
      throw new Error('session-switch needs --a <sessionId> --b <sessionId>')
    }

    await cdp.send('Runtime.enable')

    const switchTo = async sid => {
      const t0 = await cdp.eval(`(() => { location.hash = '#/' + ${JSON.stringify(sid)}; return performance.now() })()`)
      const deadline = Date.now() + settleTimeoutMs
      let firstPaint = null
      let stable = 0
      let lastCount = -1

      while (Date.now() < deadline) {
        await sleep(50)
        const s = await cdp.eval(`({
          t: performance.now(),
          route: location.hash,
          msgs: document.querySelectorAll(${JSON.stringify(SELECTORS.assistantMessage)}).length
        })`)

View on GitHub (pinned to c896c09c42)

Solutions

  1. Pass both --a <sessionId> and --b <sessionId> with two existing session ids.

When it happens

Trigger: Thrown at apps/desktop/scripts/perf/scenarios/session-switch.mjs:20 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/73d03eeeb4675ca7. Report an issue: GitHub.