SessionSearchResult
Defined in: packages/core/src/history/historyStore.ts:104
A search hit: the stored record plus its id and a highlighted snippet.
Extends
Section titled “Extends”Properties
Section titled “Properties”command?
Section titled “command?”
optionalcommand?:string
Defined in: packages/core/src/history/historyStore.ts:78
Originating command (ask/chat/code/exec/…).
Inherited from
Section titled “Inherited from”conversationId?
Section titled “conversationId?”
optionalconversationId?:number
Defined in: packages/core/src/history/historyStore.ts:54
GS2-19 — the parent conversation this turn belongs to. When omitted, HistoryStore.record opens a fresh single-turn conversation for the row (so a bare single-shot run = a 1-turn conversation). Interactive sessions open one conversation up-front and pass its id here on every turn, grouping the whole chat under one conversation.
Inherited from
Section titled “Inherited from”costUsd?
Section titled “costUsd?”
optionalcostUsd?:number
Defined in: packages/core/src/history/historyStore.ts:96
Estimated cost in USD, when known.
Inherited from
Section titled “Inherited from”durationMs?
Section titled “durationMs?”
optionaldurationMs?:number
Defined in: packages/core/src/history/historyStore.ts:100
Wall-clock duration of the run in milliseconds, when known.
Inherited from
Section titled “Inherited from”id:
number
Defined in: packages/core/src/history/historyStore.ts:105
model?
Section titled “model?”
optionalmodel?:string
Defined in: packages/core/src/history/historyStore.ts:86
Human-readable model/provider label.
Inherited from
Section titled “Inherited from”origin?
Section titled “origin?”
optionalorigin?:string
Defined in: packages/core/src/history/historyStore.ts:84
GS2-106 — the fan-out surface that started this run (batch, eval, gth-batch, workflow),
omitted for a direct run. Like threadId, written only when this record opens its own
fresh conversation.
Inherited from
Section titled “Inherited from”project?
Section titled “project?”
optionalproject?:string
Defined in: packages/core/src/history/historyStore.ts:76
The PROJECT ROOT the turn was recorded under — every write site fills this from
getProjectDir(), which is the discovered config root when discovery matched above the
session, the --config override’s own directory when one was given, and the working directory
only when neither applied.
It is not where the user was, and the two coincide only in the common case: a session opened in a subdirectory of a configured project records the PARENT. Nothing may render this value under a phrase that places the session in it, and the row carries no second path to recover the working directory from.
Inherited from
Section titled “Inherited from”prompt?
Section titled “prompt?”
optionalprompt?:string
Defined in: packages/core/src/history/historyStore.ts:88
The user prompt / source that started the run (full-text indexed).
Inherited from
Section titled “Inherited from”response?
Section titled “response?”
optionalresponse?:string
Defined in: packages/core/src/history/historyStore.ts:90
The final assistant response text (full-text indexed).
Inherited from
Section titled “Inherited from”snippet
Section titled “snippet”snippet:
string
Defined in: packages/core/src/history/historyStore.ts:108
FTS5 snippet around the match (may be empty).
threadId?
Section titled “threadId?”
optionalthreadId?:string
Defined in: packages/core/src/history/historyStore.ts:62
GS2-106 — the LangGraph thread a single-shot run checkpointed under. Used ONLY when this record
opens its own fresh conversation (no conversationId), and written onto that new row, so
the run’s durable state is linked to the conversation it belongs to in the same transaction
that creates the row. Ignored when conversationId is given: an existing conversation already
carries its own link, and a turn must never move it.
Inherited from
Section titled “Inherited from”tokensInput?
Section titled “tokensInput?”
optionaltokensInput?:number
Defined in: packages/core/src/history/historyStore.ts:92
Prompt/input token count, when known.
Inherited from
Section titled “Inherited from”tokensOutput?
Section titled “tokensOutput?”
optionaltokensOutput?:number
Defined in: packages/core/src/history/historyStore.ts:94
Completion/output token count, when known.
Inherited from
Section titled “Inherited from”tools?
Section titled “tools?”
optionaltools?:string[]
Defined in: packages/core/src/history/historyStore.ts:98
Names of tools invoked during the run, when known.
Inherited from
Section titled “Inherited from”ts:
string
Defined in: packages/core/src/history/historyStore.ts:106
ISO-8601 timestamp; defaults to now when omitted.