You reported potential "bleed through" between transcription sessions where operations might access the wrong transcript file.
Core Design:
- Each
TranscriptionSessionbinds to ONE specific transcript file TranscriptManagerstoresthis.outfileand ONLY reads/writes to that file- By default, unique timestamped filenames prevent collisions
- No possibility of cross-contamination between concurrent sessions
Problem:
case "stop_transcription": {
await session.stop();
// ❌ session variable still points to stopped session
return { success: true };
}Impact:
- After stopping,
get_transcript,get_status,clear_transcriptwould access OLD session data - User might see transcript from a previous stopped session
- Confusing behavior - stopped session should be cleared
Fix Applied:
case "stop_transcription": {
const statusBefore = session.getStatus();
const transcriptPath = session.getTranscriptPath();
await session.stop();
// ✅ Clear session reference
session = null;
return {
success: true,
note: "Transcript file remains on disk. Use cleanup_transcript to delete it."
};
}Problem:
case "get_transcript": {
if (!session) return error;
// ❌ Doesn't check if session.isRunning === true
return session.getTranscript();
}Impact:
- Could access data from stopped (but not cleared) sessions
- Resource
transcript://currentwould show old data
Fix Applied:
case "get_transcript": {
if (!session) {
return error("No active transcription session");
}
// ✅ Check if actually running
if (!session.getStatus().isRunning) {
return error("Session is not running. Use start_transcription to begin.");
}
return session.getTranscript();
}Problem:
if (uri === "transcript://current") {
if (!session) return error;
// ❌ Doesn't check isRunning
const content = readFile(session.getTranscriptPath());
}Fix Applied:
if (uri === "transcript://current") {
if (!session) {
return "No active transcription session";
}
// ✅ Check if actually running
if (!session.getStatus().isRunning) {
return "Session is not running. Use start_transcription to begin.";
}
const content = readFile(session.getTranscriptPath());
}src/mcp-server.ts- Added session state validation throughout
- ✅
stop_transcription- Now clears session reference - ✅
get_status- Validates session is running - ✅
get_transcript- Validates session is running - ✅
clear_transcript- Validates session is running - ✅
transcript://currentresource - Validates session is running
- Better error messages: "Use start_transcription to begin a new session"
stop_transcriptionnow includes note about transcript file remaining on disk- All operations return transcript file path for clarity
Test Suites: 13 passed, 13 total
Tests: 160 passed, 160 total
Existing Tests Validated:
- ✅ Session isolation tests (8 tests)
- ✅ All 160 tests pass with fixes applied
1. start_transcription → Creates session with unique file
2. get_transcript → ✅ Returns current session's transcript
3. stop_transcription → ✅ Stops AND clears session = null
4. get_transcript → ✅ Error: "No active transcription session"
5. start_transcription → ✅ Creates NEW session with NEW file
6. get_transcript → ✅ Returns NEW session's transcript
1. start_transcription → Session A with transcript_A.md
2. stop_transcription → Clears session, file remains on disk
3. cleanup_transcript → Error: "No active session"
4. start_transcription → Session B with transcript_B.md
5. cleanup_transcript → ✅ Deletes transcript_B.md only
1. start_transcription → Session 1, transcript_2025-10-04_10-00-00.md
2. get_transcript → ✅ Shows Session 1 data
3. stop_transcription → ✅ Clears session reference
4. start_transcription → Session 2, transcript_2025-10-04_10-05-00.md
5. get_transcript → ✅ Shows Session 2 data (NOT Session 1!)
- No Cross-Contamination: Each session ONLY accesses its own transcript file
- Clean Separation: Stopped sessions cannot be accessed
- Clear State: After stop, all operations require new start
- Unique Files: Each session gets timestamped filename by default
- Explicit Cleanup: User must explicitly call
cleanup_transcriptto delete files
-
Stop vs Cleanup:
stop_transcription- Ends session, keeps filecleanup_transcript- Deletes file permanently
-
Starting New Sessions:
- Always get new unique filename (auto-generated)
- Or specify custom filename if needed
-
Accessing Transcripts:
- Only works during active (running) session
- After stop, file remains but needs manual access
Before Fix:
- ❌ Confusing behavior after stop
- ❌ Could accidentally access old session data
- ❌ Unclear session state
After Fix:
- ✅ Crystal clear session lifecycle
- ✅ Impossible to access stopped session
- ✅ Better error messages guide user
- ✅ Each session fully isolated