Browse Source

fix(settings): 删除已架空的深度模式审稿开关

deepChapterReview 已被快速/标准/严格工作流取代,运行时不再读取。
不再保留废弃字段,避免下次保存把死配置写回磁盘。

Co-authored-by: darknessomi <darknessomi@users.noreply.github.com>
Cursor Agent 2 months ago
parent
commit
503e14770d

+ 0 - 2
src/i18n/en.json

@@ -1373,8 +1373,6 @@
       "reviewBeforeSaveHint": "When enabled, canon chapter saves first call the review model to check continuity, canon conflicts, and issues that should be fixed.",
       "deepPreviousChaptersAnalysis": "Prior-chapters analysis (extra call)",
       "deepPreviousChaptersAnalysisHint": "When enabled, standard/strict generation of chapter 2+ first reads and LLM-analyzes the full text of the previous chapters — stronger continuity, but one extra call per chapter and more tokens. Fast mode always skips this. When off, recent summaries and the previous chapter ending from the memory library are still injected. Off by default to save tokens.",
-      "deepChapterReview": "Deep mode: AI review & auto-revision",
-      "deepChapterReviewHint": "Superseded by the Fast/Standard/Strict workflow selector: strict always reviews and revises; fast and standard skip. Kept only for old saved configs.",
       "reviewReasoningEffort": "Review thinking effort",
       "reviewReasoningEffortHint": "Controls how deeply the AI review (including six-dimension review) reasons. Lower effort is cheaper and faster but weakens the continuity and canon-conflict gate. High by default.",
       "taskModelsTitle": "Per-Step Models (Novel Writing)",

+ 0 - 2
src/i18n/zh.json

@@ -1242,8 +1242,6 @@
       "reviewBeforeSaveHint": "开启后,保存正式章节前会先调用审稿模型检查连贯性、设定冲突和需要修复的问题。",
       "deepPreviousChaptersAnalysis": "前情分析(额外调用)",
       "deepPreviousChaptersAnalysisHint": "开启后,标准/严格模式在生成第2章及以后时会先读取并用 LLM 分析前几章完整正文,连贯性更强但每章多一次调用、更费 Token。快速模式始终跳过。关闭时仍会注入记忆库的近期摘要与上一章结尾。默认关闭以省 Token。",
-      "deepChapterReview": "深度模式:AI 审稿与自动返修",
-      "deepChapterReviewHint": "此开关已被聊天栏的快速/标准/严格模式取代:严格模式始终审稿与返修,快速和标准模式跳过。保留仅兼容旧配置。",
       "reviewReasoningEffort": "审稿思考档位",
       "reviewReasoningEffortHint": "控制 AI 审稿(含六维审查)的思考深度。档位越低越省 Token、越快,但连贯性与设定冲突的把关会变弱。默认「高」。",
       "taskModelsTitle": "分环节指定模型(写小说)",

+ 2 - 2
src/lib/changelog.ts

@@ -13,11 +13,11 @@ const THREE_POINT_ONE_FIVE_CHANGELOG: ChangelogEntry = {
   highlights: {
     en: [
       "[MiMo Thinking Fix] Fixed Xiaomi MiMo models hitting the thinking token cap and producing no response. MiMo is now correctly recognized as a chat-template thinking model, so the auto-retry with thinking disabled works properly. Also added max_tokens protection for all OpenAI-compatible thinking models (Qwen3, MiMo, DeepSeek, GLM-5+) to ensure the response has enough room for both reasoning and answer.",
-      "[Writing Settings] Wired de-AI batch concurrency to the chapter queue, clamped chapter target length to 1000–10000 (matching the writing-settings UI), persisted the revision-feedback window and chat history immediately, applied retrieval Top-K to graph search, enabled prior-chapter analysis in standard mode, and removed the dead AI-review toggle superseded by workflow modes.",
+      "[Writing Settings] Wired de-AI batch concurrency to the chapter queue, clamped chapter target length to 1000–10000 (matching the writing-settings UI), persisted the revision-feedback window and chat history immediately, applied retrieval Top-K to graph search, enabled prior-chapter analysis in standard mode, and deleted the dead deep-mode AI-review switch (strict/standard/fast already own that decision).",
     ],
     zh: [
       "【小米 MiMo 思考上限修复】修复使用小米 MiMo 模型时频繁提示「思考上限」、只输出思考内容不出正文的问题。MiMo 现在被正确识别为 chat_template_kwargs 类型思考模型,自动关闭思考重试可正常生效;同时为所有 OpenAI 兼容思考模型(Qwen3、MiMo、DeepSeek、GLM-5+)增加 max_tokens 输出保护,确保思考和正文都有足够 token 空间,不再因思考耗尽输出配额而空响应",
-      "【写作设置生效修复】批量去 AI 味并发数接到当前章节队列;单章目标字数钳制为 1000–10000(与写作设置 UI 一致);修改反馈窗口与对话历史立即落盘;检索 TOPK 同时约束图谱检索;前情分析在标准模式也可生效;移除已被工作流模式架空的「AI 审稿与自动返修」开关",
+      "【写作设置生效修复】批量去 AI 味并发数接到当前章节队列;单章目标字数钳制为 1000–10000(与写作设置 UI 一致);修改反馈窗口与对话历史立即落盘;检索 TOPK 同时约束图谱检索;前情分析在标准模式也可生效;删除已被工作流模式架空的「深度模式:AI 审稿与自动返修」开关(含配置字段)",
     ],
   },
 };

