Repository navigation
fix(dashboard): report refused Memory tab saves and clamp settings - #26508
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the backend and the UI now clamp to the same bounds, and every caller of the four saves handles the new rejection. Notes
[DESIGN-REVIEWED] afae643 Description read[DESCRIPTION-READ] 670c04e2c37308ff9613e4763a4011641b09a3d445444609ced6043b97e829cc 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every item comes from #26504's reproductions: a refused save shown as "Saved", What this change shipsInventory (10 items) — 7 justifiedIntent: make the Memory tab say "Saved", or add a lesson, only when the server actually stored the write. FIX.
[FIRST-PRINCIPLES-REVIEWED] afae643 Description read[DESCRIPTION-READ] 02117126d9435ff18daf1362d173e9ff6e6fb94923246769feb32fe83264bfd3 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the new "Could not load the memory settings" notice. No screenshot shows it, yet in that state the boxes show defaults (3 / 90) that the user could take for their stored values. Evidence gaps
Notes
[UX-REVIEWED] afae643 Description read[DESCRIPTION-READ] 988595d9a49225017c77decd409d4f57e0f6773be49ead3b4929e66e200c3594 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
4a07410 to
a230362
Compare
|
self-added: yes
|
a230362 to
afae643
Compare
|
self-added: no
|
|
Holding for a human reviewer under the sensitive-change rule; I found no defect. The save fixes are sound. All four memory saves now reject on a refused write (memory.ts#L99-L108), and Why it needs a person: the PUT now clamps AI findings judged non-blocking
Checks: all completed green on the reviewed head; PR Readiness passed. Reviewed SHA: afae643 — crew-pr-reviewer (r138) |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Lanes pass on afae643, checks green, no conflict, no open change request.
Problem / Motivation
Goal: The Memory tab says "Saved" or adds a lesson only when the server took the write, and its settings boxes show the value the server stores.
On Settings > Overview > Memory, a save the server refuses (403 owner gate, 400, 409) still shows "Saved", because the client returns the raw
Responseand nobody reads its status. An emptied idle-hours box sends0, the server stores0.5, and the box keeps showing0. The boxes stop at 24 hours and 365 days, but the PUT has no upper bound, so"inf"writesInfinityintoconfig.json. Adding a lesson that the server refuses ends in an unhandled rejection with no message. The rule text is not trimmed, and the rule box has no accessible name.Why it matters
A user who is told "Saved" walks away thinking the setting or the document is stored. It is not, and nothing says so. A document card even clears the draft on a refused save, so the typed text is lost. A screen reader user hears an unnamed text box.
Not a goal
What changed (motivation → approach → change)
Symptom → cause → change:
put()resolves on any statuswebsite/src/api/client/memory.tsparse withj, so a refusal rejects. The settings card shows anErrorNoticeInfinityin config, 500 on10**400OverflowErroruncaughthandlers/memory.pyclamps to the same ceilings, a too-large integer includedErrorNoticeand keeps the draftErrorNotice, apart from the save one" "passes, box unnamedSave sends only the boxes edited since load. A retention value set above 365 in
config.jsonthen survives a Save that changed only the idle hours. Save is disabled while its request runs, so "Saved" answers the request that carried the edit. An edit made meanwhile stays marked for the next Save, and a slow first load never overwrites a box already edited.Three new i18n keys (
settings_load_failed,settings_save_failed,lesson_request_failed) are in every catalog underwebsite/src/i18n, anden-XAis regenerated. The memory-skills-hooks spec states the bounds.Backwards compatibility
Compatible: nothing that works today is refused. An out-of-range PUT still answers 200, now with the value clamped to the bounds the UI already showed.
The diff narrows the range a PUT can store, so here are its readers:
Reader: src/kiro_crew/heartbeat.py:prune_history(keep_days=history_max_days) -- entry: release -- receives at most 365 from this route; a value already in config.json is untouched, because the tab sends only edited fields (
clamps an emptied or out-of-range boxtest)Reader: src/kiro_crew/history_consolidation.py:HistoryConsolidator.reconfigure -- entry: release -- reads a finite 0.5–24 hour window;
infno longer reaches it (test_put_clamps_to_the_tab_ceilings)Reader: src/kiro_crew/cli_server.py:history_idle_secs -- entry: release -- the same finite value, read at boot
Writer sweep on origin/main @ 0fcfd43: the only writer of
PUT /api/memory/settingsis the Memory tab (website/src/pages/overview/MemoryTab.tsx).Tests
test/test_handlers_memory_coverage.py::test_put_clamps_to_the_tab_ceilings: 99/9000,"inf"and10**400are stored as 24/365, and-(10**400)as 0.5/7.website/src/test/OverviewMemoryTabCov80.test.tsx: a failed settings read and a refused save each show their own error, and a refused save does not show "Saved". An emptied box saves 0.5, an untouched hand-set 730 is not sent, and out-of-range values clamp. Save is disabled during a save, and edits made meanwhile or before a slow load are kept. The rule is trimmed and labelled. A refused lesson add keeps the draft.website/src/test/ApiClient.coverage.methods.test.tsx: all four memory saves reject on a 403 and resolve on a 2xx.Proof: not provable -- other: prove.py cannot revert the committed screenshot PNGs (binary patch without full index line)
On an earlier head (7f7dc2c0a32d) prove.py printed PROVEN for the
aboveandinfcases. Thehuge-intcases go red by hand with theOverflowErrorclause removed. The frontend tests fail on main, which has no catch, no trim and no label.Manual verification
I ran the built SPA in Chromium with
PUT /api/memory/settingsandPOST /api/lessonsstubbed to 403. I emptied the idle box and pressed Save: it showed 0.5 and the error, not "Saved". I added a lesson: the error showed and the draft stayed.Screenshots / video
Refused settings save (dark), refused lesson add (light):
Other theme
Related Issues
Fixes #26504
Sibling sweep
Swept: git grep -nE "=> put(" -- website/src/api/client/memory.ts
Sibling: website/src/api/client/memory.ts:102 -- changed here
Sibling: website/src/api/client/memory.ts:104 -- changed here
Sibling: website/src/api/client/memory.ts:106 -- changed here
Sibling: website/src/api/client/memory.ts:181 -- not affected -- vectorSemanticWrite already parses with j
Pattern harvest
Rule candidate: semgrep
Pattern: an api client method returns a bare
put(...)/post(...)Response with no.then(j), and a caller awaits it as successChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)