diff --git a/backend/pyproject.toml b/backend/pyproject.toml index b6a3e9c2..0d967c46 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -17,7 +17,6 @@ include = ["src*"] [tool.pytest.ini_options] pythonpath = ["."] asyncio_mode = "auto" -testpaths = ["tests", "src/plugins"] markers = [ "integration: Integration tests requiring external services (Docker, Testcontainers, Superset). Use --run-integration to enable.", ] diff --git a/backend/src/plugins/translate/__tests__/test_batch_classify_persist.py b/backend/src/plugins/translate/__tests__/test_batch_classify_persist.py index 192ce6f2..6905fc68 100644 --- a/backend/src/plugins/translate/__tests__/test_batch_classify_persist.py +++ b/backend/src/plugins/translate/__tests__/test_batch_classify_persist.py @@ -394,6 +394,9 @@ class TestClassifyCacheSourceLang: # #endregion test_case_insensitive_detected_lang_matching +# #endregion TestClassifyCacheSourceLang + + # ── _persist_pre() Tests ─────────────────────────────────────────── diff --git a/backend/src/plugins/translate/_token_budget.py b/backend/src/plugins/translate/_token_budget.py index ec214fe6..f35d56b7 100644 --- a/backend/src/plugins/translate/_token_budget.py +++ b/backend/src/plugins/translate/_token_budget.py @@ -24,9 +24,9 @@ DEFAULT_CONTEXT_WINDOW = 64000 DEFAULT_MAX_OUTPUT_TOKENS = 16384 # #endregion DEFAULT_MAX_OUTPUT_TOKENS -# @BRIEF CoT reasoning overhead tokens for DeepSeek models (~2000 tokens for chain-of-thought). # #region REASONING_OVERHEAD [TYPE Constant] # @ingroup Translate +# @BRIEF CoT reasoning overhead tokens for DeepSeek models (~2000 tokens for chain-of-thought). REASONING_OVERHEAD = 2000 # #endregion REASONING_OVERHEAD @@ -53,6 +53,7 @@ PROVIDER_DEFAULTS: dict[str, dict[str, int]] = { # #endregion PROVIDER_DEFAULTS # #region OUTPUT_PER_ROW_PER_LANG [TYPE Constant] # @ingroup Translate +# @BRIEF Output tokens budgeted per row per target language for batch sizing. # Increased from 120 to 200 because production logs show finish_reason=length # even with 120 tok/row/lang — long source texts produce long translations. @@ -71,9 +72,9 @@ JSON_OVERHEAD_PER_ROW = 50 # Increased from 300 to 600 to account for longer template, system msg, and dict preamble. PROMPT_BASE_TOKENS = 600 # #endregion PROMPT_BASE_TOKENS -# @BRIEF Cap for dictionary tokens in estimation to avoid overestimating. # #region DICT_TOKENS_PER_ENTRY [TYPE Constant] # @ingroup Translate +# @BRIEF Cap for dictionary tokens in estimation to avoid overestimating. DICT_TOKENS_PER_ENTRY = 20 # #endregion DICT_TOKENS_PER_ENTRY