Repository navigation
fix(memory): say beliefs are still building instead of showing an empty memory (#6718) - #7014
Conversation
…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.
Tiny Sweeper reviewTiny 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 Review snapshot
Completeness: Complete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. Findings
Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS) Before merge
How this fits togetherflowchart 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
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (2)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (18)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughWhen the learnings list is empty, the tab checks for a pending ChangesPending belief build state
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🔵 Low · up to 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)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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.)
A rabbit checks the job queue bright, Comment |
There was a problem hiding this comment.
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
| '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.", |
There was a problem hiding this comment.
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.
| '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'); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 ·
Summary
build_beliefsjob 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.mainin 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 frommain.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::storewaits forWaitFor::Visible), so learnings, documents and turns do not lag. Only beliefs do: a queuedbuild_beliefsjob runs at least[memory.recall] build_delay_secs(default 300 s) behind the writes, on the 5-minutememory_backgroundcron. Until it runs, the Learnings tab showed "No learnings yet".Solution
MemoryLearningsTab: whenitemsis loaded and empty, callmemoryJobsList()once and check for a pendingbuild_beliefsjob. If there is one, rendermemoryPage.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.Submission Checklist
app/src/components/memory/*.test.tsx.## RelatedImpact
memory_jobs_listcall when the Learnings list is empty.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/6718-memory-derivingValidation Run
pnpm --filter openhuman-app format:check: passed in the pre-push hookpnpm typecheck:tsc --noEmitcleanvitest run src/components/memory src/lib/i18n: 190 passedValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
MemoryLearningsTab.test.tsxcases above.Duplicate / Superseded PR Handling
Summary by CodeRabbit