feat: auto-process review items with AI during ingest - #627
Open
Ken-Leo wants to merge 13 commits into
Open
Conversation
…ing ingest - Add autoProcessReviews toggle to GeneralConfig in wiki-store.ts - Create src/lib/auto-review.ts with core auto-review processing logic - Processes each review item through the ingest LLM - Supports skip, create (wiki page), research (Deep Research), hold actions - Creates wiki pages with proper frontmatter when LLM generates content - Updates wiki index when pages are created - Reports results in the activity panel - Integrate auto-review into ingest pipeline (Step 5.5) after review generation - Add settings UI toggle in General section - Persist setting via project-store normalizeGeneralConfig
…ting, loadProjectLlmOverride, normalizeMineruConfig)
…filter - Auto-review create: resolve page type from LLM frontmatter type (fallback to keyword inference, then query); keep frontmatter type == folder; use stable slug filenames for typed pages and timestamped names only for query pages. - Review panel: add Auto-reviewed toggle to filter items already processed by auto-review (resolvedAction startsWith 'auto'). - Deep Research: replace ICU-plural activeBadge (unsupported by i18next) with simple templates branched on queued count.
- Review items now record a resolvedAt timestamp (set on resolve). The Auto-reviewed filter sorts most-recently-processed first for easy checking. - Activity panel pins running (in-progress) tasks above completed ones.
…view mode only) When auto-review generates a page, follow the LLM-declared frontmatter type for the canonical extra types (source, finding, thesis, methodology) in addition to the base five. Directory, slug filename, and index section header stay in lock-step. Manual review-created pages are unaffected.
Author
|
别理这个 PR,还有问题需要解决。因为知识库中的内容太多了,ingest 过程直接爆炸,review 指数级增长,人工审太慢了,想偷懒整点歪招 :) |
Add autoProcessReviews + autoReviewed keys and update research.activeBadge to the simple (non-ICU) form to satisfy i18n parity after merging origin/main.
Add two more curated custom-provider presets to the LLM settings picker so switching custom models is a single dropdown click instead of re-editing the Endpoint and model name each time: - 通义千问 Qwen (Bailian) — standard DashScope OpenAI-compatible gateway (https://dashscope.aliyuncs.com/compatible-mode/v1); distinct from the existing Bailian Coding Plan preset. - 腾讯混元 (Tencent Hunyuan) — public OpenAI-compatible gateway (https://api.hunyuan.cloud.tencent.com/v1). Both reuse the existing provider: "custom" + chat_completions wire, so no dispatch, type, or settings-UI changes are needed; they surface automatically through availableLlmPresets(). Tests cover preset fields and resolveConfig resolution.
Follow-up to the earlier curated-preset approach (Qwen/Hunyuan), which the user prefers NOT hardcoded: they want 2 custom model slots in Settings whose Endpoint and model name they fill in themselves when running the app. - Revert the hardcoded qwen/hunyuan curated presets from llm-presets.ts. - Add defaultCustomLlmPresets()/defaultCustomLlmPresetLabel(): two empty custom profiles (custom-default-1/2) labeled with the existing localized default-name convention. - Seed them in-memory in App boot only when nothing has ever been persisted (loadCustomLlmPresetsStored), so a deliberately emptied list is respected and nothing is force-written to storage. - Per-profile Endpoint/model/key/API-mode still persist under providerConfigs[id]; switching between the slots restores them instantly. - Tests: drop the curated-preset cases, add defaultCustomLlmPresets coverage (ids match the custom- persistence regex, labels localized/distinct). typecheck + 1792 mock tests pass.
# Conflicts: # src/i18n/en.json # src/i18n/it.json # src/i18n/ru.json # src/i18n/zh.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add auto-review system that processes review items generated during ingest automatically through the LLM, without requiring manual intervention.
Changes
src/lib/auto-review.ts— Core auto-review logic that processes each review item through the ingest LLMsrc/stores/wiki-store.ts— AddedautoProcessReviewsfield toGeneralConfigsrc/lib/project-store.ts— Persist the setting vianormalizeGeneralConfigsrc/lib/ingest.ts— Integrate auto-review as Step 5.5 in the ingest pipelineHow it works
After ingest generates review items, if
autoProcessReviewsis enabled, each pending review is sent to the LLM which decides:create→ Generates wiki page content with proper frontmatter and writes itskip→ Dismisses the review as not actionableresearch→ Queues Deep Research for the topichold→ Leaves for manual review when LLM is uncertainTest Plan
Notes