Add FSRS config key and disable FSRS in legacy scheduler tests

- Add FSRS boolean config key to protobuf definition
- Update generated Rust config mapping code
- Disable FSRS in test_schedv3.py tests to maintain legacy scheduler behavior
- These tests are designed for the old SM-2 algorithm, not FSRS
This commit is contained in:
Jarrett Ye 2025-10-15 03:13:38 +08:00
parent da9dd4b315
commit e1d8bca31e
3 changed files with 5 additions and 0 deletions

View file

@ -57,6 +57,7 @@ message ConfigKey {
LOAD_BALANCER_ENABLED = 26; LOAD_BALANCER_ENABLED = 26;
FSRS_SHORT_TERM_WITH_STEPS_ENABLED = 27; FSRS_SHORT_TERM_WITH_STEPS_ENABLED = 27;
FSRS_LEGACY_EVALUATE = 28; FSRS_LEGACY_EVALUATE = 28;
FSRS = 29;
} }
enum String { enum String {
SET_DUE_BROWSER = 0; SET_DUE_BROWSER = 0;

View file

@ -10,6 +10,7 @@ from typing import Dict
import pytest import pytest
from anki import hooks from anki import hooks
from anki.config import Config
from anki.consts import * from anki.consts import *
from anki.lang import without_unicode_isolation from anki.lang import without_unicode_isolation
from anki.scheduler import UnburyDeck from anki.scheduler import UnburyDeck
@ -19,6 +20,8 @@ from tests.shared import getEmptyCol as getEmptyColOrig
def getEmptyCol(): def getEmptyCol():
col = getEmptyColOrig() col = getEmptyColOrig()
# Disable FSRS for legacy scheduler tests
col.set_config_bool(Config.Bool.FSRS, False, undoable=False)
return col return col

View file

@ -40,6 +40,7 @@ impl From<BoolKeyProto> for BoolKey {
BoolKeyProto::LoadBalancerEnabled => BoolKey::LoadBalancerEnabled, BoolKeyProto::LoadBalancerEnabled => BoolKey::LoadBalancerEnabled,
BoolKeyProto::FsrsShortTermWithStepsEnabled => BoolKey::FsrsShortTermWithStepsEnabled, BoolKeyProto::FsrsShortTermWithStepsEnabled => BoolKey::FsrsShortTermWithStepsEnabled,
BoolKeyProto::FsrsLegacyEvaluate => BoolKey::FsrsLegacyEvaluate, BoolKeyProto::FsrsLegacyEvaluate => BoolKey::FsrsLegacyEvaluate,
BoolKeyProto::Fsrs => BoolKey::Fsrs,
} }
} }
} }