feat(cursor): sync local conversation history to Cursor transcripts

Project sidecar context history into Cursor-compatible JSONL transcripts so previous conversations remain readable when referenced from new chats. Backfill existing sessions on startup and preserve Cursor-managed turn status entries during atomic updates.
This commit is contained in:
DedSecer
2026-08-01 21:08:14 +08:00
parent 00f52166b2
commit 68e63c7a72
6 changed files with 749 additions and 1 deletions
+6
View File
@@ -302,6 +302,7 @@ func NewService(historyRoot string, resolver modeladapter.ChannelResolver) *Serv
appendSeq: newAppendSequenceTracker(),
}
service.startHistoryMaintenance()
store.SyncAllCursorTranscriptsBestEffort()
return service
}
@@ -691,6 +692,11 @@ func (service *Service) handleRunIntent(intent InboundIntent) error {
if err != nil {
return err
}
if intent.RequestContext != nil {
if folder := normalizeAgentTranscriptsFolder(intent.RequestContext.GetEnv().GetAgentTranscriptsFolder()); folder != "" {
conversation.AgentTranscriptsFolder = folder
}
}
rewindDecision := service.decideRunRewind(intent, conversation)
if rewindDecision.Evaluated && !rewindDecision.Apply {
service.logRunRewindDecision(intent.RequestID, intent.ConversationID, "rewind_skipped", rewindDecision)