[GH-ISSUE #1509] [Issue]: Manage Chat Files misses Roleplay branches from the original chat #761

Closed
opened 2026-10-20 17:33:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1509

Originally assigned to: @Romuromylus on GitHub.

Summary

After creating Roleplay branches, Manage Chat Files works from a branch chat but the original/root chat still says it is not part of a group and has no branches.

Expected behavior

Once a Roleplay chat has branches, opening Manage Chat Files from either the original chat or any branch should show the same branch group and allow switching/managing the chat files.

Actual behavior

Branch records are created with groupId set to the original chat id, but the original/root chat keeps groupId: null. Because the drawer only fetches a group when the active chat has chat.groupId, opening Manage Chat Files from the original chat shows the no-group empty state even though branch records exist for that original chat id.

Steps to reproduce

  1. Launch the refactor desktop app through the native Tauri path.
  2. In Roleplay mode, create a branch from an existing/original Roleplay chat.
  3. Open Manage Chat Files while a branch is active. The branch group is listed.
  4. Switch back to the original/root Roleplay chat.
  5. Open Manage Chat Files again.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: origin/refactor at 229e7d89 (Fix PR 1499 review follow-ups)
  • Run mode: Tauri desktop
  • OS + version: Windows NT 10.0.26200.0
  • Node + pnpm versions: Node v24.16.0, pnpm 10.33.2
  • Rust version, if relevant: rustc 1.95.0, cargo 1.95.0
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Local QA screenshots captured during the audit:

  • scratch/roleplay-audit-a10-chat-files.png: Manage Chat Files from an active branch shows 2 chat files in this group.
  • scratch/roleplay-audit-a10-root-chat-files-missing-branches.png: Manage Chat Files from the original/root chat shows the no-group/no-branches empty state.

Observed storage evidence from the same QA profile:

  • Active original/root chat:
    • id: 36b9d7fb-92b7-47df-ae9f-15e9221b3cc9
    • name: New Roleplay
    • groupId: null
  • Branch records found by groupId equal to the original chat id:
    • 371388b1-07d5-44d2-9503-31a9c105b36b
    • 3821006b-1562-4cdc-b3c1-e84b32a3b751

Regression notes

Found during the 2026-05-29 Roleplay mode audit on latest origin/refactor. No earlier known-good commit identified.

Additional context

Likely areas to inspect:

  • src-tauri/src/commands/storage/chats.rs: branch_chat uses the source chat id as the branch groupId when the source chat has no existing group id, but does not appear to patch the source chat into that group.
  • src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx: the drawer returns the no-group empty state when chat.groupId is missing, so it cannot discover branches whose groupId equals the current root chat id.
  • src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx: similar if (!groupId) return null behavior may hide branch switching from the original/root chat.

Duplicate checks:

  • gh issue list --repo Pasta-Devs/Marinara-Engine --state all --search "Roleplay original chat branch groupId Manage Chat Files no branches" returned no matches.
  • gh issue list --repo Pasta-Devs/Marinara-Engine --state all --search "chat_branch groupId source chat branch files" returned no matches.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1509 Originally assigned to: @Romuromylus on GitHub. ## Summary After creating Roleplay branches, Manage Chat Files works from a branch chat but the original/root chat still says it is not part of a group and has no branches. ## Expected behavior Once a Roleplay chat has branches, opening Manage Chat Files from either the original chat or any branch should show the same branch group and allow switching/managing the chat files. ## Actual behavior Branch records are created with `groupId` set to the original chat id, but the original/root chat keeps `groupId: null`. Because the drawer only fetches a group when the active chat has `chat.groupId`, opening Manage Chat Files from the original chat shows the no-group empty state even though branch records exist for that original chat id. ## Steps to reproduce 1. Launch the refactor desktop app through the native Tauri path. 2. In Roleplay mode, create a branch from an existing/original Roleplay chat. 3. Open Manage Chat Files while a branch is active. The branch group is listed. 4. Switch back to the original/root Roleplay chat. 5. Open Manage Chat Files again. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [ ] Game mode - [x] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor` at `229e7d89` (`Fix PR 1499 review follow-ups`) - Run mode: Tauri desktop - OS + version: Windows NT 10.0.26200.0 - Node + pnpm versions: Node `v24.16.0`, pnpm `10.33.2` - Rust version, if relevant: rustc `1.95.0`, cargo `1.95.0` - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Local QA screenshots captured during the audit: - `scratch/roleplay-audit-a10-chat-files.png`: Manage Chat Files from an active branch shows `2 chat files in this group`. - `scratch/roleplay-audit-a10-root-chat-files-missing-branches.png`: Manage Chat Files from the original/root chat shows the no-group/no-branches empty state. Observed storage evidence from the same QA profile: - Active original/root chat: - `id: 36b9d7fb-92b7-47df-ae9f-15e9221b3cc9` - `name: New Roleplay` - `groupId: null` - Branch records found by `groupId` equal to the original chat id: - `371388b1-07d5-44d2-9503-31a9c105b36b` - `3821006b-1562-4cdc-b3c1-e84b32a3b751` ## Regression notes Found during the 2026-05-29 Roleplay mode audit on latest `origin/refactor`. No earlier known-good commit identified. ## Additional context Likely areas to inspect: - `src-tauri/src/commands/storage/chats.rs`: `branch_chat` uses the source chat id as the branch `groupId` when the source chat has no existing group id, but does not appear to patch the source chat into that group. - `src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx`: the drawer returns the no-group empty state when `chat.groupId` is missing, so it cannot discover branches whose `groupId` equals the current root chat id. - `src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx`: similar `if (!groupId) return null` behavior may hide branch switching from the original/root chat. Duplicate checks: - `gh issue list --repo Pasta-Devs/Marinara-Engine --state all --search "Roleplay original chat branch groupId Manage Chat Files no branches"` returned no matches. - `gh issue list --repo Pasta-Devs/Marinara-Engine --state all --search "chat_branch groupId source chat branch files"` returned no matches. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:33:02 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Romuromylus commented on GitHub (May 29, 2026):

Fixed by #1519 (merged into refactor as eaa7567). branch_chat now enrolls the source chat into the new group, so Manage Chat Files and the branch selector discover the branches when opened from the original chat. Follow-ups (delete-dialog wording and a migration for chats branched before this fix) are tracked in #1522.

<!-- gh-comment-id:4574414263 --> @Romuromylus commented on GitHub (May 29, 2026): Fixed by #1519 (merged into `refactor` as eaa7567). branch_chat now enrolls the source chat into the new group, so Manage Chat Files and the branch selector discover the branches when opened from the original chat. Follow-ups (delete-dialog wording and a migration for chats branched before this fix) are tracked in #1522.
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#761
No description provided.