Skip to content

fix(memory): say when the lessons list could not be loaded - #35413

Merged
RohanK6 merged 1 commit into
mainfrom
crew/conductor/lessons-load-error
Nov 12, 2026
Merged

RohanK6 merged 1 commit into
mainfrom
crew/conductor/lessons-load-error

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a lessons list that could not be read says so.

MemoryTab.tsx called loadLessons() with no catch on open, on refresh and after an Add. A failed GET /api/lessons left lessons empty, so the card showed "No lessons yet" over lessons that may exist, and the rejection went unhandled. After a stored Add, a failed re-read cleared the draft and left the old list with no notice.

Why it matters

"No lessons yet" tells the person their corrections are gone when only the read failed.

Not a goal

  • The delete and edit paths: they already title their own refresh failure, unchanged.

What changed (motivation → approach → change)

  • A lessonsLoadError notice (ErrorNotice, no agent hand-off, like its neighbours) is titled "Could not load the lessons" for an open or refresh read, and "Lesson added, but the list could not be refreshed" after a stored Add. A later successful read clears it.
  • The empty state is not drawn while that error stands over an empty list, and an open lesson editor stays shown under the notice.
  • Overlapping reads: only the newest read may set the list or the notice, so a slow older failure cannot land over a newer read that worked. The mount effect no longer duplicates the first read the refresh effect already does on mount.
  • Two new keys in en.manual.json and every catalog, plus en-XA.

Backwards compatibility

Compatible: no API change; one fewer duplicate GET /api/lessons on open.

Tests

New website/src/test/MemoryTabLessonsLoadError.test.tsx: a failed load shows the notice and not "No lessons yet"; a stored Add with a failed re-read says it was added; a later good read clears the notice; a slow older failure does not land over a newer good read; an open editor keeps its draft when a refresh then fails. The first three fail on main and pass here. All 8 test files that load MemoryTab pass (167 tests), with src/i18n (style and parity tests vs main), tsc, eslint, i18n:check and the restyle ratchet.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Rendered the real MemoryTab in Chromium with GET /api/lessons answering 500: before, the Lessons card shows the empty state; after, the error notice. English and German.

Screenshots / video

Before (en): Before, English: No lessons yet with no error

After (en): After, English: Could not load the lessons

Before (de): Before, German: Noch keine Lektionen with no error

After (de): After, German: Die Lektionen konnten nicht geladen werden

Related Issues

Fixes #35412

Sibling sweep

Swept: grep -n "loadLessons()" website/src/pages/overview/MemoryTab.tsx
Sibling: the delete and edit refreshes -- already handled. Open PRs #35348 and #35343 also edit this file on other lines (no line overlap, checked with git merge-tree).

Pattern harvest

Not generalizable: one list read without a catch.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 11, 2026 16:44
@RohanK6

RohanK6 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Screenshots: the real MemoryTab, with GET /api/lessons answering 500.

Before (en): Before, English: No lessons yet with no error

After (en): After, English: Could not load the lessons

Before (de): Before, German: Noch keine Lektionen with no error

After (de): After, German: Die Lektionen konnten nicht geladen werden

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of 4adb8f08197468ee0fb56677c8835739f7a957bd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the "Lesson added, but the list could not be refreshed" state. The error-state screenshots also show a dismiss ✕ that HEAD does not render, so they show a different revision.

Evidence gaps

  • The add notice (lesson_added_refresh_failed): it appears after an Add is saved but the list re-read fails. None of shot-01 to shot-04 shows it. To close: a screenshot of the Lessons card after an Add with GET /api/lessons failing, with the cleared Rule box and the old rows visible under the notice.
  • The load-failed notice as HEAD renders it: in shot-02 and shot-04 the pink bar has a "×" at the right, and the blind reader expected it to close the bar. The diff passes no onDismiss to this ErrorNotice ("Not dismissible: clearing it would let the empty state claim a list the read never returned"), and ErrorNotice only draws the ✕ when onDismiss is set. So these screenshots are not evidence for 4adb8f0. To close: retake shot-02 and shot-04 from HEAD.

Notes

  • No way out of the error: the notice can't be dismissed and offers no action. The reader said "Nothing on the screen offers a retry" and "I wouldn't trust Add while it says the store is busy." A "Reload lessons" action on the lessons_load_failed notice that calls showLessons('load') would fix this.
  • Raw server text: message={lessonsLoadError?.message} shows the server's English text ("lesson store is busy") next to the translated title. The reader flagged it in German as "half the message in English". Map known failures to catalog text, or move the raw reason into details.

[UX-REVIEWED] 4adb8f0

Description read

