You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After every message, currentSessionID is set to null in the finally blocks of both handleMessage() and handleCustomCommand(). This causes each user message to create a brand new session with zero conversation history.
finally{isOperationInProgress=falsecurrentSessionID=null// ← SAME BUG}
Evidence
Token count drops from 51.7k to 25.8k between messages (no history loaded)
Session.createNext() is called every message instead of reusing the session
MessageV2.filterCompacted(MessageV2.stream(sessionID)) returns empty history for new sessions
Fix
Delete both currentSessionID = null lines. The session ID should persist across the REPL loop. It's already properly reset when the user runs /new (line ~275).
Acceptance Criteria
Conversation context preserved across multiple messages
Bug
After every message,
currentSessionIDis set tonullin thefinallyblocks of bothhandleMessage()andhandleCustomCommand(). This causes each user message to create a brand new session with zero conversation history.Reproduction
Root Cause
File:
packages/opencode/src/cli/lite/index.tsLine ~540 (handleMessage finally block):
Line ~455 (handleCustomCommand finally block):
Evidence
Session.createNext()is called every message instead of reusing the sessionMessageV2.filterCompacted(MessageV2.stream(sessionID))returns empty history for new sessionsFix
Delete both
currentSessionID = nulllines. The session ID should persist across the REPL loop. It's already properly reset when the user runs/new(line ~275).Acceptance Criteria
/newcommand still creates a fresh sessionbun run typecheckpassesbun testpasses