[PR #2042] [MERGED] Fix SillyTavern hidden chat import rows #5405

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2002-sillytavern-import-hidden


📝 Commits (1)

  • 78b95bd Fix SillyTavern hidden chat import

📊 Changes

1 file changed (+177 additions, -24 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/bulk_imports.rs (+177 -24)

📄 Description

Linked issue

Closes #2002

Why this change

  • SillyTavern JSONL chat import skipped rows marked is_system, which dropped hidden/system transcript messages instead of preserving them as hidden-from-AI messages.
  • Speaker-name alias lookup could also guess a character when duplicate aliases existed, which risks attaching imported chat messages to the wrong avatar.

What changed

  • Preserve importable SillyTavern is_system rows and mark their message extra with both hiddenFromAI and hiddenFromAi.
  • Keep SillyTavern speaker-name linking for character_name, name, and extra.name when the alias has one unique character match.
  • Treat duplicate character aliases as ambiguous so imported messages stay unlinked instead of guessing.
  • Add focused Rust coverage for hidden/system row preservation, unique speaker-name linking, ambiguous-name negative control, and existing no-lookup behavior.

Refactor impact

Primary owner:

  • Rust storage imports

Impact areas reviewed:

  • SillyTavern chat JSONL import
  • Bulk character/chat/group chat import speaker lookup
  • Message extra.hiddenFromAI / extra.hiddenFromAi handling

Boundary notes:

  • Touched only src-tauri import/storage logic and Rust unit coverage; no React, engine, shared API, or remote-runtime routing 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

  • Reproduced before the fix with cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_ -- --nocapture: hidden is_system row failed with Chat import JSONL must contain at least one message, and duplicate Bot aliases guessed a character ID.
  • After the fix, cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_ -- --nocapture passed: 9 targeted import tests.
  • cargo check --manifest-path src-tauri/Cargo.toml passed.
  • pnpm check passed.
  • node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/bugfix-verification.json could not run because the proof-gate helper is not present in this checkout.
  • No UI screenshot: this is backend/Rust import behavior with no meaningful visible UI state.

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 only; no new user-discoverable feature or 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

N/A. The changed behavior is covered by Rust import tests and full repo validation.


🔄 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/2042 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2002-sillytavern-import-hidden` --- ### 📝 Commits (1) - [`78b95bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78b95bd4d3275b5ecbad14f295105f423fac2182) Fix SillyTavern hidden chat import ### 📊 Changes **1 file changed** (+177 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/bulk_imports.rs` (+177 -24) </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 <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #2002 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - SillyTavern JSONL chat import skipped rows marked `is_system`, which dropped hidden/system transcript messages instead of preserving them as hidden-from-AI messages. - Speaker-name alias lookup could also guess a character when duplicate aliases existed, which risks attaching imported chat messages to the wrong avatar. ## What changed <!-- List the key changes in this PR. --> - Preserve importable SillyTavern `is_system` rows and mark their message `extra` with both `hiddenFromAI` and `hiddenFromAi`. - Keep SillyTavern speaker-name linking for `character_name`, `name`, and `extra.name` when the alias has one unique character match. - Treat duplicate character aliases as ambiguous so imported messages stay unlinked instead of guessing. - Add focused Rust coverage for hidden/system row preservation, unique speaker-name linking, ambiguous-name negative control, and existing no-lookup behavior. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> - Rust storage imports Impact areas reviewed: - SillyTavern chat JSONL import - Bulk character/chat/group chat import speaker lookup - Message `extra.hiddenFromAI` / `extra.hiddenFromAi` handling Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Touched only `src-tauri` import/storage logic and Rust unit coverage; no React, engine, shared API, or remote-runtime routing changes. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `src-tauri/src/commands/storage/imports/bulk_imports.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) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Reproduced before the fix with `cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_ -- --nocapture`: hidden `is_system` row failed with `Chat import JSONL must contain at least one message`, and duplicate `Bot` aliases guessed a character ID. - After the fix, `cargo test --manifest-path src-tauri/Cargo.toml import_st_chat_text_ -- --nocapture` passed: 9 targeted import tests. - `cargo check --manifest-path src-tauri/Cargo.toml` passed. - `pnpm check` passed. - `node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/bugfix-verification.json` could not run because the proof-gate helper is not present in this checkout. - No UI screenshot: this is backend/Rust import behavior with no meaningful visible UI state. ## 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 only; no new user-discoverable feature or 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 <!-- Add before/after screenshots or recordings for visible UI changes. --> N/A. The changed behavior is covered by Rust import tests and full repo validation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:00 +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#5405
No description provided.