@@ -213,6 +213,60 @@ describe("runDoctorSessionSqlite", () => {
213213 ) . toHaveLength ( 2 ) ;
214214 } ) ;
215215
216+ it ( "does not report SQLite markers as missing transcript files" , async ( ) => {
217+ const store = createLegacyStore ( ) ;
218+ fs . rmSync ( store . transcriptPath ) ;
219+ fs . rmSync ( store . trajectoryPath ) ;
220+ fs . writeFileSync (
221+ store . storePath ,
222+ JSON . stringify (
223+ {
224+ "agent:main:main" : {
225+ channel : "cli" ,
226+ chatType : "direct" ,
227+ sessionFile : `sqlite:main:session-1:${ store . storePath } ` ,
228+ sessionId : "session-1" ,
229+ sessionStartedAt : 1000 ,
230+ updatedAt : 2000 ,
231+ } ,
232+ } ,
233+ null ,
234+ 2 ,
235+ ) ,
236+ { mode : 0o600 } ,
237+ ) ;
238+
239+ const report = await runDoctorSessionSqlite ( {
240+ env : store . env ,
241+ mode : "import" ,
242+ store : store . storePath ,
243+ } ) ;
244+ const validation = await runDoctorSessionSqlite ( {
245+ env : store . env ,
246+ mode : "validate" ,
247+ store : store . storePath ,
248+ } ) ;
249+
250+ expect ( report . totals ) . toMatchObject ( {
251+ importedEntries : 1 ,
252+ importedTranscriptEvents : 0 ,
253+ issues : 0 ,
254+ sqliteEntries : 1 ,
255+ } ) ;
256+ expect ( validation . totals ) . toMatchObject ( {
257+ issues : 0 ,
258+ validatedEntries : 1 ,
259+ validatedTranscriptEvents : 0 ,
260+ } ) ;
261+ expect (
262+ loadExactSqliteSessionEntry ( {
263+ agentId : "main" ,
264+ sessionKey : "agent:main:main" ,
265+ storePath : store . storePath ,
266+ } ) ?. entry . sessionFile ,
267+ ) . toContain ( "sqlite:main:session-1:" ) ;
268+ } ) ;
269+
216270 it ( "validates missing SQLite rows without creating the agent database" , async ( ) => {
217271 const store = createLegacyStore ( ) ;
218272
0 commit comments