[GH-ISSUE #5753] Mari suggestion chips live in one app-wide slot that unrelated paths clear (regular-chat generation, suggestions-disabled mount sweeps) #3181

Closed
opened 2026-10-21 06:00:18 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5753

Originally assigned to: @kolacheee on GitHub.

In one sentence: Professor Mari's suggestion chips live in a single app-wide store slot that unrelated code paths clear, so chips vanish on navigation — observed live when a held proposal's Accept button disappeared after leaving and returning to the chat.

What happened

During a playtest of the #5748 branch, a deferred (held) proposal showed its Accept chip; the user opened the Chats popover looking for a new-chat affordance, returned to the chat, and the Accept button was gone.

The load-bearing case is already fixed: PR #5751 makes the client re-derive the authorization-accept chip from the persisted mariDeferredMutations message extra, so a held proposal's Accept now survives navigation, reloads, and every clear path below. This issue tracks the underlying store design and the remaining clear-path inconsistencies, which still affect ordinary suggestion chips.

The clear paths (all verified in source)

  1. Regular-chat generation start wipes Mari's chips globally. use-generate.ts (~line 1286): when any regular chat the user is viewing starts a generation, it calls clearMariChips() — the slot is app-wide (agent.store.ts: one mariChips + mariChipsChatId pair), so generating in a roleplay chat destroys chips that belong to a Mari chat.
  2. The suggestions-disabled mount sweeps lack the Accept exemption the delivery path has. Chip delivery deliberately lets authorization-accept through even when the user disabled Mari suggestions (HomeProfessorMariChat, the suggestions event handler). But three mount effects — HomeProfessorMariChat ~3371, ChatInput ~621, ConversationInput ~645 — run if (professorMariSuggestionsEnabled) return; clearMariChips(); on mount, clearing everything including the exempted Accept chip. With suggestions disabled, any remount of those composers wiped a pending approval affordance.
  3. A dead option: loadMessages(..., { clearSuggestions }) in HomeProfessorMariChat clears chips when passed — no call site passes it. Harmless, but dead weight that invites accidental use.

Possible directions (maintainer's call)

  • Make the slot chat-keyed for real: a Record<chatId, chips> (or at least stop clearing when mariChipsChatId belongs to a different chat than the one doing the clearing). Path 1 then cannot cross surfaces.
  • Give the mount sweeps the same authorization-accept exemption the delivery path has — or drop the sweeps entirely now that rendering already filters by the setting.
  • Delete the unused clearSuggestions option.

Low urgency now that the approval chip is derivation-backed; ordinary suggestion chips are ephemeral by design, so the main cost today is mild inconsistency rather than lost function.

Originally created by @kolacheee on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5753 Originally assigned to: @kolacheee on GitHub. **In one sentence:** Professor Mari's suggestion chips live in a single app-wide store slot that unrelated code paths clear, so chips vanish on navigation — observed live when a held proposal's Accept button disappeared after leaving and returning to the chat. ## What happened During a playtest of the #5748 branch, a deferred (held) proposal showed its Accept chip; the user opened the Chats popover looking for a new-chat affordance, returned to the chat, and the Accept button was gone. **The load-bearing case is already fixed:** PR #5751 makes the client re-derive the `authorization-accept` chip from the persisted `mariDeferredMutations` message extra, so a held proposal's Accept now survives navigation, reloads, and every clear path below. This issue tracks the underlying store design and the remaining clear-path inconsistencies, which still affect ordinary suggestion chips. ## The clear paths (all verified in source) 1. **Regular-chat generation start wipes Mari's chips globally.** `use-generate.ts` (~line 1286): when any regular chat the user is viewing starts a generation, it calls `clearMariChips()` — the slot is app-wide (`agent.store.ts`: one `mariChips` + `mariChipsChatId` pair), so generating in a roleplay chat destroys chips that belong to a Mari chat. 2. **The suggestions-disabled mount sweeps lack the Accept exemption the delivery path has.** Chip delivery deliberately lets `authorization-accept` through even when the user disabled Mari suggestions (HomeProfessorMariChat, the `suggestions` event handler). But three mount effects — HomeProfessorMariChat ~3371, ChatInput ~621, ConversationInput ~645 — run `if (professorMariSuggestionsEnabled) return; clearMariChips();` on mount, clearing *everything* including the exempted Accept chip. With suggestions disabled, any remount of those composers wiped a pending approval affordance. 3. **A dead option:** `loadMessages(..., { clearSuggestions })` in HomeProfessorMariChat clears chips when passed — no call site passes it. Harmless, but dead weight that invites accidental use. ## Possible directions (maintainer's call) - Make the slot chat-keyed for real: a `Record<chatId, chips>` (or at least stop clearing when `mariChipsChatId` belongs to a different chat than the one doing the clearing). Path 1 then cannot cross surfaces. - Give the mount sweeps the same `authorization-accept` exemption the delivery path has — or drop the sweeps entirely now that rendering already filters by the setting. - Delete the unused `clearSuggestions` option. Low urgency now that the approval chip is derivation-backed; ordinary suggestion chips are ephemeral by design, so the main cost today is mild inconsistency rather than lost function.
bsakaguchi 2026-10-21 06:00:18 +07:00
Author
Owner

@kolacheee commented on GitHub (Sep 2, 2026):

Implementation starting (kolacheee, via Claude session) - combined PR with #5752 and #5754 on branch fix/5752-5754-mari-polish.

<!-- gh-comment-id:5504058521 --> @kolacheee commented on GitHub (Sep 2, 2026): Implementation starting (kolacheee, via Claude session) - combined PR with #5752 and #5754 on branch fix/5752-5754-mari-polish.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3181
No description provided.