[PR #1825] [MERGED] Fix chat summary parity regressions #5296

Closed
opened 2026-10-22 04:15:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1825
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1787-chat-parity


📝 Commits (1)

  • cea3336 Fix chat summary parity regressions

📊 Changes

10 files changed (+494 additions, -34 deletions)

View changed files

📝 src-tauri/src/commands/storage/chats.rs (+92 -7)
📝 src/engine/capabilities/storage.ts (+1 -0)
📝 src/engine/contracts/types/chat.ts (+2 -2)
📝 src/engine/generation/prompt-assembly.ts (+78 -4)
📝 src/engine/generation/start-generation.ts (+24 -0)
📝 src/engine/shared/text/chat-summary-entries.ts (+41 -3)
📝 src/features/catalog/chats/hooks/use-chats.ts (+62 -13)
📝 src/features/modes/conversation/components/ConversationView.tsx (+40 -1)
📝 src/features/modes/shared/chat-ui/components/SummaryPopover.tsx (+153 -4)
📝 src/shared/api/storage-api.ts (+1 -0)

📄 Description

Linked issue

Closes #1787

Why this change

  • Restores refactor chat parity for summary management, branch metadata cleanup, Memory Recall refresh, and day/week summary prompt compaction.

What changed

  • Preserves legacy metadata.summary as a structured legacy rolling summary entry when structured summary entries are introduced.
  • Restores structured summary entry display/edit/toggle/delete controls, prompt template selection, and the shared summary popover in conversation mode.
  • Routes generated summaries through the chat-summary/default-for-agents fallback chain and records the selected summary prompt template.
  • Formats day/week summary maps as readable prompt blocks and limits raw history to the configured summary tail when compacted summaries exist.
  • Prunes future-facing summary fields from new branches while keeping summary configuration metadata.
  • Refreshes Memory Recall after successful non-impersonation generation when the storage gateway supports refresh.

Refactor impact

Primary owner:

Chat mode / shared mode UI, with engine generation and Rust storage support.

Impact areas reviewed:

  • Summary popover shared UI and conversation toolbar mounting.
  • Chat summary generation routing and prompt template resolution.
  • Prompt assembly for rolling, day, and week summaries.
  • Native chat_branch storage behavior.
  • Generation post-save Memory Recall refresh path.

Boundary notes:

  • Engine code stays React-free and only depends on engine helpers.
  • Feature UI calls focused catalog/shared API hooks instead of raw Tauri.
  • The Memory Recall refresh is exposed as an optional StorageGateway capability and implemented by the Tauri storage API wrapper.
  • Rust storage owns branch metadata pruning.

Pressure points touched:

  • Shared mode UI SummaryPopover.
  • Conversation mode toolbar.
  • Engine prompt assembly and generation start pipeline.
  • src-tauri/src/commands/storage/chats.rs.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex proof run:
  • pnpm exec vitest run --config scratch\vitest.issue-1787.config.ts
  • cargo test --manifest-path src-tauri\Cargo.toml branch_chat_prunes_future_summary_metadata_from_new_branch
  • cargo check --manifest-path src-tauri\Cargo.toml --workspace
  • pnpm check
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json
  • Bunny review passed before PR open.
  • No real Tauri/browser screenshot was captured. The visual UI row is limited to component wiring and typecheck proof; hands-on Tauri visual inspection is still useful before merge.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • This restores existing chat summary parity rather than adding a new discoverable workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not attached. The conversation summary button and popover wiring are code/typecheck covered, but real Tauri visual verification is not included in this draft.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1825 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1787-chat-parity` --- ### 📝 Commits (1) - [`cea3336`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cea3336b97c216947f6351bc6e408397f5575fbf) Fix chat summary parity regressions ### 📊 Changes **10 files changed** (+494 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/chats.rs` (+92 -7) 📝 `src/engine/capabilities/storage.ts` (+1 -0) 📝 `src/engine/contracts/types/chat.ts` (+2 -2) 📝 `src/engine/generation/prompt-assembly.ts` (+78 -4) 📝 `src/engine/generation/start-generation.ts` (+24 -0) 📝 `src/engine/shared/text/chat-summary-entries.ts` (+41 -3) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+62 -13) 📝 `src/features/modes/conversation/components/ConversationView.tsx` (+40 -1) 📝 `src/features/modes/shared/chat-ui/components/SummaryPopover.tsx` (+153 -4) 📝 `src/shared/api/storage-api.ts` (+1 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1787 ## Why this change - Restores refactor chat parity for summary management, branch metadata cleanup, Memory Recall refresh, and day/week summary prompt compaction. ## What changed - Preserves legacy `metadata.summary` as a structured `legacy` rolling summary entry when structured summary entries are introduced. - Restores structured summary entry display/edit/toggle/delete controls, prompt template selection, and the shared summary popover in conversation mode. - Routes generated summaries through the chat-summary/default-for-agents fallback chain and records the selected summary prompt template. - Formats day/week summary maps as readable prompt blocks and limits raw history to the configured summary tail when compacted summaries exist. - Prunes future-facing summary fields from new branches while keeping summary configuration metadata. - Refreshes Memory Recall after successful non-impersonation generation when the storage gateway supports refresh. ## Refactor impact Primary owner: Chat mode / shared mode UI, with engine generation and Rust storage support. Impact areas reviewed: - Summary popover shared UI and conversation toolbar mounting. - Chat summary generation routing and prompt template resolution. - Prompt assembly for rolling, day, and week summaries. - Native `chat_branch` storage behavior. - Generation post-save Memory Recall refresh path. Boundary notes: - Engine code stays React-free and only depends on engine helpers. - Feature UI calls focused catalog/shared API hooks instead of raw Tauri. - The Memory Recall refresh is exposed as an optional `StorageGateway` capability and implemented by the Tauri storage API wrapper. - Rust storage owns branch metadata pruning. Pressure points touched: - Shared mode UI `SummaryPopover`. - Conversation mode toolbar. - Engine prompt assembly and generation start pipeline. - `src-tauri/src/commands/storage/chats.rs`. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex proof run: - `pnpm exec vitest run --config scratch\vitest.issue-1787.config.ts` - `cargo test --manifest-path src-tauri\Cargo.toml branch_chat_prunes_future_summary_metadata_from_new_branch` - `cargo check --manifest-path src-tauri\Cargo.toml --workspace` - `pnpm check` - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` - Bunny review passed before PR open. - No real Tauri/browser screenshot was captured. The visual UI row is limited to component wiring and typecheck proof; hands-on Tauri visual inspection is still useful before merge. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - This restores existing chat summary parity rather than adding a new discoverable workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not attached. The conversation summary button and popover wiring are code/typecheck covered, but real Tauri visual verification is not included in this draft. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:01 +07:00
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#5296
No description provided.