Repository navigation
chore(agent): drop noteChat and Mem0 leftovers now that the API has no memory - #2630
Merged
Merged
Conversation
openwhispr-api#243 removed assistant memory, so the noteChat flag added for #2551 (openwhispr-api#249) no longer changes anything server-side. Drop it from the note chat hook, ReasoningService, the preload type and the main-process request body. The API still accepts the field as optional, so not sending it is safe on every API version. Tests now pin that no cloud request carries noteChat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mments CLAUDE.md said note chat requests made the API file Mem0 memories under a past-conversations heading. The API now keeps no memory and sends the client's system prompt as-is. The memoryEnabled policy field stays, since older API versions may still send it, but its comment now says the API retired it and the app ignores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
greatcoat
marked this pull request as ready for review
October 12, 2026 22:12
ReasoningService builds the streamFromIPC options as an explicit object, so checking that noteChat is absent could only fail if that one key came back. Pin the full key set instead, which also catches any other stray flag a caller passes.
Chadpiha
approved these changes
Oct 20, 2026
Chadpiha
left a comment
Collaborator
There was a problem hiding this comment.
Approving. Removing noteChat is safe on every API version, and every path I traced behaves the same as before.
What I checked
- API #243 (
29b7b79) is on API main and in the latest Production deploy.agentStreamSchemastill acceptsnoteChat, doesn't use it, and quietly drops unknown fields. So both older desktops that still send the flag and this build work. - Nothing in
src/,main.js,preload.jsorscripts/sets or readsnoteChatanymore.preload.jspasses opts through unchanged, as you said. - On Cloud, note chat still skips the up-front library search. That depends on
openNoteRef(useChatStreaming.ts:496), not on the flag. The open note, tools andscreenContextare all still sent. BYOK/local, whole-note actions, ChatView, the assistant panel and the onboarding demo all run through the same unchanged path. - The admin console already dropped the memory switch (#21), and mobile never sent
noteChator readmemoryEnabled. - The changed tests fail against the old source (1 + 2 + 1) and pass on this branch merged into current main.
tsc, ESLint and Prettier are clean. On the full suite, PR+main and plain main fail the same tests, all because the local better-sqlite3 build targets the wrong ABI.
Nits, none blocking
test/services/reasoningServiceStreamingThink.test.js— "a cloud stream never tells main it is a note chat":ReasoningServicebuilds thestreamFromIPCopts as an explicit{ systemPrompt, tools, screenContext }, so this can only fail if someone typesnoteChat: config.noteChatback in. Its "caller built before the API dropped memory" doesn't exist either;useChatStreamingis the only caller. Pinning the key set (deepEqual(Object.keys(opts).sort(), ["screenContext", "systemPrompt", "tools"])) would catch any stray flag.test/hooks/noteEditSurfaces.test.js:247: the assertion now also runs for BYOK, wherenoteChatnever existed, so that half always passes. It does no harm.CLAUDE.md§17: I'd drop "(thenoteChatflag went once openwhispr-api#243 removed memory)". The section describes how things work now, not their history.- PR description: between #249 and #243,
noteChatalso skipped saving the turn to Mem0 (useMemories && !noteChat), so the flag did more than change the heading. This only matters for a self-hosted or preview API still running that range. There, this build would start saving note-chat turns to Mem0 again. Production isn't affected. - Nothing tests the
/api/agent/streambody thatipcHandlers.jsbuilds, so the one-line removal there has no test. Not worth holding the PR for.
Optional: nothing in the desktop reads memoryEnabled now, so you could delete the field outright instead of rewording its comment. Keeping it is fine too.
…-memory-leftovers
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.
Problem
https://github.com/OpenWhispr/openwhispr-api/pull/243 removed assistant memory:
/api/agent/streamno longer reads or writes Mem0, and thememoryEnabledpolicy flag was retired. The desktop still carried the leftovers:noteChat: trueon every OpenWhispr Cloud request. It existed only so the API would label retrieved memories as past conversations (In-note chat returns results from other notes instead of the current note #2551, https://github.com/OpenWhispr/openwhispr-api/pull/249). With no memory, it does nothing. It was threaded through the chat hook,ReasoningService, the preload type and the main-process request body.CLAUDE.md§17 still said the API puts the note chat's Mem0 memories under a past-conversations heading.memoryEnabledcomment insrc/types/policy.tsdescribed a gate the API no longer has.Change
noteChatend to end:useChatStreaming.ts(and its memory comment),ReasoningService(three option types plus the forward to IPC),src/types/electron.ts(startAgentStreamopts), and the/api/agent/streambody inipcHandlers.js.preload.jspasses the opts object through unchanged, so it needed no edit.CLAUDE.md§17: note chat requests are ordinary agent requests. The API keeps no memory and adds nothing to the prompt, so the client's own system prompt is what the model sees.src/types/policy.ts: keepmemoryEnabled, and change its comment to say the API retired it in openwhispr-api#243, older API versions may still send it, and the app ignores it. Nothing in the desktop reads the field, and policy validation already allows it.The note chat still skips the up-front library search. That depends on
openNoteRef, not onnoteChat, and is unchanged.Tests
useChatStreamingTools(note chat), two cloud cases innoteEditSurfaces, andreasoningServiceStreamingThink.noteChat: not from the note chat hook, not from the shared edit surfaces, and not fromReasoningServiceeven when an old caller still passes it. The old "tells main it is a note chat" test is replaced by its opposite.memoryEnabledstays, with its comment updated.tsc --noEmitis clean. Prettier and ESLint are clean on the touched files.npm test: 7761 tests, 7327 passed, 4 failed, 429 skipped, 1 todo. The 4 failures are innoteEditorSummaryDeletionandnoteCreateReconciliation, which don't touch this code. Those two files give the same result with and without this change. The skips are the usual local Electron-ABI and native-module skips.Compatibility
noteChat, so dropping it changes nothing.lib/schemas.tsdeclaresnoteChat: z.boolean().nullish(), so a request without it is valid on every version. Between feat: migrate streaming transcription from AssemblyAI to Deepgram #249 and Randomly get "no audio detected" #243, leaving it out only meant memories, if any, appeared under the general heading instead of the past-conversations one. Before feat: migrate streaming transcription from AssemblyAI to Deepgram #249 the field did not exist.memoryEnabled: the optional type field stays, so policy payloads from older APIs that still send it keep validating.🤖 Generated with Claude Code