fix: resolve issue #3340#3342
Conversation
SummaryRead the diff at this PR against One real bug: cross-turn dedupe is too aggressive for memory
const _persistentStateToastSeen=new Set();The dedupe key for a memory save ( const dedupeKey=[
S&&S.session&&S.session.session_id||'',
normalizedKind,
itemName||'memory',
].join(':');For Skills are keyed by name so they're less affected, but the same set still suppresses a legitimate second update to the same skill later in the session. RecommendationMake the dedupe per-turn, not per-session. The simplest fix is to fold the active stream/turn id into the key and let the set stay bounded by the existing 200-entry LRU, e.g.: const turnTag = (S && S.activeStreamId) || (S && S.session && S.session.lastTurnId) || '';
const dedupeKey=[turnTag, sid, normalizedKind, itemName||'memory'].join(':');That keeps the intra-turn dedupe (backend Second concern: double-detection pathBoth the SSE Test planThe added |
## Release v0.51.260 — Release IB (stage-r8) Un-held safety fixes (author resolved my earlier hold findings; re-reviewed fresh) + a clean fix batch. 6 PRs. ### Fixed | Issue/PR | Author | Fix | |----------|--------|-----| | #3535 (#3538) | @rodboev | **Self-update recovers from a stash-pop conflict without data loss.** Was a BRICK bug (`git reset --merge` + `git stash drop` discarded local mods while reporting success). Now keeps the stash, returns `ok:false` + "preserved in `stash@{0}`", no restart on conflict. *(was held — fix verified)* | | #1909 s3 (#3562) | @rodboev | **Auth `Secure` cookie no longer locks out plain-HTTP LAN/Tailscale users.** Secure now keys only on real TLS evidence (env / TLS socket / opt-in `TRUST_FORWARDED_PROTO`); non-loopback plain-HTTP is no longer force-Secure. SameSite back to `Lax`. *(was held — fix verified)* | | #2785 (#3559) | @franksong2702 | Clearer cron/gateway diagnostics for single-container Docker (gateway configured, no daemon → jobs silently don't fire). | | #3555 | @lambyangzhao | Long TTS responses chunked at sentence boundaries (works around the browser's ~32K silent-truncation). | | #3340 (#3342) | @rly09 | Persistent-state toast when a turn has saved memory / created-updated a skill. | | #3533 | @franksong2702 | `/reload-mcp` marked `cli_only` so the WebUI doesn't dispatch it as an LLM prompt. | ### Gate - Full pytest suite: **7681 passed, 0 failed** - ESLint: CLEAN · ruff: CLEAN · browser-smoke: CLEAN - Codex (regression): **SAFE TO SHIP** — confirmed the stash-conflict path never drops the stash / never restarts on conflict, auth Secure handles LAN-HTTP correctly with no header-forgery hole, `/reload-mcp` allowlisted, state-toast has a real backend writer + active-session guard, diagnostics leak no paths, TTS chunking preserves order. Co-authored-by: rodboev <rodboev@users.noreply.github.com> Co-authored-by: franksong2702 <franksong2702@users.noreply.github.com> Co-authored-by: lambyangzhao <lambyangzhao@users.noreply.github.com> Co-authored-by: rly09 <rly09@users.noreply.github.com>
|
Shipped in v0.51.260 (Release IB) — thank you! 🙏 (persistent-state toasts (memory/skill saves visible).) Closing as merged-via-release-stage. |
This pull request adds a new feature that displays a small success toast notification in the chat UI whenever an agent turn saves memory or creates/updates a skill, making persistent state changes visible to users during normal WebUI turns. The implementation includes both backend detection of persistent state changes and frontend toast display logic, with tests to ensure correct behavior.
Persistent State Change Detection and Notification:
The backend (
api/streaming.py) now snapshots and compares key memory and skill files before and after each agent turn to detect if memory was saved or a skill was created/updated. When such changes are detected, astate_savedevent is emitted via SSE with relevant details. [1] [2] [3]The frontend (
static/messages.js) listens forstate_savedevents and displays a deduplicated toast notification to the user, using user-friendly labels for memory and skill changes. It also heuristically detects persistent state changes from tool calls for additional robustness. [1] [2] [3] [4]Testing and Documentation:
A new test file (
tests/test_issue3340_persistent_state_toasts.py) verifies backend detection, frontend notification logic, deduplication, user-visible labels, and presence of a changelog entry.The changelog (
CHANGELOG.md) documents the new feature for visibility.