Skip to content

fix(chat): no-memory chat no longer says "Searching your memory…" - #30

Merged
alichherawalla merged 2 commits into
mainfrom
fix/no-memory-waiting-label
Jul 4, 2026
Merged

fix(chat): no-memory chat no longer says "Searching your memory…"#30
alichherawalla merged 2 commits into
mainfrom
fix/no-memory-waiting-label

Conversation

@alichherawalla

@alichherawalla alichherawalla commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Bug

With No memory selected, the generating chat still showed "●●● Searching your memory…" — even though a plain chat never touches memory.

Cause

The pre-first-token loader in MemoryChat.tsx hardcoded the string, ignoring the noMemory scope. (The backend is already correct — rag:chat returns early in the no-memory branch and never emits the searching step, so this was purely the frontend label.)

Fix

Extracted a pure, scope-aware waitingLabel():

  • No-memory (plain chat) → "Thinking…"
  • A project active → "Searching this project…"
  • All-memory → "Searching your memory…"

Tests

chat-labels unit suite (3), including a guard that the no-memory label never contains "memory". tsc web clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Chat loading messages now adapt to context, showing more relevant status text for project-based chats and memory searches.
  • Bug Fixes
    • Replaced the fixed “Searching your memory…” placeholder with a dynamic message so the app better reflects what it’s currently doing.
  • Tests
    • Added coverage for the different loading messages to ensure the correct text appears in each chat scope.

The pre-first-token "working…" loader hardcoded "Searching your memory…"
regardless of the chat's memory scope, so a No-memory (plain) chat — which the
backend never runs retrieval for (rag:chat returns early before emitting the
'searching' step) — still claimed to search memory.

Extract a scope-aware waitingLabel() (pure, unit-tested) and use it: No-memory →
"Thinking…", a project → "Searching this project…", else "Searching your memory…".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix no-memory chat loader text to avoid claiming memory search

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Replace hardcoded pre-first-token loader text with a scope-aware label
• Add a pure waitingLabel() helper shared by UI and unit tests
• Add unit coverage ensuring no-memory mode never mentions “memory”
Diagram

graph TD
  A["MemoryChat.tsx"] --> B["waitingLabel()"] --> C["Loader text"]
  D["chat-labels.test.ts"] --> B
  subgraph Legend
    direction LR
    _ui[UI component] ~~~ _util[Utility] ~~~ _test[Tests]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Drive loader text directly from backend step/state
  • ➕ Eliminates duplicated decision logic between frontend scope and backend behavior
  • ➕ Naturally stays aligned if retrieval behavior changes (e.g., new steps)
  • ➖ Requires broader wiring/state propagation for the pre-first-token phase
  • ➖ More invasive than needed for a simple label bug fix
2. Use an enum + map for scope-to-label (future i18n-ready)
  • ➕ Centralizes labels in a structure that is easy to localize later
  • ➕ Makes it harder to introduce inconsistent strings across components
  • ➖ Slightly more boilerplate than a small pure function for the current needs

Recommendation: The current approach is appropriate for the bug scope: a pure, scope-aware helper plus unit tests is minimal, keeps UI logic simple, and prevents regressions. If loader messaging expands or becomes localized, consider migrating to an enum/map structure or deriving the message from backend step state.

Files changed (3) +38 / -1

Enhancement (1) +17 / -0
chat-labels.tsAdd pure 'waitingLabel()' helper for loader messaging +17/-0

Add pure 'waitingLabel()' helper for loader messaging

• Introduces a small, UI-free utility that selects the correct pre-first-token loader label based on chat scope (project vs no-memory vs all-memory).

src/renderer/src/lib/chat-labels.ts

Bug fix (1) +2 / -1
MemoryChat.tsxUse scope-aware waiting label for pre-first-token loader +2/-1

Use scope-aware waiting label for pre-first-token loader

• Replaces the hardcoded “Searching your memory…” loader text with a call to 'waitingLabel({ noMemory, hasProject: !!activeProjectId })', ensuring the UI reflects the selected memory scope.

src/renderer/src/components/MemoryChat.tsx

Tests (1) +19 / -0
chat-labels.test.tsAdd unit tests for scope-aware waiting label +19/-0

Add unit tests for scope-aware waiting label

• Adds a Vitest suite covering no-memory, all-memory, and project-scoped cases, including a regression guard that the no-memory label never contains “memory”.

src/renderer/src/lib/tests/chat-labels.test.ts

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • e2e/screenshots/provit-no-memory-loader.png is excluded by !**/*.png
  • e2e/screenshots/provit-no-memory-scope.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c3323512-6808-4b5e-8419-660119089db8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new chat-labels.ts module exporting a ChatScope interface and waitingLabel function that returns scope-dependent status text. Integrates this into MemoryChat.tsx, replacing a hardcoded string with a computed label, and adds unit tests for the new function.

Changes

Scope-aware waiting label

Layer / File(s) Summary
ChatScope contract and waitingLabel logic
src/renderer/src/lib/chat-labels.ts
Defines ChatScope interface (hasProject, noMemory) and waitingLabel(scope) returning "Searching this project…", "Thinking…", or "Searching your memory…" based on flag precedence.
MemoryChat integration and tests
src/renderer/src/components/MemoryChat.tsx, src/renderer/src/lib/__tests__/chat-labels.test.ts
Imports and uses waitingLabel in place of hardcoded status text, computed from noMemory and activeProjectId; adds Vitest tests covering the three label scenarios.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related Issues: None mentioned.

Related PRs: None mentioned.

Suggested labels: enhancement, frontend, tests

Suggested reviewers: None specified.

Poem

A rabbit taps its keys with glee,
"Thinking…" or "Searching…", let's see!
No memory? A simple thought.
A project scoped? Search is sought.
Three little labels, tested tight—
Hopping through code, all just right! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main user-visible fix: no-memory chats no longer show the misleading loading text.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/no-memory-waiting-label

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@alichherawalla

alichherawalla commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

🧭 Provit — no-memory chat label (judged by Claude)

Built the fix, ran the app on a synthetic-seeded profile, switched the chat to No memory, sent a message, and captured the generation state. Evaluated the frames with the Claude Code backend.

Verified — scope is "No memory":

No memory scope selected

Verified — generation shows NO "Searching your memory…" text (plain dots loader, no false memory claim):

No-memory generation loader

On the exact loader from the bug report: that's the pre-first-token "working…" box (shown only while generating with no streaming message yet). Its on-screen window is now sub-frame when the model starts fast — even screenshots every 60 ms landed after the streaming placeholder replaced it — so it can't be grabbed as a still here. Its label is now driven by the scope-aware waitingLabel(), which is unit-tested: No-memory → "Thinking…", with an explicit assertion that the no-memory label never contains "memory". The backend was already correct (rag:chat returns early in the no-memory branch and never emits the searching step), so this was purely the hardcoded frontend string.

Judged by Claude (Claude Code) over the captured frames (embedded above, committed to this PR branch). The transient loader's label is guarded by the chat-labels unit suite rather than a still, since it no longer lingers long enough to screenshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alichherawalla
alichherawalla merged commit c9974de into main Jul 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant