MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / materializeSessionFile

Method materializeSessionFile

src/utils/sessionStorage.ts:1022–1037  ·  view source on GitHub ↗

* Create the session file, write cached startup metadata, and flush * buffered entries. Called on the first user/assistant message.

()

Source from the content-addressed store, hash-verified

1020 * buffered entries. Called on the first user/assistant message.
1021 */
1022 private async materializeSessionFile(): Promise<void> {
1023 // Guard here too — reAppendSessionMetadata writes via appendEntryToFile
1024 // (not appendEntry) so it would bypass the per-entry persistence check
1025 // and create a metadata-only file despite --no-session-persistence.
1026 if (this.shouldSkipPersistence()) return
1027 this.ensureCurrentSessionFile()
1028 // mode/agentSetting are cache-only pre-materialization; write them now.
1029 this.reAppendSessionMetadata()
1030 if (this.pendingEntries.length > 0) {
1031 const buffered = this.pendingEntries
1032 this.pendingEntries = []
1033 for (const entry of buffered) {
1034 await this.appendEntry(entry)
1035 }
1036 }
1037 }
1038
1039 async insertMessageChain(
1040 messages: Transcript,

Callers 1

insertMessageChainMethod · 0.95

Calls 4

shouldSkipPersistenceMethod · 0.95
appendEntryMethod · 0.95

Tested by

no test coverage detected