+ 1 - 27
src/lib/novel/deep-chapter-generation.spec.ts

@@ -1,5 +1,5 @@
 import { describe, expect, it, vi } from "vitest"
-import { DEFAULT_NOVEL_CONFIG, useWikiStore, type LlmConfig } from "@/stores/wiki-store"
+import { useWikiStore, type LlmConfig } from "@/stores/wiki-store"
 import type { AgentActivityEvent } from "@/lib/agent/types"
 import type { ChatMessage, RequestOverrides, StreamCallbacks } from "@/lib/llm-client"
 import type { ContextPack } from "./context-engine"
@@ -1391,32 +1391,6 @@ describe("runDeepChapterGeneration", () => {
     expect(strictDeps.reviewChapter).toHaveBeenCalled()
   })
 
-  it("keeps AI review mandatory in strict mode even when the global deep chapter review switch is off", async () => {
-    const previousNovelConfig = useWikiStore.getState().novelConfig
-    useWikiStore.setState({
-      novelConfig: {
-        ...DEFAULT_NOVEL_CONFIG,
-        ...previousNovelConfig,
-        deepChapterReview: false,
-      },
-    })
-    try {
-      const deps = createDeps()
-      const events: Array<{ name: string; result?: string }> = []
-
-      await runDeepChapterGeneration(
-        { projectPath: "E:/Novel", userRequest: "生成第三章", chapterNumber: 3, llmConfig, aiWorkflowMode: "strict" },
-        { onWorkflowEvent: (event) => events.push(event) },
-        deps,
-      )
-
-      expect(deps.reviewChapter).toHaveBeenCalled()
-      expect(events.find((event) => event.name === "chapter_review" && event.result)?.result).toContain("AI 审稿完成")
-    } finally {
-      useWikiStore.setState({ novelConfig: previousNovelConfig })
-    }
-  })
-
   it("emits visible workflow events for the chapter multi-task loop", async () => {
     const deps = createDeps()
     const events: Array<{ type: string; id: string; name: string; title: string; result?: string }> = []

+ 0 - 1
src/lib/novel/deep-chapter-generation.ts

@@ -1026,7 +1026,6 @@ export async function runDeepChapterGeneration(
     "检查正文完整性、剧情连续性、人物一致性和阻断问题。",
   );
   // 审稿由工作流模式决定:严格模式始终审稿,快速/标准模式跳过。
-  // 旧的「深度模式审稿」开关已被模式选择器取代。
   const shouldRunAiReview = workflowProfile.runAiReview;
   if (!hasCheckpointReview(resumeCheckpoint)) {
     if (!shouldRunAiReview) {

+ 0 - 1
src/lib/project-store.integration.test.ts

@@ -135,7 +135,6 @@ function makeNovelConfig(overrides: Partial<NovelConfig> = {}): NovelConfig {
     autoIngestOnSave: true,
     autoExtractOnImport: true,
     deepPreviousChaptersAnalysis: false,
-    deepChapterReview: true,
     reviewReasoningEffort: "high",
     writingModel: "claude-4-sonnet",
     reviewModel: "claude-4-sonnet",

+ 0 - 1
src/lib/project-store.ts

@@ -801,7 +801,6 @@ function normalizeNovelConfig(
     autoIngestOnSave: config.autoIngestOnSave ?? DEFAULT_NOVEL_CONFIG.autoIngestOnSave,
     autoExtractOnImport: config.autoExtractOnImport ?? DEFAULT_NOVEL_CONFIG.autoExtractOnImport,
     deepPreviousChaptersAnalysis: config.deepPreviousChaptersAnalysis ?? DEFAULT_NOVEL_CONFIG.deepPreviousChaptersAnalysis,
-    deepChapterReview: config.deepChapterReview ?? DEFAULT_NOVEL_CONFIG.deepChapterReview,
     reviewReasoningEffort: config.reviewReasoningEffort ?? DEFAULT_NOVEL_CONFIG.reviewReasoningEffort,
     defaultLlmModel: config.defaultLlmModel ?? DEFAULT_NOVEL_CONFIG.defaultLlmModel,
     writingModel: config.writingModel ?? DEFAULT_NOVEL_CONFIG.writingModel,

+ 17 - 1
src/lib/writing-settings-effectiveness.spec.ts

@@ -54,6 +54,18 @@ const chatPanel = readFileSync(
   resolve(__dirname, "../components/chat/chat-panel.tsx"),
   "utf8",
 )
+const wikiStore = readFileSync(
+  resolve(__dirname, "../stores/wiki-store.ts"),
+  "utf8",
+)
+const zhI18n = readFileSync(
+  resolve(__dirname, "../i18n/zh.json"),
+  "utf8",
+)
+const enI18n = readFileSync(
+  resolve(__dirname, "../i18n/en.json"),
+  "utf8",
+)
 
 describe("writing settings still reach runtime", () => {
   it("persists novelConfig, feedback window, and chat history immediately from the writing settings panel", () => {
@@ -97,8 +109,12 @@ describe("writing settings still reach runtime", () => {
     expect(deepChapter).not.toContain("runPreviousChaptersAnalysis")
   })
 
-  it("does not expose the dead deepChapterReview toggle that workflow modes already replaced", () => {
+  it("deletes the dead deepChapterReview switch instead of keeping an unused config field", () => {
     expect(novelSection).not.toContain("deepChapterReview")
+    expect(wikiStore).not.toContain("deepChapterReview")
+    expect(projectStore).not.toContain("deepChapterReview")
+    expect(zhI18n).not.toContain("deepChapterReview")
+    expect(enI18n).not.toContain("deepChapterReview")
     expect(deepChapter).toContain("const shouldRunAiReview = workflowProfile.runAiReview")
     expect(deepChapter).not.toContain("novelConfig.deepChapterReview")
   })

+ 0 - 3
src/stores/wiki-store.ts

@@ -317,8 +317,6 @@ export interface NovelConfig {
   autoExtractOnImport: boolean
   /** 前情分析:读取并 LLM 分析前几章完整正文。快速模式始终跳过;标准/严格模式跟随此开关。关闭时记忆库的近期摘要与上一章结尾仍会注入(默认关)。 */
   deepPreviousChaptersAnalysis: boolean
-  /** @deprecated 已被聊天栏工作流模式取代:严格模式始终审稿,快速/标准模式跳过。保留字段仅兼容旧配置。 */
-  deepChapterReview: boolean
   /** 审稿(含六维审查)使用的 reasoning 档位。下调可省审稿推理 Token,但连贯性把关会变弱(默认 high)。 */
   reviewReasoningEffort: "low" | "medium" | "high"
   /** 默认模型(工作流):拆文库、剧情推演室、去重等。空字符串表示跟随 AI 会话模型。 */
@@ -349,7 +347,6 @@ export const DEFAULT_NOVEL_CONFIG: NovelConfig = {
   autoIngestOnSave: true,
   autoExtractOnImport: true,
   deepPreviousChaptersAnalysis: false,
-  deepChapterReview: true,
   reviewReasoningEffort: "high",
   defaultLlmModel: "",
   writingModel: "",