Skip to content

fix(memory): say beliefs are still building instead of showing an empty memory (#6718) - #7014

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
CodeGhost21:fix/6718-memory-deriving
Oct 6, 2026
Merged

senamakel merged 2 commits into
tinyhumansai:mainfrom
CodeGhost21:fix/6718-memory-deriving

Conversation

@CodeGhost21

@CodeGhost21 CodeGhost21 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • An empty Learnings list no longer reads as "no memory" while beliefs are being built. If the list is empty and a build_beliefs job is pending, the tab says memory is still building beliefs from recent conversations and that they appear after the next background run. Translated into all 14 locales.
  • The job queue is read only when the list is empty. If that read fails, the tab keeps the plain empty state.
  • Also fixes a prettier violation I left on main in fix(memory): tell a credit refusal and an outage apart from an empty memory (#6718) #7013 (memoryApi.test.ts). The pre-push format check catches it on every branch cut from main.

Problem

#6718 asks that a read during the enrichment window shows as "still deriving", never "no memory". On memory v2, explicit writes are visible as soon as they return (MemoryEngine::store waits for WaitFor::Visible), so learnings, documents and turns do not lag. Only beliefs do: a queued build_beliefs job runs at least [memory.recall] build_delay_secs (default 300 s) behind the writes, on the 5-minute memory_background cron. Until it runs, the Learnings tab showed "No learnings yet".

Solution

  • MemoryLearningsTab: when items is loaded and empty, call memoryJobsList() once and check for a pending build_beliefs job. If there is one, render memoryPage.learnings.deriving (data-testid="memory-learnings-deriving"); otherwise render the existing empty state.
  • docs/specs/memory-v2.md (UI): records that only beliefs lag, and what the empty state says while they do.
  • Agent turns are unaffected. The pack already reads learnings and turns, which are visible on write, and beliefs only add to it.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy: pending build shows the deriving state; only other jobs pending, or a failed queue read, keeps the empty state; the queue is not read when learnings exist
  • Diff coverage ≥ 80%: not measured locally. Every new branch in the component has a test; CI's diff-cover is the gate.
  • N/A: behaviour-only change. Row 8.2.10 already cites app/src/components/memory/*.test.tsx.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • N/A: no release-cut surface changes
  • N/A: part of a larger tracking issue that stays open (see Related)

Impact

  • Desktop Memory UI only. No core, RPC, config or migration changes.
  • One extra memory_jobs_list call when the Learnings list is empty.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: fix/6718-memory-deriving
  • Commit SHA: see the branch head

Validation Run

  • pnpm --filter openhuman-app format:check: passed in the pre-push hook
  • pnpm typecheck: tsc --noEmit clean
  • Focused tests: vitest run src/components/memory src/lib/i18n: 190 passed
  • Rust fmt/check (if changed): N/A, no Rust changes
  • Tauri fmt/check (if changed): N/A, pre-push hook's app clippy passed

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: an empty Learnings list with a pending belief build says beliefs are still being built.
  • User-visible effect: the "No learnings yet" text is replaced while a build is pending.

Parity Contract

  • Legacy behavior preserved: the empty state is unchanged when nothing is pending or the queue cannot be read; a non-empty list is unchanged.
  • Guard/fallback/dispatch parity checks: the MemoryLearningsTab.test.tsx cases above.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: N/A
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features
    • The Memory learnings page now explains when beliefs are still being built from recent conversations and when they’re expected to appear. This message is available in 15 languages.
  • Documentation
    • Clarified that new memory entries may take time to appear while background processing builds beliefs.

…ty memory (tinyhumansai#6718)

Explicit writes are visible on return, but beliefs are built by a queued
job at least build_delay_secs behind them. An empty Learnings list while a
build_beliefs job was pending read as "No learnings yet". It now says
beliefs are still being built, in all 14 locales. The job queue is read only
when the list is empty, and a failed read keeps the plain empty state.
@tinysweeper

tinysweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 3 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Reviewing pending checks
Priority: medium
Reviewed head: 3d23a5cdccc7
Updated: 1791236458 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 15 Active findings 3
Tests 2 Noted findings 0
Documentation 1 Resolved findings 0
Configuration 0 Pending checks/questions 4

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

  • medium · critique · Translate learnings consistently as acquired knowledge — The surrounding French strings translate `learnings` as `acquis`, but this message calls them `croyances` (“beliefs”). That changes the meaning of the memory feature and can mislea (app/src/lib/i18n/fr\.ts:5128)
  • medium · security · Refresh the belief-build status while the empty state is shown — This effect performs a single queue read when the list is empty. If a belief-build job is pending at that moment, `buildsPending` remains `true` after the job completes, so the com (app/src/components/memory/MemoryLearningsTab\.tsx:81)
  • medium · e2e · Cover the deriving state on the memory learnings screen end to end — The new external surface is a screen state a user reaches: open the memory page's learnings tab with an empty list while a `build_beliefs` job is queued, and instead of 'no learnin (app/src/components/memory/MemoryLearningsTab\.tsx:78)

Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)

Before merge

  • Wait for Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS).

How this fits together

flowchart LR
  n0["TranslationMap"]:::impacted
  n1["en"]:::impacted
  n2["german"]:::impacted
  n3["missingKeys"]:::impacted
  n1 -->|uses| n0
  n3 -->|uses| n2
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 18 files; 1 finding. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: app/src/lib/i18n/fr\.ts — Translate learnings consistently as acquired knowledge

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 17 files; 1 finding. 1 file was not security-reviewed: docs/specs/memory-v2.md (prose or tabular data). _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: app/src/components/memory/MemoryLearningsTab\.tsx — Refresh the belief-build status while the empty state is shown

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change swaps the learnings empty state for a "still building" message when a build_beliefs job is pending, and the tests pin that behavior well: pending-build shows the deriving state, other jobs or a failed jobs read keep the plain empty state, and the queue is not consulted when the list is non-empty. Translations for all locales are added with no placeholders to break. Nothing found to fix; safe to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The description accurately matches the diff: MemoryLearningsTab checks the job queue only when the list is empty, shows a new translated 'deriving' state when a build_beliefs job is pending, falls back to the plain empty state on failure, docs are updated, and the prettier fix is as described. Tests cover the stated cases. Looks sound to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: This change adds a user-visible 'still building beliefs' state to the memory learnings tab, driven by a new memoryJobsList call, with translations in every locale and unit tests. The e2e candidates are lexical noise; no end-to-end spec drives the memory learnings screen, so the new screen state and its RPC dependency are uncovered end to end. Otherwise the change looks sound. Waiting on end-to-end jobs: `Rust E2E (mock backend)`, `Build Playwright E2E Artifact`, `E2E (Playwright / web lane)`, `Desktop E2E (full suite, 3 OS)`.
  • Unresolved questions/checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)
  • Evidence: app/src/components/memory/MemoryLearningsTab\.tsx — Cover the deriving state on the memory learnings screen end to end
Evidence and run details
  • Models: gpt-5.6-luna, glm-5.3-flash
  • Spend: $0.004092
  • Tokens: 303675 input · 16883 output · 34059 cached · 0 embedding
Head State Pass summary
3d23a5cdccc7 pending 3 active finding(s), 0 resolved finding(s) (at 1791236458)

tinysweeper 0.1.0

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
gitbooks/developing/architecture/frontend.md — auto-discovered
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be55613b-abdf-4783-a5a7-fffe46d47406
📥 Commits

Reviewing files that changed from the base of the PR and between 17082cc and 3d23a5c.

📒 Files selected for processing (18)
  • app/src/components/memory/MemoryLearningsTab.test.tsx
  • app/src/components/memory/MemoryLearningsTab.tsx
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/zh-CN.ts
  • app/src/services/api/memoryApi.test.ts
  • docs/specs/memory-v2.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

When the learnings list is empty, the tab checks for a pending build_beliefs job and displays a deriving message if one exists. The change adds tests for queue responses and translations in 15 locales, and updates the memory specification.

Changes

Pending belief build state

Layer / File(s) Summary
Empty-list job check and deriving state
app/src/components/memory/MemoryLearningsTab.tsx, app/src/components/memory/MemoryLearningsTab.test.tsx, app/src/lib/i18n/*.ts, docs/specs/memory-v2.md, app/src/services/api/memoryApi.test.ts
When the learning list is empty, the tab checks for a pending build_beliefs job and shows the deriving message if found. Tests cover other pending jobs, queue-read failures, and non-empty lists. Translations and the specification describe the state. The API test assertion was reformatted without changing its expected value.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: senamakel

Merge Risk: 🔵 Low · up to 3d23a

The Learnings tab can continue saying beliefs are being built after the job finishes. Switching tabs and back refreshes the view; this is a bounded UI risk rather than a merge blocker.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (3 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: show that beliefs are still building instead of showing the empty-memory state.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (3 skipped: 1 unsupported, 2 too large.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the job queue bright,
Beliefs are building out of sight.
The empty list can wait a while,
A pending job explains the file.
New words bloom in every tongue,
Then learnings greet the morning sun.

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

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

             $0.0041 · 303,675 in / 16,883 out · 34,059 cached (11%) · gpt-5.6-luna, glm-5.3-flash
critique:    $0.0019 · 150,679 in / 9,137 out  · 24,507 cached (16%) · gpt-5.6-luna, glm-5.3-flash
security:    $0.0014 · 112,659 in / 5,077 out  · 9,360 cached (8%)   · gpt-5.6-luna
tests:       $0.0004 · 9,715 in   / 392 out    · 0 cached (0%)       · glm-5.3-flash
description: $0.0001 · 10,107 in  / 131 out    · 64 cached (1%)      · glm-5.3-flash
e2e:         $0.0001 · 11,685 in  / 482 out    · 64 cached (1%)      · glm-5.3-flash

Comment thread app/src/lib/i18n/fr.ts
Comment on lines +5128 to +5129
'memoryPage.learnings.deriving':
"Rien pour l'instant. La mémoire construit encore des croyances à partir de vos conversations récentes ; elles apparaîtront ici après la prochaine exécution en arrière-plan.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Translate learnings consistently as acquired knowledge

The surrounding French strings translate learnings as acquis, but this message calls them croyances (“beliefs”). That changes the meaning of the memory feature and can mislead French-speaking users about what the background process produces. Use the same “acquis” terminology as the rest of this section.

Suggested change
'memoryPage.learnings.deriving':
"Rien pour l'instant. La mémoire construit encore des croyances à partir de vos conversations récentes ; elles apparaîtront ici après la prochaine exécution en arrière-plan.",
'memoryPage.learnings.deriving':
"Rien pour l'instant. La mémoire construit encore des acquis à partir de vos conversations récentes ; ils apparaîtront ici après la prochaine exécution en arrière-plan.",

[RULE] translation-meaning ·

memoryJobsList()
.then(jobs => {
if (cancelled) return;
const pending = (jobs.pending ?? []).filter(job => job.job?.job === 'build_beliefs');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium security confident

Refresh the belief-build status while the empty state is shown

This effect performs a single queue read when the list is empty. If a belief-build job is pending at that moment, buildsPending remains true after the job completes, so the component can indefinitely display “still building beliefs” until the user remounts or reloads the view. Poll the job state or otherwise trigger a list/status refresh while this state is displayed.

[RULE] stale-state ·

useEffect(() => {
if (!empty) return;
let cancelled = false;
memoryJobsList()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium e2e likely

Cover the deriving state on the memory learnings screen end to end

The new external surface is a screen state a user reaches: open the memory page's learnings tab with an empty list while a build_beliefs job is queued, and instead of 'no learnings yet' the tab shows the 'deriving' message fetched via memoryJobsList (a new core RPC call from this component). No end-to-end spec reaches the memory learnings screen — the candidate matches in the harness are all unrelated uses of the word 'default' — and the Playwright/web and desktop lanes for this PR are still pending with no spec added. A mocked browser/desktop e2e spec (per the repo rule that frontend flows get specs under app/test/e2e/specs/, with the mock backend seeding a pending build_beliefs job) would drive: navigate to the learnings tab, assert memory-learnings-deriving renders and memory-learnings-empty does not, and assert the plain empty state when no such job is pending.

[RULE] e2e-uncovered ·

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants