fix(memex): add Feishu OAuth support, fix async deadlock, and adapt for local dev#237
Merged
MaojiaSheng merged 25 commits intovolcengine:mainfrom Feb 21, 2026
Merged
Conversation
- CLI-based personal knowledge assistant powered by OpenViking - Knowledge management: add files, directories, URLs - Intelligent Q&A with RAG and multi-turn conversation - Knowledge browsing with L0/L1/L2 context layers - Semantic search with intent analysis - Feishu/Lark MCP integration for document import - Rich CLI interface with prompt_toolkit
- Fix /tree command to handle dict list return type - Fix RAG recipe to load LLM config from ov.conf instead of removed attributes - Fix find/search methods to use 'limit' parameter instead of 'top_k'
- Strip trailing slashes from URIs to prevent path errors - Improve tree display to handle dict list return type
- Add recursive directory import with file type filtering - Improve error handling for add_resource results - Add proper cleanup on exit to kill AGFS processes - Fix import_dir to use new directory handling logic
…ll content - Lower default score_threshold from 0.3 to 0.1 (actual scores are 0.17-0.25) - Fix build_context to use client.read() for full content instead of just abstract - This fixes the issue where queries returned no results despite data being indexed
…, smart context loading
…ction, hybrid search, rerank - P0: Integrate OpenViking Session for context-aware search with IntentAnalyzer - P1: Add session.commit() for long-term memory extraction (6 categories) - P2: Implement hybrid search strategy (find for simple, search for complex) - P3: Add LLM-based rerank for improved result relevance New CLI commands: /session, /commit, /memories
- abstract() only works for directories, not files - Changed to try read() first, then abstract() for directories - This fixes the issue where only 1 result was returned instead of 5
- Remove high_confidence_threshold and low_confidence_threshold - Remove rerank (use OpenViking score directly) - Remove confidence hints from system prompt - Unified content loading: all results get full content (2000 chars) - Simpler build_context without confidence logic
…xpansion - Remove _should_use_deep_search and find() auto-selection - Always use search() with session for IntentAnalyzer - Add _expand_query() to expand Chinese queries with English keywords - Example: 'OpenViking 怎么安装' → 'OpenViking 怎么安装 installation setup install pip' - Installation doc now ranks #1 (was not in top 5 before)
- Add wait_processed() after session commit for memory embedding - Add OpenAI api_base default (https://api.openai.com/v1) - Remove [:2000] content truncation that caused unexpected results
- Add -v/--verbose flag to control logging (default: off) - Fix Quick Start: add cd examples/memex step - Update CLI Options to match actual parameters
…x' works pyproject.toml was missing [build-system], causing uv to skip entry point installation. Also fixed entry point from 'cli:main' to 'memex.cli:main' and converted all bare imports to relative imports. Updated README to match actual project structure.
openviking creates per-module loggers with their own handlers and propagate=False, making root logger level ineffective. Patch get_logger to enforce WARNING level for all current and future openviking loggers.
- Implement OAuth 2.0 authorization code flow for user access token - Add support for manual code entry (for headless/SSH environments) - Fix tool names (underscore format) and parameter structure (nested) - Replace MCP file listing with REST API search (bypassing MCP limitations) - Add /feishu-login and improve /feishu-list commands
- Implement /feishu-ls using drive.v1.file.list API - Allows browsing user's 'My Space' (root) and subfolders - Requires user access token via /feishu-login - Updated docs with redirect URI configuration step
# Conflicts: # examples/memex/README.md # examples/memex/cli.py # examples/memex/client.py # examples/memex/commands/stats.py # examples/memex/pyproject.toml
- Fix VLM backend config fallback (provider field support) - Use find() instead of search() to avoid IntentAnalyzer deadlock - Add uv source override for local openviking editable install - Replace deleted logger monkey-patch with standard logging - Update README: add missing commands, OpenAI config example, fix structure
Session methods call run_async() from within code already running on the shared background event loop, causing a deadlock when search() is used with session context. Fix by detecting a running event loop via asyncio.get_running_loop() and spawning a temporary thread+loop for the nested coroutine.
|
|
MaojiaSheng
approved these changes
Feb 21, 2026
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.
Description
Enhance the Memex Feishu integration with full OAuth support, MCP protocol compliance, and fix several issues for local development with OpenAI provider. Also fix a re-entrant deadlock in
run_async()that blocked session-aware search.Type of Change
Changes Made
Feishu Integration Enhancements (
feishu.py)initialize+notifications/initialized) on server startdocx_v1_document_rawContent) and nestedpath/data/paramsargumentscontent[0].textJSON wrapper incall_tool()responses/feishu-login) with local callback server and token refreshlist_user_files()for browsing user's drive / My Spacesearch_wiki()for wiki node searchsearch_documents()to use REST API directly (works with both user and tenant tokens)/feishu-login,/feishu-ls,/feishu-list,/feishu-toolsAsync Deadlock Fix (
openviking_cli/utils/async_utils.py)run_async()re-entrant safe: detect running event loop viaasyncio.get_running_loop()and spawn a temporary thread+loop for nested coroutinesSession.get_context_for_search()callsrun_async()from within code already running on the shared background event loop, causing the loop thread to block waiting on itselfLocal Dev Fixes
backend→providerfield →"openai"default (config.py)client.search()with session support for multi-type retrieval (memory + resource + skill) (rag/recipe.py)[tool.uv.sources]for local editable openviking install (pyproject.toml)requires-pythonfrom>=3.13to>=3.10for broader compatibilitymemex.cli:mainwith setuptoolsopenviking.utils.loggermonkey-patch with standardloggingmodule (cli.py)Documentation (
README.md)/stat,/glob,/session,/commit,/memories,/feishu-search,/feishu-toolsTesting
Checklist