Commit Graph
37 Commits
Author SHA1 Message Date
Qin Haojie fd42b1ad92 feat(tasks): support task cancellation (#3577)
* feat(tasks): support task cancellation

* refactor(tasks): scope cancellation to current user

* feat(cli): support task cancellation

* refactor(tasks): make cancellation queue-aware

* refactor(tasks): simplify cancellation bookkeeping

* test: remove task cancellation coverage

* refactor(tasks): trim cancellation coordination

* fix(tasks): contain cancellation to owned work

* feat(tasks): persist resource source metadata

* fix(tasks): handle cancelled work consistently

* refactor(tasks): make completion queue-aware

* fix(tasks): persist terminal state before queue ack

* test(tasks): remove added lifecycle tests

* docs(tasks): document task cancellation
2026-07-30 20:34:27 +08:00
baojun-zhang 2f9451231e refactor(pathlock):using rust implement instead python (#3602)
* refactor(pathlock):using rust implement instead python

* refactor(pathlock):using rust implement instead python

* refactor(pathlock):using rust implement instead python

* refactor(pathlock):optimize unit test code

* refactor(pathlock):optimize encryption create func

* refactor(pathlock):avoid releasing handoffed pathlock on enqueue errors

* fix(pathlock): use owned lease capability and handle S3 create-new 409 as conflict

* fix(ragfs): keep original FsContext for multi-write metadata

* fix(pathlock): resolve lease coverage and CAS handling issues

- detect S3 conditional conflicts from structured service errors
- pass transaction leases when deleting skill roots
- let temp cleanup acquire locks for temp paths
- disambiguate cache and pathlock providers in cache tests
- update temp cleanup lease assertions

* fix(ragfs): bypass pathlock for multi-write metadata

* fix(ragfs): revert pathlock fail-fast design

* fix(ragfs):fix(ragfs): use non-blocking fcntl locks for localfs CAS

* fix(ragfs): serialize heartbeat lease refresh with release and report real conflict kind

* fix(ragfs): preserve conflict kind snapshot and drop unused test scaffolding

* fix(ragfs): preserve conflict kind snapshot and drop unused test scaffolding
2026-07-29 19:45:34 +08:00
zihengli e9c4cc97c3 refactor: extract Connector delegation and expose declarative add_type (#3591)
* refactor: delegate add_resource imports to external Connector

* refactor: delegate add_resource imports to external Connector

* refactor: extract Connector delegation and expose declarative add_type

* fix: merge main to refactor/connector_delegator

* fix: merge main to refactor/connector_delegator
2026-07-29 18:09:25 +08:00
Jiahui Zhou 34b5a88971 Feat/add resource tags (#3560)
* feat: allow tags during resource import

* feat: support uploaded resource watches with tags

* feat: add resource tag flags to CLI

* fix: reject uploaded resource watches with tags

* docs: untrack add resource tags design draft

* fix: write add_resource tags during ingest

* docs: move add_resource tags docs into resources api

* fix: tighten add_resource tag ingestion semantics

* fix: address add_resource tag review feedback

* fix: merge resource tags at vector upsert

* refactor: carry add_resource tags with ingest options
2026-07-29 15:43:06 +08:00
chenxiaobin-monkeyandchenxiaobin.monkey ff37e25cfd fix(parse): distinguish mpegts from TypeScript ts (#3574)
* fix(parse): distinguish mpegts from TypeScript ts

* fix(parse): tighten mpegts ts routing semantics

* fix(semantic): use file name for media summary type

---------

Co-authored-by: chenxiaobin.monkey <chenxiaobin.monkey@bytedance.com>
2026-07-29 13:28:25 +08:00
baojun-zhang 1841dfed81 Revert "refactor(pathlock):using rust implement instead python (#3557)" (#3597)
This reverts commit 6b538db569.
2026-07-29 11:31:41 +08:00
baojun-zhang 6b538db569 refactor(pathlock):using rust implement instead python (#3557)
* refactor(pathlock):using rust implement instead python

* refactor(pathlock):using rust implement instead python

* refactor(pathlock):using rust implement instead python

* refactor(pathlock):optimize unit test code

* refactor(pathlock):optimize encryption create func

* refactor(pathlock):avoid releasing handoffed pathlock on enqueue errors

* fix(pathlock): use owned lease capability and handle S3 create-new 409 as conflict

* fix(ragfs): keep original FsContext for multi-write metadata

* fix(pathlock): resolve lease coverage and CAS handling issues

- detect S3 conditional conflicts from structured service errors
- pass transaction leases when deleting skill roots
- let temp cleanup acquire locks for temp paths
- disambiguate cache and pathlock providers in cache tests
- update temp cleanup lease assertions

* fix(ragfs): bypass pathlock for multi-write metadata

* fix(ragfs): revert pathlock fail-fast design
2026-07-29 11:08:42 +08:00
Jiahui Zhou 5d1ba45be4 Feat/add resource processing mode (#3566)
* feat: add resource processing mode

* fix: keep semantic artifacts in vectors-only add resource

* test: support processing mode in api test client

* docs: document add resource processing mode

* fix: align processing mode after resource ingestion refactor

* feat: expose processing mode in TypeScript SDK

* fix: preserve add resource compatibility
2026-07-28 20:09:06 +08:00
zihengli a1e468b982 feat(connector): support more git like platform (#3531)
* feat(connector): support more git like platform

* feat(connector): support more git like platform

* feat(connector): support more git like platform

* feat(connector): support more git like platform

* feat(connector): support more git like platform
2026-07-28 19:17:47 +08:00
Qin Haojie 2be4bb4879 refactor(parse): 收口资源解析路由 (#3295)
* refactor(parse): simplify resource ingestion routing

Freeze resolved resource types before parser selection and remove unused parser extension paths so ingestion follows one documented route.

* fix(feishu): preserve sheet and bitable imports

Move Feishu-specific conversion into the accessor so the parser routing refactor keeps all supported resource types.

* fix(parse): keep normalized Feishu content internal

Prevent Feishu Markdown produced by the accessor from being sent through Understanding a second time.

* fix(feishu): parse bitable blocks embedded in sheets

Use spreadsheet metadata blockInfo instead of treating zero-sized Bitable blocks as empty sheets.

* fix(feishu): download bitable attachment images

* refactor(parse): remove unused document converter

* refactor(parse): unify Understanding routing

* docs(parse): mark routing classification points

* docs(parse): complete wait routing flow

* fix(parse): preserve Feishu Base URL scope

* refactor(resource): separate ingestion submission from execution

* fix(resource): reject internal ingestion fields at public entry
2026-07-27 16:47:20 +08:00
Zayn Jarvis e9daae9eba fix(resource): isolate watch URI index by account (#3440)
Sweep findings: A-01. Scope watch conflicts and subtree rewrites to the request account.
2026-07-27 11:20:24 +08:00
zihengli 468a71d00d feat(connector): Add git remote connector (#3359)
* feat(connector): Add git remote connector

* feat(connector): Add git remote connector
2026-07-24 16:52:33 +08:00
kujomyandkujomy 5ca69cb5d8 fix(resource): reject watch_interval on uploaded one-shot sources instead of silently watching a frozen snapshot (#3324)
Co-authored-by: kujomy <kujomy@users.noreply.github.com>
2026-07-19 21:37:45 +08:00
Qin Haojie d47f2106ee refactor: remove unused and deprecated APIs (#3272)
Delete dead compatibility paths and test-only helpers so unsupported APIs do not remain as accidental contracts.
2026-07-16 10:49:56 +08:00
zihengli 540139091f feat(connector): delegate add_resource imports to external Connector (#3084)
* feat(connector): delegate add_resource imports to external Connector

Opt-in integration that routes add_resource data fetching and parsing
to external Connector service; the Connector stages source data and
calls back into OV through the standard add_resource pipeline.

- add ConnectorClient wrapping the control plane's inner doc/add and
  task/info endpoints
- add [connector] config section: enable, connector/tracker endpoint
  URLs, timeout_seconds, poll_interval_ms, allowed_add_types
- route add_resource via Connector when enabled and args.add_type is
  in allowed_add_types; otherwise fall back to the standard pipeline
  with an info log
- track imports as connector_import TaskRecords and poll Connector
  task status in the background until terminal state or timeout

* fix(connector): delegate add_resource imports to external Connector
2026-07-15 16:34:23 +08:00
Zayn Jarvis cc0281ac70 fix(studio): sort limited listings by mtime (#3212)
* fix(studio): sort limited listings by mtime

* fix(client): forward ls ordering options
2026-07-13 16:17:02 +08:00
huangruitengandhuangruiteng 7d48a230e6 test(resource): isolate service fixtures (#3203)
Co-authored-by: huangruiteng <huangruiteng@bytedance.com>
2026-07-13 14:04:16 +08:00
Qin Haojie 3003ed61d7 feat(retrieval): support image search (#3093)
Add multimodal image vectorization and image query support across the server, SDKs, and CLI.
2026-07-09 16:42:53 +08:00
fujiajie666 e1db5881dc bug fix (#2971) 2026-07-03 11:06:12 +08:00
yepper 4c1ff1190b Watch sync followup (#2962)
* feat(watch): sync tasks with resource rm and mv

* feat(dependencies): add defusedxml and feedparser packages; update sgmllib3k version

* fix(watch): address review issues in move sync
2026-07-02 20:05:36 +08:00
87329714dd feat(grep): integrate VikingDB bm25 keyword search for grep engine (#2144)
* feat(grep): integrate VikingDB bm25 keyword search for grep engine

* fix(grep): address CI review feedback: max-size eviction to _count_cache, use Literal, Split regex alternation into individual keywords for bm25 (max 10)

* fix(schema): use dynamic __version__ for schema_version and handle dev suffixes in version comparison

* fix(schema): upsert data to vikingdb lack of content

* chore: add benchmark for retrieval

* fix(grep): vikingdb return 200 and no results means no matching content, not necessary to fallback to local fs

* fix(benchmark): sub uri args; add report

* refactor: code format by ruff

* optimize: move grep config (engine and switch_to_remote_threshold) to ov.conf

* optimize: auto adapt remote_return_limit by agg API; rm unnecessary params in keywords search

* fix: adjust benchmark scripts

* fix(grep): store full content for BM25; use PathScope depth; reduce redundant API calls

* refactor: new benchmark

* fix: step1 add resource by real code data

* feat(benchmark): split grep benchmark into effectiveness/performance suites with async reindex

* optimize (benchmark): adjust keywords and ground truth for testing

* fix: truncate 64KB for content field

* optimize: effectiveness add resource plainly

* optimize: change param use of SearchByKeywords from "keywords" to "query"

* optimize(benchmark): refactor effectiveness scripts

* optimize: ensure raw data for content field

* optimize: fulltext analyzer's stop-words only use symbols

* fix: adapt to new ov cli for benchmark

* optimize: reuse file content to avoid re-read AGFS file

* optimize: tune grep vikingdb defaults and refresh bm25 benchmark scripts

* optimize: benchmark client timeout

* update README

* fix: rm unused param

* fix: default values in docs

* optimize: increase truncate byte size to 1MB for content field for VikingDB

* fix(logger): harden queued stream logging (#2786)

* fix(logger): replace StreamHandler with QueueHandler+QueueListener to prevent thread deadlock

When log.output='stdout' (default) and the server is managed by systemd,
concurrent log writes can deadlock because logging.StreamHandler holds a
thread lock across stream.flush() which blocks on systemd-piped file I/O.

During session.commit() phase 2, multiple async coroutines (memory
extraction, summarization) concurrently call logger.info()/warning()
with large payloads. The first thread's flush() blocks on the pipe,
while all subsequent threads block on handler.acquire() forever.
This permanently silences the server log and prevents _write_done_file()
from executing, leaving phase 2 hanging without .done.

Fix: use QueueHandler + QueueListener from stdlib logging.handlers
(Python 3.2+). QueueHandler.emit() does queue.put(record) with no lock
or I/O, returning immediately. QueueListener has a dedicated single
thread as the sole consumer touching the real StreamHandler, making
lock contention impossible.

Changes in _create_log_handler(): stdout/stderr branches now create
a shared QueueListener with unbounded queue, returning QueueHandler
instances to callers. _build_standard_handler() delegates formatter
and filter setup to the real handler in the listener thread.

Closes: #2752

* fix(logger): harden queued stream logging

---------

Co-authored-by: njuboy11 <njuboy11@users.noreply.github.com>

---------

Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
Co-authored-by: njuboy11 <njuboy11@users.noreply.github.com>
2026-06-24 18:46:02 +08:00
Zayn Jarvis 79f7bdd184 fix(auth): align role serialization with string roles (#2728) 2026-06-19 13:30:28 +08:00
fujiajie666 ccb2924011 fix(memory): event_overview_refresh_bug (#2678)
* memory-resource记忆链接

* ov write, rm 更新 .overview

* 更新docs

* bug fix

* 更好的利用时间,摘要信息进行memory提取

* 合并

* 通过session.commit封装 --reason

* 回滚vlm代码

* 回滚rust代码

* bug fix

* 兼容peers, user 作用域

* bug fix

* bug fix

* bug fix

* bug fix

* format ruff fix

* --reason 使用同一个session_id,ruff修正

* --reason 使用同一个session_id,ruff修正,peer memory

* ruff修正

* events overview问题修正

* fix

* delete unnecessary test

* delete resource unlink

* prompt改写

* 冗余代码删除

* 更新pe

* 更新pe

* 更新

* 优化

* 清理代码
2026-06-18 16:22:41 +08:00
fujiajie666 2583da8459 Feature/wiki link (#2558)
* memory-resource记忆链接

* ov write, rm 更新 .overview

* 更新docs

* bug fix

* 更好的利用时间,摘要信息进行memory提取

* 合并

* 通过session.commit封装 --reason

* 回滚vlm代码

* 回滚rust代码

* bug fix

* 兼容peers, user 作用域

* bug fix

* bug fix

* bug fix

* bug fix

* format ruff fix

* --reason 使用同一个session_id,ruff修正

* --reason 使用同一个session_id,ruff修正,peer memory

* ruff修正
2026-06-16 23:07:30 +08:00
Qin Haojie 43a93d7ad9 feat(resource): 支持飞书用户 token 导入 (#2549)
* feat(resource): 支持飞书用户 token 导入

* feat(resource): 支持飞书用户 token watch

* fix(feishu): allow one-time user token imports

* test(feishu): trim redundant token coverage
2026-06-15 16:34:27 +08:00
Qin Haojie 058cd1f5ea feat(migration): add legacy user-peer migration (#2610)
* feat(migration): add legacy user-peer migration

* test(migration): trim redundant migration tests
2026-06-15 13:21:33 +08:00
Evo 1e731c7659 fix(reindex): stop embedding not-ready directory placeholders as L0/L1 vectors (#2434) (#2496) 2026-06-08 20:22:10 +08:00
Qin Haojie 34682c8aae fix(resources): avoid remote preflight for non-git imports (#2459)
Keep full background add-resource tasks limited to Git repositories so anti-crawler HTTP pages are parsed by the normal importer instead of failing during early source validation.
2026-06-05 15:37:48 +08:00
Qin Haojie ff258768c2 feat(memory): 引入 User/Peer 记忆隔离模型 (#2236)
* feat(memory): introduce user and peer memory isolation

Unify agent-scoped memory behavior into user-owned memory spaces, add peer_id compatibility for session and retrieval paths, and wire memory_policy through session commit flows.

* feat(memory): align session identity around peer IDs

* feat(search): pass peer id through retrieval

* refactor(memory): remove agent identity from integrations

* fix(memory): isolate peer identity from self extraction

* fix(tau2): provision benchmark user configs

* fix(auth): allow admin keys to access data APIs

* fix(openclaw): enable peer memory policy for peer roles

* fix(openclaw): resolve sender for peer recall

* refactor(session): simplify memory extraction routing

* refactor(ov-cli): reduce formatting-only diff

* refactor(message): remove unused message helpers

* refactor(retrieval): simplify peer target resolution

* refactor(namespace): remove deprecated agent namespace policy

* fix(agent): propagate peer id through integrations

* fix(auth): align integration clients with api-key mode
2026-06-05 10:55:48 +08:00
Qin Haojie 72ec6f9287 feat(resources): persist async add-resource tasks (#2433)
* feat(resources): persist async add-resource tasks

* fix(cli): surface add-resource API errors

* fix(resources): fail async task on queue errors
2026-06-04 20:14:09 +08:00
Qin Haojie b55df525bc feat(resources): bind watch tasks to imported root URI (#2378) 2026-06-02 14:01:52 +08:00
Matt Van HornandMatt Van Horn 35acbc703b fix: reindex lock acquisition fails when URI targets a file (Not a directory error) (#2228)
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-05-26 14:30:53 +08:00
zgyandqin-ctx 9b43734620 feat(task): add async task tracking for add-resource and add-skill operations (#1763)
* feat: add async task tracking for add-resource/add-skill/write operations

- Return task_id when add-resource/add-skill/write called without --wait
- Add 'ov task status <task_id>' and 'ov task list' CLI commands
- Bridge RequestWaitTracker and TaskTracker via background monitor coroutines
- Format TaskRecord timestamps as ISO 8601 in to_dict()
- Always generate telemetry_id (remove 'not wait' condition)
- Extract _create_write_task helper to eliminate code duplication
- Add unregister_wait_telemetry in _monitor_write_queue for consistency
- Update CLI async prompt from 'ov wait' to 'ov task status <task_id>'
- Add 7 new tests covering async task tracking

* refactor: remove task_id from write operations, keep only add-resource/add-skill

Write operations (write/create_file/write_memory) are primarily called
by internal flows like session commit, which have their own task tracking.
Only add-resource and add-skill are user-facing CLI commands that need
task_id for async progress tracking.

* fix: address PR review feedback

1. Fix async failure path leaking request-scoped tracker/telemetry state
   - Add monitor_started flag to ensure cleanup when monitor coroutine
     hasn't been launched yet
   - Finally block now cleans up if wait or not telemetry_id or not monitor_started

2. Fix TaskRecord timestamp API compatibility break
   - Keep original created_at/updated_at as float (backward compatible)
   - Add new created_at_iso/updated_at_iso fields with ISO 8601 strings

3. Fix ruff format lint failure on resource_service.py

4. Add regression test for async failure cleanup
   - test_add_resource_async_failure_cleans_up_tracker verifies no
     RequestWaitTracker or telemetry registry state leaks when processor
     raises before task/monitor creation

* fix: add missing unregister_wait_telemetry in add_skill finally block

* fix: remove unused imports in test_add_resource_async_failure_cleans_up_tracker

* fix: queue failure shows as completed and business error creates unreachable task

- _monitor_queue_processing: check error_count from build_queue_status,
  mark task as failed when queue processing has errors
- add_resource: skip task creation when process_resource returns
  status=error, preventing unreachable ghost tasks
- Improve test_add_resource_async_failure_cleans_up_tracker: patch
  internal processor instead of add_resource itself to cover finally
  cleanup logic
- Add test_add_skill_async_returns_task_id for add_skill coverage
- Add test_add_resource_business_error_no_task regression test
- Add test_monitor_marks_failed_on_queue_error regression test

* test: move add_skill tests to test_session_task_tracking.py

Move add_skill task tracking tests from test_api_resources.py to
test_session_task_tracking.py where other task tracking tests live,
and add sync no-task-id coverage.

* test: update async task queryable assertion to include failed status

Queue errors now correctly mark task as failed (Bug 1 fix), so the
test assertion must accept 'failed' as a valid terminal status.

* refactor: use explicit return result for business error path

* fix: remove duplicate asyncio imports in test_api_resources.py

* fix: avoid task creation on watch conflict

---------

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-05-08 15:25:47 +08:00
Qin Haojie 38c324bc97 fix(security): clean up code scanning and runtime findings (#1596)
* fix(security): clean up code scanning and runtime findings

Harden path and logging boundaries, remove noisy cleanup issues,
and keep observability failures from breaking runtime flows.

* fix(security): close werewolf and feishu validation gaps

Block the remaining path traversal bypass in the werewolf demo,
and validate Feishu hosts on the main parse() entry point.
2026-04-21 10:06:46 +08:00
MaojiaShengandopenviking ce998873f9 lisence: change the main lisence to AGPL-3.0 (#1085)
* lisence: change the main lisence from Apache-2.0 to AGPL-v3

* lisence: change the main lisence from Apache-2.0 to AGPL-v3

* lisence: change the main lisence from Apache-2.0 to AGPL-v3

---------

Co-authored-by: openviking <openviking@example.com>
2026-03-30 14:37:42 +08:00
lyfmt 4c920a6161 fix(resource): enforce agent-level watch task isolation (#762)
* fix(resource): enforce agent-level watch task isolation

* style(tests): format watch manager isolation test

* style(tests): organize resource service watch imports
2026-03-19 17:57:01 +08:00
yepper 834b808183 feat(resources): add resource watch scheduling and status tracking (#709)
* feat(resource): add watch interval support for resource monitoring

implement resource watch functionality that allows automatic monitoring and re-processing of resources at specified intervals. key features include:
- add watch_interval parameter to resource APIs
- create watch scheduler service for task execution
- handle conflict detection for active watch tasks
- provide watch status query capability
- include comprehensive tests and examples

the watch feature enables periodic automatic updates of resources without manual intervention, improving data freshness for frequently changing content

* feat(resources): add watch status tracking and improve resource processing

- Implement get_watch_status API for tracking resource watch status
- Add immediate persistence for first-time resource additions
- Improve file change detection with size comparison
- Refactor watch scheduler with better concurrency control
- Add test coverage for watch status and resource processing
- Remove unused watch manager references and clean up code

* refactor: improve code style and fix minor issues

- Simplify logging by removing redundant data copying
- Fix syntax errors in docstrings and string literals
- Add new fields to EmbeddingMsg class
- Improve line wrapping and formatting
- Update watch task storage URIs to use hidden files

* refactor(embedding_msg): simplify EmbeddingMsg constructor by removing unused fields

Remove media_uri, media_mime_type and id parameters as they are not used in the implementation

* feat(watch): add backup task recovery and simplify permission check

Add test case for recovering tasks from backup storage when primary is missing
Remove require_owner parameter from _check_permission as it's redundant with the existing role-based checks

* feat(resources): add watch_interval support for resource updates

Add watch_interval parameter to enable periodic resource updates. When target is specified, watch_interval > 0 creates/updates a watch task, while <= 0 disables it. Also simplify resource moving logic in ResourceProcessor by using direct mv operation.

* refactor(watch): remove deprecated get_watch_status functionality

remove get_watch_status method and related tests, update examples to use direct task access
update watch manager to use ConflictError for URI conflicts and include original_role in tasks
add validation for watch_interval requiring target URI

* fix(resource_service): validate watch interval before processing resource

Move watch interval validation earlier in the flow to fail fast when 'to' parameter is missing

* refactor(resource_processor): remove redundant temp_uri assignment
2026-03-18 15:16:14 +08:00