[PR #1267] [MERGED] Fix conversation setup cancel ghost chats #5014

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1267
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1229-conversation-setup-cancel


📝 Commits (3)

  • 3d4b948 Fix conversation setup cancel ghost chats
  • 9eb9fce Add issue 1229 UI proof
  • 713203c Guard conversation setup cancel state

📊 Changes

6 files changed (+30 additions, -7 deletions)

View changed files

➕ docs/pr-evidence/issue-1229/after-close.png (+0 -0)
➕ docs/pr-evidence/issue-1229/before.png (+0 -0)
📝 src/features/modes/conversation/components/ChatConversationSurface.tsx (+3 -0)
📝 src/features/modes/conversation/components/ConversationModeRoute.tsx (+16 -1)
📝 src/features/modes/shared/chat-ui/components/ChatCommonOverlays.tsx (+5 -1)
📝 src/features/modes/shared/chat-ui/components/ChatSetupWizard.tsx (+6 -5)

📄 Description

Linked issue

Closes #1229

Why this change

  • Canceling the new Conversation setup flow was leaving the immediately-created draft chat persisted as a normal sidebar/storage row.
  • The issue was specifically the close/cancel path; Skip remains the intentional path for keeping the draft and continuing without setup.

What changed

  • Split Conversation setup completion from setup cancellation.
  • Wire the Conversation setup close/backdrop cancel path to delete the uncommitted draft chat before returning home.
  • Keep Skip and Start Chatting on the existing finish path so they preserve the chat.

Refactor impact

Primary owner:

  • Chat mode / shared mode UI

Impact areas reviewed:

  • Conversation quick-start setup wizard
  • Shared chat overlays
  • Chat storage delete mutation behavior
  • Remote runtime storage API contract through the Playwright mock runtime

Boundary notes:

  • No engine generation, Rust command, schema, dependency, version, import/export, or prompt-pipeline behavior changed.
  • The delete path only runs for the active Conversation setup cancel handler; Roleplay setup keeps its existing fallback behavior.

Pressure points touched:

  • Shared mode UI setup wizard and common overlays.

Validation

  • pnpm check passes locally
  • 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
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Codex-run machine proof:

  • Reproduced before the fix with node scratch\issue-1229-repro.mjs: close X left addedAfterClose: 1 and a New Conversation row with connectionId: null.
  • Verified after the fix with MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=close node scratch\issue-1229-repro.mjs: close X left addedAfterClose: 0.
  • Edge case: MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=backdrop node scratch\issue-1229-repro.mjs left addedAfterClose: 0.
  • Negative control: MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=skip node scratch\issue-1229-repro.mjs preserved the newly created chat with addedAfterClose: 1.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • CARGO_TARGET_DIR=D:\dev\Marinara-Engine-target-issue-1229 pnpm check passed.
  • Bunny review pass completed before opening this PR.

No blocking manual verification remains for the core claim.

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

Before, closing setup left the draft chat persisted:

Before: setup close leaves ghost chat

After, closing setup returns home with no persisted draft chat:

After: setup close deletes draft chat

Summary by CodeRabbit

  • New Features
    • Users can now cancel the conversation setup wizard. When canceled, the system automatically cleans up incomplete conversations. If cleanup fails, the wizard reopens to allow retry.

Review Change Stack


🔄 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/1267 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1229-conversation-setup-cancel` --- ### 📝 Commits (3) - [`3d4b948`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d4b948b5eb2e203cfd63995f8a4e9cd6954e70e) Fix conversation setup cancel ghost chats - [`9eb9fce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9eb9fcee1efa91d530d2de97bfab672d262fb523) Add issue 1229 UI proof - [`713203c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/713203c67d2ce14e139d4565c3126047a96220c6) Guard conversation setup cancel state ### 📊 Changes **6 files changed** (+30 additions, -7 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-1229/after-close.png` (+0 -0) ➕ `docs/pr-evidence/issue-1229/before.png` (+0 -0) 📝 `src/features/modes/conversation/components/ChatConversationSurface.tsx` (+3 -0) 📝 `src/features/modes/conversation/components/ConversationModeRoute.tsx` (+16 -1) 📝 `src/features/modes/shared/chat-ui/components/ChatCommonOverlays.tsx` (+5 -1) 📝 `src/features/modes/shared/chat-ui/components/ChatSetupWizard.tsx` (+6 -5) </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 #1229 ## Why this change - Canceling the new Conversation setup flow was leaving the immediately-created draft chat persisted as a normal sidebar/storage row. - The issue was specifically the close/cancel path; `Skip` remains the intentional path for keeping the draft and continuing without setup. ## What changed - Split Conversation setup completion from setup cancellation. - Wire the Conversation setup close/backdrop cancel path to delete the uncommitted draft chat before returning home. - Keep `Skip` and `Start Chatting` on the existing finish path so they preserve the chat. ## Refactor impact Primary owner: - Chat mode / shared mode UI Impact areas reviewed: - Conversation quick-start setup wizard - Shared chat overlays - Chat storage delete mutation behavior - Remote runtime storage API contract through the Playwright mock runtime Boundary notes: - No engine generation, Rust command, schema, dependency, version, import/export, or prompt-pipeline behavior changed. - The delete path only runs for the active Conversation setup cancel handler; Roleplay setup keeps its existing fallback behavior. Pressure points touched: - Shared mode UI setup wizard and common overlays. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [ ] `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 - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Codex-run machine proof: - Reproduced before the fix with `node scratch\issue-1229-repro.mjs`: close `X` left `addedAfterClose: 1` and a `New Conversation` row with `connectionId: null`. - Verified after the fix with `MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=close node scratch\issue-1229-repro.mjs`: close `X` left `addedAfterClose: 0`. - Edge case: `MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=backdrop node scratch\issue-1229-repro.mjs` left `addedAfterClose: 0`. - Negative control: `MARINARA_REPRO_MODE=after MARINARA_REPRO_ACTION=skip node scratch\issue-1229-repro.mjs` preserved the newly created chat with `addedAfterClose: 1`. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - `CARGO_TARGET_DIR=D:\dev\Marinara-Engine-target-issue-1229 pnpm check` passed. - Bunny review pass completed before opening this PR. No blocking manual verification remains for the core claim. ## 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 Before, closing setup left the draft chat persisted: ![Before: setup close leaves ghost chat](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/fix/issue-1229-conversation-setup-cancel/docs/pr-evidence/issue-1229/before.png) After, closing setup returns home with no persisted draft chat: ![After: setup close deletes draft chat](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/fix/issue-1229-conversation-setup-cancel/docs/pr-evidence/issue-1229/after-close.png) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Users can now cancel the conversation setup wizard. When canceled, the system automatically cleans up incomplete conversations. If cleanup fails, the wizard reopens to allow retry. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1267?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:28 +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#5014
No description provided.