fix(dashboard): persist session close metadata on empty message windows (#4501) - #4623
Open
md-abusayeed wants to merge 1 commit into
Open
fix(dashboard): persist session close metadata on empty message windows (#4501)#4623md-abusayeed wants to merge 1 commit into
md-abusayeed wants to merge 1 commit into
Conversation
md-abusayeed
force-pushed
the
fix/empty-slot-close-persist-4501
branch
from
August 20, 2026 05:50
173b8a3 to
bb13523
Compare
md-abusayeed
force-pushed
the
fix/empty-slot-close-persist-4501
branch
from
August 20, 2026 06:58
bb13523 to
3dbb3f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
Closing a dashboard chat session that contains no messages (e.g. newly created at birth or created programmatically) fails to persist the \closed: true\ and \closed_at\ metadata flags to disk. Consequently, when the gateway restarts, rehydration restores the empty session back into the sidebar despite the user having closed it.
Why it matters
In _save_slot_to_history\ (\src/kiro_crew/dashboard/chat_persistence.py), the function began with an unqualified \if not window: return\ guard. This guard sat directly above the no-op check whose documentation explicitly states that \closed, \orce, and
ewrite\ must always proceed to disk.
Because \if not window: return\ was evaluated first without checking \closed, closing an empty slot resulted in an early return without writing the updated metadata line containing \closed\ and \closed_at. The caller (\�pi_chat_slot_delete\ via \save_slot_off_loop(..., closed=True, closed_at=closed_at)) treated the operation as successful, but on-disk metadata remained unclosed.
What changed
Tests
Manual verification
N/A — unit coverage sufficient: direct unit tests assert on-disk metadata existence and contents via \ConversationLog.get_metadata.
Screenshots / video
Why no screenshot: backend persistence and session lifecycle fix — no visual UI change.
Related Issues
Closes #4501
Checklist