fix(chat): prevent session transcript/plan prefix collisions - #135
Draft
cursor[bot] wants to merge 3 commits into
Draft
fix(chat): prevent session transcript/plan prefix collisions#135cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
Prevent list_transcript_files and list_plan_files from treating
prefix-sibling keys (s1 vs s10) as the same session when scanning
dated {session_key}-{date} files. Align desktop recent-plan filter
and add regression tests.
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Record validation evidence, mark TASK-2026-071 done on the board, and apply rustfmt to the plan listing change. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_transcript_filesmatched dated transcript names with barestarts_with(session_key), so sessions1also loadeds10-*.jsonl(same class forschedule-1vsschedule-10).list_plan_filesand the desktop recent-plan fallback scan.Bug and Impact
{key}-YYYY-MM-DD.jsonlpresent for both.chat_historytool can leak sibling-session messages into the LLM context and return wrong user-facing history; plan listing can surface the wrong session's plans.{session_key}-; the executor path used by the agent did not.Root Cause
Filename convention is
{session_key}-{date}.jsonl, but matching usedname.starts_with(session_key)without requiring the-boundary after the key.Fix
format!("{}-", session_key)(keep legacy exact{session_key}.jsonl).session_keyor{session_key}-….Task Linkage
TASK-2026-071tasks/TASK-2026-071-session-transcript-prefix-match/Injected Specs
spec/verification-integrity.mdspec/task-artifact-language.mdspec/architecture-boundaries.mdspec/rust-conventions.mdspec/testing-policy.mdspec/docs-sync.md(N/A: fail-closed matching only; no docs/env/command surface change)Validation Evidence
cargo test -p skilllite-executor --lib rejects_prefix_sibling_session_keys→2 passedcargo test -p skilllite-executor --lib→6 passedcargo clippy -p skilllite-executor --all-targets -- -D warnings→ cleanpython3 scripts/validate_tasks.py→71 task folders checkedpasseds1listing excludess10-*.jsonl;schedule-1excludesschedule-10-*s1.jsonl/ exact plan stems still includedRegression Scope
chat_historydefaultdedupe_keyUNIQUE reuse afterexecuted(follow-up finding, not in this PR)Docs Sync (EN/ZH)
Review Checklist
tasks/TASK-2026-071-session-transcript-prefix-match/TASK.mdsatisfiedSTATUS.mdupdated with validation evidenceREVIEW.mdincludes merge readiness decisiontasks/board.mdstatus is up to date