[DESCRIPTION-READ] 62ac94712c650f49fcd8dc7fb52e42fca9e6f3620e65fad2c8ee16b38a788768

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 4adb8f08197468ee0fb56677c8835739f7a957bd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the fix catches the failed read where it happens, the newest-read rule stops a stale result from showing, and screenshots of this revision are attached.

Notes

  • Both the empty state and the table body are hidden whenever lessonsLoadError is set and the list is empty. If ErrorNotice renders nothing while the gateway is disconnected, the Lessons card is left blank. Check that this combination draws something.

[DESIGN-REVIEWED] 4adb8f0

Description read

[DESCRIPTION-READ] 0419719c328b8f936b958e86f054c5b1ae3ed2b7b4194a11dea95e4d0d3c9aea

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 4adb8f08197468ee0fb56677c8835739f7a957bd — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: every item traces to #35412 or to a race the new notice would otherwise create, and the delete/edit read sites (lines 382, 630) already handle their own failures.

What this change ships

Inventory (6 items) — 6 justified

Intent: when the lessons list can't be read, the Memory tab should say so instead of claiming there are no lessons. FIX.

  1. A failed lessons read on open or refresh now shows "Could not load the lessons" with the error text — justified
  2. A stored Add whose re-read fails now shows "Lesson added, but the list could not be refreshed" — justified
  3. "No lessons yet" is hidden while a read error stands over an empty list — justified
  4. A slow older read can no longer overwrite a newer one's list or notice — justified
  5. Opening the tab now sends one GET /api/lessons instead of two (duplicate mount read removed) — justified
  6. Two new message strings in every locale catalog and en-XA — justified

[FIRST-PRINCIPLES-REVIEWED] 4adb8f0

Description read

[DESCRIPTION-READ] 6250e717aad863563715689686766d460c87bb21d0b8836a4716ece691161efa

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 4adb8f08197468ee0fb56677c8835739f7a957bd — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4adb8f0

Verdict parsed from the review's SHA-scoped output markers for commit 4adb8f08197468ee0fb56677c8835739f7a957bd.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 4adb8f08197468ee0fb56677c8835739f7a957bd false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 4adb8f08197468ee0fb56677c8835739f7a957bd and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4adb8f0

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 4adb8f08197468ee0fb56677c8835739f7a957bd false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

Approve. If GET /api/lessons fails on open, on refresh or after an Add, the Lessons card now shows a notice saying the list could not be read instead of "No lessons yet". After a stored Add the notice says the lesson was added. A later successful read clears it.

Core behaviour

  • The PR wraps loadLessons in showLessons, which catches the failure and records whether it came from a load or an Add.
  • The empty state is not drawn while that error stands over an empty list, unless an editor is open.

The earlier blocking finding is fixed

  • The GPT lane's finding on the previous head was that dismissing the notice let "No lessons yet" come back without a retry.
  • On this head the notice has no onDismiss. ErrorNotice only draws a dismiss button when onDismiss is passed, and draws nothing when the message is empty. The new test checks that no dismiss button appears.

Overlapping reads

  • Every read takes a number from a counter; only the newest read may set the list or clear the notice.
  • Delete and edit already call loadLessons with their own catch. Their failures are thrown before the counter check, so those paths still show their own notices as they do on main.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 3a14d3f1b6 · 183 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
@RohanK6
RohanK6 force-pushed the crew/conductor/lessons-load-error branch from b462f69 to 2a0f08e Compare November 12, 2026 00:46
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026
@RohanK6
RohanK6 force-pushed the crew/conductor/lessons-load-error branch from 2a0f08e to 3a14d3f Compare November 12, 2026 04:11
@RohanK6
RohanK6 force-pushed the crew/conductor/lessons-load-error branch from 3a14d3f to 4adb8f0 Compare November 12, 2026 12:28
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026
@RohanK6
RohanK6 enabled auto-merge (squash) November 12, 2026 13:35

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. I read the MemoryTab.tsx hunk in full and the new test file. The locale hunks only add the two keys.

  • A failed GET /api/lessons no longer leaves "No lessons yet" over lessons that may exist. The notice says which step failed (load vs add), and the empty state is withheld only while that error stands over an empty list.
  • The ordering guard is right. showLessons captures current + 1, which is exactly the seq the loadLessons it starts takes, so only the newest read may set the list or the notice. The test pins the slow-older-failure case.
  • Dropping the duplicate first read from the settings effect is safe, because the refresh effect already runs on mount.
  • No regex, and no backend change.

@RohanK6
RohanK6 merged commit 7c1d43d into main Nov 12, 2026
99 checks passed
@RohanK6
RohanK6 deleted the crew/conductor/lessons-load-error branch November 12, 2026 14:04
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
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.

Memory: a failed lessons load shows "No lessons yet" with no error

3 participants