Implement the following plan: Remove Session Persistence (Conversation History) Context…
- User
Implement the following plan:
Remove Session Persistence (Conversation History)
Context
The session persistence feature saves all conversation messages to JSON files in
.reef/and allows restoring previous sessions. The user finds this feature more harmful than helpful and wants it removed entirely. This simplifies the app flow by eliminating the session-select screen and all disk I/O for message history.What Gets Removed
- Disk persistence: No more saving/loading
.reef/{uuid}.jsonfiles - Session select screen: No more choosing between "New Session" / existing sessions
- Cross-engine context injection: No more
formatSessionContext()prepending old messages when switching engines onMessagesChangecallback chain: The pipeline that propagated message changes from React state →updateSessionMessages()→saveSession()→ disk
What Stays
- ACP session ID (
conn.sessionId): Required by the protocol — comes from the connection, not our persistence - In-memory message state: React state in
useSessionStorestill tracks messages for the current session's UI Sessiontype: Removed entirely — no longer neededsession-selectscreen variant: Removed from theScreentype
Files to Modify
1.
src/types.ts- Remove
'session-select'from theScreenunion type - Remove the
Sessioninterface entirely
2.
src/session-manager.ts— Delete file- All functions (
listSessions,loadSession,saveSession,createSession,formatSessionContext,updateSessionMessages,ensureDataDir) are no longer needed
3.
src/components/SessionSelect.tsx— Delete file- Entire component is no longer needed
4.
src/components/App.tsx- Remove imports:
createSession, from session-manager, , type
- Disk persistence: No more saving/loading
Assistant
I'll start by reading all the files that need to be modified in parallel.
Assistant
Now I have a clear picture. Let me implement all changes. Steps 1-3 are independent so I'll do them in parallel.
Assistant
Now let me update Chat.tsx and App.tsx.
Assistant
Now let me check if there are any other files referencing the deleted modules or the
Sessiontype.Assistant
No remaining references to
session-manager,SessionSelect, or theSessiontype (all matches are unrelated —RecordingSession, ACPnewSession, etc.). Let me run the type check.Assistant
The test file errors (
Chat.test.tsxmissingonSwitchEngine,availableModels, etc.,PromptInput.test.tsxmissingworkdir, andmarkdown.tsxtype issues) are all pre-existing — none are related to my changes. Let me verify by checking ifChat.test.tsxstill referencessessionoronSessionUpdate.Assistant
Good —
Chat.test.tsxonly usessessionId(the ACP session ID string prop), not theSessionobject oronSessionUpdate. The missing-props errors there are pre-existing issues unrelated to this change.Let me also run the tests to confirm no new failures.
Assistant
All 21 test failures are pre-existing — none are related to my changes. They're from
EngineSelect.test.tsx(async engine checking),StatusBar.test.tsx(UI text mismatch),ModelSelect.test.tsx(arrow navigation),Chat.test.tsx(missing props that were already missing),PromptInput.test.tsx(missingworkdirprop), andApp.test.tsx(async rendering issues). These were all failing before this change.Here's a summary of what was done:
Deleted files:
src/session-manager.ts— all persistence functions removedsrc/components/SessionSelect.tsx— session select screen removed
Modified files:
src/types.ts— removed'session-select'fromScreenunion, removedSessioninterface- — removed interface, / params, and the effect that tracked message changes. Simplified signature to just
- User
rode o code reviwer agent; teste e passe um pente fino mesmo para ter a garantia que está 100% correto
Assistant
O review foi bastante completo. Resumo:
Nenhum erro novo de TypeScript ou teste foi introduzido — todos os 15 falhas e erros de tipo são pré-existentes.
O reviewer encontrou alguns pontos que devo corrigir:
CLAUDE.mdainda documenta osession-manager.tsdeletado e a persistência em.reef/sessions/README.mdainda documenta sessões persistentes, cross-engine memory, etc.availableModelsno dependency array dohandleSubmitemChat.tsx— nunca usado no corpo do callback (resquício)
Vou corrigir esses pontos agora.
Assistant
Agora vou rodar o type check final para confirmar que nada quebrou.
Assistant
availableModelsis now unused in Chat.tsx since I removed it from the dependency array. Let me remove it from the destructured props too.Assistant
Let me check if
availableModelsis used anywhere in the Chat component body or if it's just passed through.Assistant
It's only in the interface and destructuring — never used. Let me also check if App.tsx passes it.
Assistant
availableModelsis still used in App.tsx forModelSelect(line 189) and passed toChat(line 173). Since it's truly unused inside Chat, I'll remove it from the Chat interface and the App call site.Assistant
Those remaining lines are just the tail of
markdown.tsxerrors (missing file path due to multi-line output). Let me verify with a count.Assistant
Zero new TypeScript errors. All
error TSlines come exclusively from the pre-existing files (markdown.tsx,Chat.test.tsx,PromptInput.test.tsx).Tudo limpo. Resumo final:
Arquivos deletados:
src/session-manager.tssrc/components/SessionSelect.tsx
Arquivos modificados:
src/types.ts— removidoSessioninterface e'session-select'do unionScreensrc/hooks/useSessionStore.ts— simplificado parauseSessionStore(store), sem options/callbackssrc/components/Chat.tsx— removidosession,onSessionUpdate,availableModels(não era usado),contextInjectedRefe injeção de contexto cross-enginesrc/components/App.tsx— removido estadosession, handlers de sessão,SessionSelectimport, fluxo vai direto de engine-select para connectingCLAUDE.md— removidosession-manager.tsda arquitetura e referência a
- User
outra coisa que queria que vc investigasse... qnd eu dou o contexto de um arquivo com @ e o nome desse arquivo tem espaço ou caracter especial PARECE que a leitura não é feita
Assistant
Vou investigar como a referência
@a arquivos é processada no codebase.Assistant
A investigação foi muito clara. O bug está na regex
/@([^\s@]+)/gemimage-utils.ts— ela para no primeiro espaço. Vou agora lançar um agente de planejamento e depois escrever o plano.Assistant
Let me verify the exact code in the key files before finalizing the plan.
Assistant
Tudo confirmado. Vou escrever o plano final.
- User
[Request interrupted by user for tool use]