Commit Graph
2 Commits
Author SHA1 Message Date
yetoneandliubing 9935119f1d sessions: search finds Cursor and OpenCode sessions read from their stores, and a Cursor chat's system prompt isn't shown as said (#1743)
Follow-up to liubing's #1743 patch, which put cursor and opencode in
HasTranscript. That moved their search from magpie's recorded
transcript to SearchSession, whose byte prefilter (mayHold) reads
s.Path. For these agents s.Path isn't the conversation:
- OpenCode's JSON storage: the session info file, without messages,
  so every word missed;
- OpenCode's and Cursor's SQLite stores: the newest pages are in the
  -wal, so a live chat's latest turns missed.
linesFile now skips the prefilter for them (a Cursor .jsonl still
gets it).

cursorTranscript also handed the CLI store's system message ("You
are a coding agent.") to the transcript as a said part; system
messages are skipped, as the listing already does.

The patch's tests commit left TestSearchSessionWithoutATranscript
red (it used cursor as the agent without a transcript; now gemini).
sessions-empty-range.test.cjs runs in every language, de at 420px.

Run: go test -tags nogui -count=1 ./internal/sessions/ ok, and -race
ok; sessions-empty-range 10/10 (Chromium+WebKit, en zh zh-TW ja de);
sessions-today/overview/toolbar/search/manage/calendar-fill/paging
GUI tests pass.
Broken by hand: prefilter always on -> TestSearchOpenCodeFiles and
TestSearchCursorLiveChat red; system skip removed ->
TestSearchCursorLiveChat red. Also broke the patch itself: editor
files not appended, readOnly Delete guard, stats message dates, CLI
dedupe, HasTranscript entries, parseCursor readOnly dispatch, and
the "All sessions" button (via MAGPIE_TEST_APP_JS); each went red.

Co-authored-by: liubing <lb0806@foxmail.com>
2026-10-13 06:43:50 +08:00
liubing 1cd8140047 sessions: read Cursor editor history and Cursor/OpenCode conversations (#1743)
Discover editor project transcripts and cursorDiskKV histories without modifying the source. Share one SQLite/WAL snapshot across a scan, refresh metadata changes, deduplicate CLI histories, and reject deletion of read-only sessions.

Count message-only sessions and expose an all-dates action when a filter hides existing history. Read Cursor CLI text, reasoning and tool parts, and OpenCode v1/v2 transcripts through the existing transcript API.
2026-10-13 06:43:50 +08:00