deepseek-ai/deepseek-harness · error · SessionForkError

SESSION_NOT_FOUND

SESSION_NOT_FOUND

Error message

session "${source}" not found

What it means

SessionForkError with code SESSION_NOT_FOUND from _resolveForkSource: the fork source was given as a string id (or an object whose id) that no live session in this store matches. The id may be misspelled, or the session was disposed or never created here.

Solutions

  1. Verify the session id exists via store.get() before forking
  2. Create or load the source session in this store first
  3. Check for typos or stale ids from a previous store lifetime
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/core/session/src/index.ts:1143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/612e94e1d9abe55f. Report an issue: GitHub.

Appendix: source

Thrown at packages/core/session/src/index.ts:1143

        'INVALID_BOUNDARY',
      )
    }
    const lastTurnBoundary = events.slice(0, boundary + 1)
      .findLast(event => event.type === 'turn/start' || event.type === 'turn/end')
    if (lastTurnBoundary?.type === 'turn/start') {
      throw new SessionForkError(
        `fork boundary ${boundary} in session "${session.id}" ends inside open turn ${lastTurnBoundary.data.turn}`,
        'OPEN_TURN',
      )
    }

    return events.slice(0, boundary + 1)
  }

  private _resolveForkSource(source: SessionForkSource): Session {
    if (typeof source === 'string') {
      const session = this.get(source)
      if (session === undefined) throw new SessionForkError(`session "${source}" not found`, 'SESSION_NOT_FOUND')
      return session
    }

    const live = this.get(source.id)
    if (live === undefined) {
      throw new SessionForkError(`session "${source.id}" not found`, 'SESSION_NOT_FOUND')
    }
    if (live !== source) throw new SessionForkError(`session "${source.id}" is not the live store instance`, 'SESSION_NOT_LIVE')
    return source
  }

}

export default SessionStore

View on GitHub (pinned to b150a551b8)