Harden per-chat selection isolation and restoration#272
Merged
ericdallo merged 5 commits intoJul 15, 2026
Conversation
Preserve scoped config chat IDs, resolve the active chat consistently from chat and source buffers, and make delete cleanup resilient when a server notification is missed.
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.
Harden model, variant, agent, and trust handling across multiple chats and ECA
sessions.
Pairs with editor-code-assistant/eca#533
nil.Details
Per-chat routing
Preserve
chatIdfromconfig/updatednotifications so scoped server updatesonly affect their target chat.
Selection commands now prefer the current live, registered chat buffer before
falling back to the session's last chat. This also fixes agent selection from
source buffers and prevents
eca-chat-deletefrom deleting a stale last-chatbuffer.
Agent cycling now handles empty agent lists and selections that are no longer
available.
Variant isolation
Variant catalogs are now buffer-local because available variants can differ by
chat and selected model.
The UI sentinel
"-"is normalized tonilinternally and is never sent as aprotocol variant. Scoped variant updates affect only their target chat, while
legacy unscoped catalogs continue to act as session defaults.
Session-scoped defaults
Replace process-global model, agent, variant, and trust defaults with fields on
each
eca--session.New chats inherit defaults only from their own session. Scoped restore and
configuration updates do not mutate those defaults or leak state into other
sessions.
Explicit local
nilvalues for variant and trust are distinguished fromuninitialized values.
Restored chat hydration
Add backward-compatible support for the atomic
selectionsnapshot introducedby editor-code-assistant/eca#533.
When present in a
chat/openresponse, the snapshot atomically hydrates theopened chat's:
Field presence is preserved, so explicit nullable values clear local state
while omitted fields remain unchanged.
The client accepts both the new
foundresponse field and the legacyfound?field. It also remains compatible with older servers by narrowly routing
unscoped restore notifications to the chat currently being opened.
Concurrent
chat/openrequests are rejected because legacy unscoped restorenotifications cannot be associated safely with multiple simultaneous opens.