Fix default conversation character seed#1165
Conversation
|
Warning Review limit reached
More reviews will be available in 19 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe initialization routine now seeds a bundled "Professor Mari" character by introducing a constant identity, a dedicated seeding function, and integration into the default bundled-data flow. Legacy cleanup is refactored to address only the prior character entry. ChangesProfessor Mari Bundled Character Initialization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This one might be closeable or gotta figure out how we handle this since Mari is not a character no more, but an actual agent |
|
But needs to be changed since the seed no longer works (Mari in convo mode can't edit things hehe) |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src-tauri/src/seed_defaults.rs (1)
317-340: ⚡ Quick winAdd the regression test for preserving
__professor_mari__during startup seeding.This test proves creation, but it does not lock down the behavior changed in
remove_legacy_professor_mari. A case that pre-seeds both ids, runsseed_bundled_defaults, and asserts the canonical row survives while"professor-mari"is removed would guard the actual fix.Possible test shape
#[test] fn seeds_professor_mari_as_default_character() { let (storage, root) = temp_storage(); seed_bundled_defaults(&storage, &root.0.join("missing-default-data")) .expect("defaults should seed"); let character = storage .get("characters", PROFESSOR_MARI_ID) .expect("character lookup should succeed") .expect("Professor Mari should be seeded"); let data = character .get("data") .and_then(Value::as_str) .and_then(|raw| serde_json::from_str::<Value>(raw).ok()) .expect("character data should be stored as JSON"); assert_eq!(data["name"], "Professor Mari"); assert_eq!( data.pointer("/extensions/isBuiltInAssistant") .and_then(Value::as_bool), Some(true) ); } + + #[test] + fn preserves_canonical_professor_mari_while_removing_legacy_id() { + let (storage, root) = temp_storage(); + + seed_professor_mari_character(&storage).expect("canonical seed should succeed"); + storage + .create( + "characters", + json!({ + "id": "professor-mari", + "data": "{}", + "comment": "", + "avatarPath": Value::Null + }), + ) + .expect("legacy row should be inserted"); + + seed_bundled_defaults(&storage, &root.0.join("missing-default-data")) + .expect("defaults should seed"); + + assert!(storage + .get("characters", PROFESSOR_MARI_ID) + .expect("canonical lookup should succeed") + .is_some()); + assert!(storage + .get("characters", "professor-mari") + .expect("legacy lookup should succeed") + .is_none()); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/seed_defaults.rs` around lines 317 - 340, Add a regression test that pre-seeds both legacy and canonical rows, runs seed_bundled_defaults, and verifies the canonical PROFESSOR_MARI_ID row survives while the legacy "professor-mari" row is removed: create storage via temp_storage(), insert two character rows (one with PROFESSOR_MARI_ID and one with "professor-mari") including appropriate "data" JSON, call seed_bundled_defaults(&storage, ...), then use storage.get("characters", PROFESSOR_MARI_ID) and storage.get("characters", "professor-mari") to assert the canonical row remains and the legacy row is gone; this ensures the behavior fixed in remove_legacy_professor_mari is regression-tested.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/seed_defaults.rs`:
- Around line 12-16: In seed_bundled_defaults, reorder the operations so you
create the canonical Professor Mari before deleting the legacy row: call
seed_professor_mari_character(storage)? prior to
remove_legacy_professor_mari(storage)? (keep seed_marinara_preset(storage,
&db_root)? after both as before). This ensures if seed_professor_mari_character
fails the legacy record remains; adjust the call order in the
seed_bundled_defaults function accordingly and preserve existing ? error
propagation.
---
Nitpick comments:
In `@src-tauri/src/seed_defaults.rs`:
- Around line 317-340: Add a regression test that pre-seeds both legacy and
canonical rows, runs seed_bundled_defaults, and verifies the canonical
PROFESSOR_MARI_ID row survives while the legacy "professor-mari" row is removed:
create storage via temp_storage(), insert two character rows (one with
PROFESSOR_MARI_ID and one with "professor-mari") including appropriate "data"
JSON, call seed_bundled_defaults(&storage, ...), then use
storage.get("characters", PROFESSOR_MARI_ID) and storage.get("characters",
"professor-mari") to assert the canonical row remains and the legacy row is
gone; this ensures the behavior fixed in remove_legacy_professor_mari is
regression-tested.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ccc89562-3a73-47e1-86ea-a737ed7ccaf9
📒 Files selected for processing (1)
src-tauri/src/seed_defaults.rs
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@munimunigamer Handled this by keeping Mari’s top-bar/agent role separate from the Conversation starter behavior. This PR does not restore the old editable Professor Mari assistant chat or give the seeded character special agent powers. It only seeds a lightweight built-in I also updated the startup order so the canonical row is created before the old |
Migrated from Pasta-Devs/Marinara-Engine-Refactor#30: Pasta-Devs/Marinara-Engine-Refactor#30
Original author: @cha1latte
Target base: Pasta-Devs/Marinara-Engine refactor
Source draft state: False
Verification after port:
cargo check --manifest-path src-tauri/Cargo.tomlPort note: source updates/ tracker/evidence files were omitted because the target refactor branch removed repo-local updates guidance.
Summary
Fixes the Discord-sourced setup blocker where fresh Conversation setup had no selectable Professor Mari/default character, leaving the new-chat flow unable to reach
Characters: 1.The default seeding path now creates the built-in
__professor_mari__character when missing, and the legacy cleanup no longer deletes that active default character id on startup.Proof
Before fix, the controlled setup repro had no selectable Professor Mari result and kept Start Chatting disabled:
After fix, Professor Mari appears, can be selected, and the setup flow creates a chat with exactly one character:
Validation
CARGO_INCREMENTAL=0 cargo test --manifest-path src-tauri/Cargo.toml seeds_professor_mari_as_default_characterCARGO_INCREMENTAL=0 pnpm checkCharacters: 1Scope Notes
No remote runtime, sync server, browser hosting, auth, Docker, SSE,
/api/invoke, AI background remover, drag-and-drop, schema, version, or prompt-pipeline changes.Summary by CodeRabbit
New Features
Bug Fixes