fix: reset big fish initial creation progress

This commit is contained in:
2026-04-27 18:17:26 +08:00
parent 4ac4a0ca9c
commit dc619817a1
2 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
use crate::big_fish::tables::{big_fish_agent_message, big_fish_creation_session};
use crate::*;
const INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT: u32 = 0;
#[spacetimedb::procedure]
pub fn create_big_fish_session(
ctx: &mut ProcedureContext,
@@ -182,7 +184,8 @@ pub(crate) fn create_big_fish_session_tx(
owner_user_id: input.owner_user_id.clone(),
seed_text: input.seed_text.trim().to_string(),
current_turn: 0,
progress_percent: 20,
// 中文注释:欢迎语和初始锚点只建立工作台上下文,不能提前抬高创作进度。
progress_percent: INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT,
stage: BigFishCreationStage::CollectingAnchors,
anchor_pack_json: serialize_anchor_pack(&anchor_pack)
.map_err(|error| error.to_string())?,
@@ -707,6 +710,11 @@ mod tests {
}
}
#[test]
fn initial_big_fish_creation_progress_starts_from_zero() {
assert_eq!(INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT, 0);
}
#[test]
fn big_fish_direct_work_content_ignores_empty_created_session() {
let empty_session =