[PR #1840] [MERGED] Fix SillyTavern bulk import parity #5310

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-1806-st-import-parity


📝 Commits (1)

  • dcfd3da Fix SillyTavern bulk import parity

📊 Changes

1 file changed (+797 additions, -50 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/bulk_imports.rs (+797 -50)

📄 Description

Linked issue

Closes #1806

Why this change

  • SillyTavern bulk import on refactor lost legacy-compatible import context for common preset folders, one-on-one chat branch grouping, group chat metadata, speaker attribution, and transcript display/timestamp fields.

What changed

  • Scans ST presets from presets, TextGen Settings, and OpenAI Settings.
  • Builds a character lookup during bulk import so ST chat folders, group members, and speaker names can link to imported/existing characters.
  • Imports one-on-one ST chat files as grouped roleplay branches with metadata.branchName from the source file.
  • Reads groups/*.json metadata for ST group chats, preserves member names in metadata, imports group chats as individual group roleplay chats, and maps speaker names to message.characterId.
  • Preserves ST send_date when it can be parsed into createdAt, and keeps raw send_date plus extra.display_text in message extra.
  • Adds Rust regression tests for the restored scan/import parity and negative controls.

Refactor impact

Primary owner:

Rust storage imports.

Impact areas reviewed:

  • SillyTavern bulk scan/run.
  • ST chat import and chat-branch import.
  • Existing stale-selection and unsupported-background safeguards.
  • Chat/message storage fields consumed by conversation/roleplay surfaces.

Boundary notes:

  • Kept the fix inside src-tauri/src/commands/storage/imports/bulk_imports.rs; no React, engine, shared API, schema, dependency, or remote-runtime contract changes.

Pressure points touched:

  • src-tauri/src/commands/storage/imports/bulk_imports.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)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran cargo test --manifest-path src-tauri/Cargo.toml st_bulk_import --lib after the latest upstream/refactor merge: passed.
  • Codex ran cargo test --manifest-path src-tauri/Cargo.toml scan_st_folder_includes_legacy_preset_folders_and_group_metadata --lib: passed.
  • Codex ran cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_does_not_link_character_name_only_rows --lib: passed.
  • Codex ran pnpm check after installing locked dependencies in the issue worktree: passed.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json: passed.
  • Bunny review: pass before opening PR. Non-blocking limitation: this is harness/static parity proof for the storage import contract, not a live click-through of the settings modal.

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:

  • Bugfix for an existing import path; no new discovery surface.

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

N/A; this is a Rust storage/import compatibility fix with command/test proof.

Summary by CodeRabbit

  • New Features

    • Bulk imports now preserve group chat metadata including names and member information
    • Legacy preset directories are now scanned during imports
    • Message timestamps and metadata are preserved during chat imports
  • Bug Fixes

    • Fixed incorrect linking of chat speakers to imported characters in bulk operations
    • Improved character assignment population for group chats

🔄 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/1840 **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-1806-st-import-parity` --- ### 📝 Commits (1) - [`dcfd3da`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dcfd3da301a9a104b1b154fd55a5ec1c46f05faf) Fix SillyTavern bulk import parity ### 📊 Changes **1 file changed** (+797 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/bulk_imports.rs` (+797 -50) </details> ### 📄 Description ## Linked issue Closes #1806 ## Why this change - SillyTavern bulk import on `refactor` lost legacy-compatible import context for common preset folders, one-on-one chat branch grouping, group chat metadata, speaker attribution, and transcript display/timestamp fields. ## What changed - Scans ST presets from `presets`, `TextGen Settings`, and `OpenAI Settings`. - Builds a character lookup during bulk import so ST chat folders, group members, and speaker names can link to imported/existing characters. - Imports one-on-one ST chat files as grouped roleplay branches with `metadata.branchName` from the source file. - Reads `groups/*.json` metadata for ST group chats, preserves member names in metadata, imports group chats as individual group roleplay chats, and maps speaker names to `message.characterId`. - Preserves ST `send_date` when it can be parsed into `createdAt`, and keeps raw `send_date` plus `extra.display_text` in message extra. - Adds Rust regression tests for the restored scan/import parity and negative controls. ## Refactor impact Primary owner: Rust storage imports. Impact areas reviewed: - SillyTavern bulk scan/run. - ST chat import and chat-branch import. - Existing stale-selection and unsupported-background safeguards. - Chat/message storage fields consumed by conversation/roleplay surfaces. Boundary notes: - Kept the fix inside `src-tauri/src/commands/storage/imports/bulk_imports.rs`; no React, engine, shared API, schema, dependency, or remote-runtime contract changes. Pressure points touched: - `src-tauri/src/commands/storage/imports/bulk_imports.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) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `cargo test --manifest-path src-tauri/Cargo.toml st_bulk_import --lib` after the latest `upstream/refactor` merge: passed. - Codex ran `cargo test --manifest-path src-tauri/Cargo.toml scan_st_folder_includes_legacy_preset_folders_and_group_metadata --lib`: passed. - Codex ran `cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_does_not_link_character_name_only_rows --lib`: passed. - Codex ran `pnpm check` after installing locked dependencies in the issue worktree: passed. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json`: passed. - Bunny review: pass before opening PR. Non-blocking limitation: this is harness/static parity proof for the storage import contract, not a live click-through of the settings modal. ## 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: - Bugfix for an existing import path; no new discovery surface. ## 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 N/A; this is a Rust storage/import compatibility fix with command/test proof. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Bulk imports now preserve group chat metadata including names and member information * Legacy preset directories are now scanned during imports * Message timestamps and metadata are preserved during chat imports * **Bug Fixes** * Fixed incorrect linking of chat speakers to imported characters in bulk operations * Improved character assignment population for group chats <!-- 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:15:08 +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#5310
No description provided.