Commit Graph
44 Commits
Author SHA1 Message Date
Zayn Jarvis 4ffd255d1a fix(cli): preserve server config sections and restrict ov.conf permissions in setup wizard (#3427)
* fix(cli): preserve server config sections and restrict ov.conf permissions in setup wizard

Sweep findings B-02 and B-10

* fix(cli): secure setup wizard update edge cases

Sweep findings: B-02, B-10. Normalize wizard-owned authentication and atomically publish restrictive backups.

* fix(review): preserve remote auth mode

Addresses blocking review finding on #3427.
2026-07-25 12:49:48 +08:00
ef4d97ebe3 feat(snapshot): support path-filtered commit history (#3271)
* feat(snapshot): support path-filtered commit history

* refactor(snapshot): reuse SDK git log implementation

* fix(snapshot): harden path-filtered log resource limits

* chore: remove stale SDK lock entry

---------

Co-authored-by: zhanghaoyu.la <zhanghaoyu.la@bytedance.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-07-16 19:53:40 +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
baojun-zhang 6a33ebb7ca Optimize glob walkdir (#3013)
* feat(storage): optimize glob func

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* feat(rgafs): implement paged glob traversal without full tree materialization

* fix(localfs): offload blocking fs operations to spawn_blocking

* feat(glob): cap glob api default node_limit at 256

* feat(sdk): add node_limit options for glob in python and go SDKs
2026-07-06 21:39:16 +08:00
t0saki d9a9b3d2e1 fix(vlm): set Ollama num_ctx and disable thinking for local memory extraction (#2992)
Ollama defaults to a 4096-token context window and silently truncates any
longer prompt to fit. OV's memory-extraction prompt is ~5.4k tokens even for a
short session, so the conversation (which sits at the top of the prompt) is
dropped and the model receives only the format spec. It then returns an empty
`{"memories": []}` with no error, so local Ollama VLMs extract nothing
regardless of model size. Thinking models compound this by emitting only
reasoning and stalling.

- litellm_vlm: for `ollama/` and `ollama_chat/` models, default `num_ctx`
  to 16384 and disable thinking via `extra_body`. Both are overridable through
  `extra_request_body`, and the change is gated to Ollama routes so other
  providers are untouched. This fixes extraction, intent analysis, and the
  query planner for every local Ollama config, not just wizard-generated ones.
- setup_wizard: write the same `extra_request_body` explicitly in the Ollama
  VLM config block so the setting is visible and tunable in ov.conf.
- setup_wizard: drop the qwen3.5:2b VLM preset. 2B models "extract" the
  prompt's few-shot examples as fabricated memories; qwen3.5:4b is the smallest
  model that extracts cleanly. RAM-tier defaults are reindexed accordingly.

Verified end to end: with num_ctx raised, prompt_eval goes from 4096
(truncated) to the full 5441 tokens and qwen3.5:4b extracts the correct
memories; without it, extraction returns empty.
2026-07-06 12:09:30 +08:00
t0saki 7ee826e165 feat(init): TUI-style setup wizard with separate embedding/VLM config (#2952)
* feat(init): TUI-style setup wizard with separate embedding/VLM config

Rework `openviking-server init` into an arrow-key TUI (rich chrome +
termios raw-mode menus, with a numbered-input fallback for non-TTY).

- Two-step main flow: Step 1 embedding, Step 2 VLM, so mixing cloud and
  local (one online, one local) is visible in the main flow rather than
  hidden in submenus.
- Recommended all-Ollama one-shot config (embedding + VLM + query
  planner) sized by available RAM.
- Refreshed VLM presets (qwen3.6:27b / qwen3.6:35b).
- Show current configuration at every level: overview panel, menu-item
  "(now: ...)" descriptions, and per-section "Current: ..." lines.
- Seed every prompt default from the existing config; offer to keep
  existing secrets (masked); show an old -> new diff before saving.
- Server & auth step now covers host + port, and switching to a
  non-local binding requires (and can generate) a root_api_key.
- Left/right arrow navigation: <- back a step, -> confirm.
- Auto-offer init on a bare `openviking-server` when no config exists;
  disk-space check before pulling models; post-save doctor validation
  with optional server start.

* fix(init): preserve existing config in wizard update flow

Address Copilot review feedback on the setup wizard:

- Cloud embedding update now keeps a non-default api_base (proxy /
  OpenAI-compatible endpoint) when the provider is unchanged, instead
  of always resetting to the provider preset default.
- Custom OpenAI-compatible VLM branch seeds API base and model from the
  existing config and routes key collection through _prompt_vlm_api_key,
  so keep-existing-key / env-var reuse applies there too.
- server_bootstrap init auto-offer now catches OSError alongside
  EOFError, matching the wizard's own prompt helpers, so non-standard
  pipe/terminal contexts fall through silently instead of crashing.
2026-07-02 17:24:35 +08:00
0102a48c2a fix(skills): now we allow viking://agent/skills again, and optimize CLI for skills (#2813)
* chore: clear unused files

* fix(tests): fix unit test

* refactor(auth): introduce plugin-based authentication architecture

Replace the monolithic `openviking/server/auth.py` with an extensible
plugin-based auth system. This refactor extracts the three built-in modes
(`dev`, `api_key`, `trusted`) into separate `AuthPlugin` implementations,
adds a registry for third-party plugins, and preserves all existing behavior
while enabling custom authentication backends (e.g. LDAP, OIDC, mTLS).

Key changes:
- **New public API**: `AuthPlugin` (ABC) and `register_auth_plugin` decorator.
- **New registry**: `AuthPluginRegistry` supports runtime registration.
- **Built-in plugins**: `DevAuthPlugin`, `ApiKeyAuthPlugin`, `TrustedAuthPlugin`.
- **Config change**: `auth_mode` widened from `Literal` to `str` for custom modes.
- **Validation delegated**: `validate_server_config()` now delegates to the active
  plugin's `validate_config()`, preserving existing validation semantics.
- **Router compatibility**: All existing `require_*` decorators and `resolve_identity`
  / `get_request_context` dependencies remain unchanged. Routers import the same
  symbols from `openviking.server.auth`.
- **Tests**: `conftest.py` manually wires the DevAuthPlugin in ASGI tests (lifespan
  not triggered). `test_auth.py` expanded with plugin registration and validation tests.
- **Docs**: `04-authentication.md` (en/zh) updated with plugin registration examples.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>

* fix(tests): fix trusted mode test

* fix(tests): fix unit test

* fix(cli): remove unexisted transaction observer

* docs: update skills definition

* docs: update skills definition

* docs: update skills definition

* docs: update skills definition

* fix(skills): now we allow viking://agent/skills again, and optimize CLI for skills

* docs(skills): use -p instead of --parent in agent skills examples

Align the `ov skills add` examples in the context-types and viking-uri
docs with the short flag `-p` introduced for `ov skills list/find/show`,
so all four user-facing examples consistently demonstrate the short form
when targeting `viking://agent/skills`.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>

* fix(tests): error check for api key

* fix(tests): unit test wait until resource not busy

* fix(tests): unit test wait until resource not busy

* fix(sdk): args form in skills find

* fix(skills): pass target uri in request body

---------

Co-authored-by: claude-sonnet-4-6 <noreply@anthropic.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-06-25 14:36:06 +08:00
Haoyu Zhangandzhanghaoyu.la aa53e7aede feat: 实现 commit、restore、show 文件系统多版本管理功能 (#2756)
* feat: 实现 commit、restore、show 文件系统多版本管理功能

fix: 修复commit时删除文件

fix: commit 的 fast path 1 添加 Racy-clean 机制

fix: 将 sdk 中的 git 命令改为 snapshot 命令,同步修改单测

fix: 多版本管理的文件存储目录改为 .ovgit

feat: snapshot cli 渲染

fix: 修复 restore 时将删除的文件回滚时,目录不存在的问题

feat: restore 命令的 project_dir 参数改为可选,不传时默认全目录回滚

feat: 更新文档

fix: 删除暂未使用的配置参数

feat: 新增示例脚本

fix: 修复示例代码

fix: 修复 restore 返回的 task id 任务完成状态

feat: 在 restore 修改文件系统时加锁

fix: fix openviking_sdk

* feat: 将git多版本管理功能改为默认打开,并复用agfs的配置参数作为默认值

* fix: restore 命令改为先完成 ref 一致性协议再写回 VFS;object store 并发改为使用唯一 temp path

* fix: 在 git 配置检验层去除未实现的cas_mode = "redis_lock"模式

* fix: 在 Rust GitService 边界统一校验 account

* fix: 当前commit不支持通过 path 传入目录,增加报错信息

* fix: 将git文件默认存储路径统一为 .ovgit

* fix: restore 时写入 VFS 失败时返回详细的报错,并继续触发 reindex

* fix: 校验 commit、restore、show 的路径

* feat: 实现 commit 时指定目录

---------

Co-authored-by: zhanghaoyu.la <zhanghaoyu.la@bytedance.com>
2026-06-25 11:28:04 +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
DuTao 027e21bb7e feat(bot): Simplify the bot auth check, support ov's trusted auth_mode. (#2769)
* 增加bot的配置校验。优化bot的逻辑

* 去除 mode的逻辑依赖

* 调整dev的提示文案

* fix:
1. trusted localhost允许 without root key;
2. 调整文档废弃root_api_key;

* 现在 proxy 生成 openviking_connection 时会带上当前 OpenViking server 的 server_url,VikingBot 收到 request-scoped connection 后会优先使用这个 URL,不会再 fallback 到静态 bot.ov_server.server_url 去请求另一台 server。

* fix ipv6

* fix trusted模式chat指令使用root_api_key
2026-06-23 11:59:35 +08:00
Zayn Jarvis 730e64f3d3 test(cli): extend pack add-resource timeout & minor refactoring on tests (#2715)
* test(cli): extend pack add-resource wait timeout

* test(cli): centralize add-resource timeout

* test(cli): simplify resource mutation tests
2026-06-22 10:26:27 +08:00
9506101bd3 feat(retrieval): recommend ov_intent_analysis_sft v7_q8 query planner (#2624)
Promote ov_intent_analysis_sft:v7_q8 to the recommended local Ollama
query-planner model. Add the bundled retrieval.ov_intent_analysis_sft_v7
prompt and map v7_q8 to it (v4_q8 mapping kept). Update the setup wizard
presets (v7 recommended, v4 retained, v1 dropped) and the configuration
docs (EN/ZH). Extend tests to cover the v7 mapping.

Co-authored-by: guoxuter <j7azwflq4h@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:30:35 +08:00
Qin Haojie fff86058ac feat(core): 支持用户和 peer 级内容目标 (#2564)
* feat(core): support user-scoped content targets

* fix(core): handle scoped skill updates

* fix(core): keep skills user scoped

* chore: drop incidental formatting changes

* fix(storage): revert shared parent existence helper

* docs: update user content target docs

* fix(resource): canonicalize watch cancellation targets
2026-06-12 17:52:44 +08:00
yufeng 37507571a9 fix: harden Studio resource search (#2521)
* fix studio playground resource search

* fix: harden studio resource search

* test: handle missing user skills directory

* fix: preserve lazy user directory listing

* test: prepare user skills directory
2026-06-09 19:11:33 +08:00
1c0bbcdf0e feat(cli): add query planner setup to init wizard (#2485)
* feat(cli): add query planner setup to init wizard

Let `openviking-server init` configure the optional lightweight
query_planner model. The wizard pulls the chosen Ollama model and writes
the query_planner config; the IntentAnalyzer selects the matching prompt
at retrieval time via a model->prompt-id mapping, so no prompt files are
copied and no prompts.templates_dir override is needed.

- intent_analyzer: QUERY_PLANNER_PROMPT_BY_MODEL maps the fine-tuned SFT
  models to their bundled prompt id; unmapped models keep the default
  retrieval.intent_analysis prompt.
- bundle retrieval/ov_intent_analysis_sft_v4.yaml (loaded by its own id).
- ollama detection + doctor now recognize query_planner Ollama usage.
- docs: describe the init flow and runtime prompt selection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(cli): offer query planner on all paths, recommend it with an Ollama VLM

The init wizard offers the lightweight query planner after model setup. When the
chosen setup already uses an Ollama VLM (`ollama_running` is not None) the
planner rides on that running Ollama at near-zero extra cost, so the enable
prompt is tagged "(recommended)" and defaults to yes. For cloud / non-Ollama VLM
setups it is still offered, but defaults to no and drops the recommendation;
opting in there runs the Ollama install flow.

The Ollama state established during model setup is threaded through the wizard so
the planner reuses it instead of re-running the install dialog:

- `_wizard_ollama` / `_wizard_llamacpp` return `(config, ollama_running)`.
- `run_init` forwards that state to `_wizard_query_planner`.

Docs (zh/en) and tests updated accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: guoxuter <j7azwflq4h@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:12:05 +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
Mingjian Que 2d7d93a0a8 fix(cli): probe embedding provider in doctor (#2333) 2026-06-01 11:08:54 +08:00
kaisongli 7967ae3472 fix: skip test_wait_with_timeout due to CLI/Server timeout parameter mismatch (#2109)
CLI passes --timeout as query param but server only reads from request body,
causing infinite wait when queue is not empty. Skip until the bug is fixed.
2026-05-18 18:59:51 +08:00
kaisongli 59c70bdbf1 feat: add new API test cases and fix memory v2 test reliability (#2097) 2026-05-18 11:28:05 +08:00
kaisongli d7ef4a04a1 feat: add CLI integration tests, deduplicate oc2ov_test, and extend CI pipeline (#2061)
- Add CLI integration tests (10 test files under tests/cli/)
- Extend api_test.yml with CLI install + test steps
- Run filesystem + scenarios/resources_retrieval serially to avoid 409 conflicts
- Other tests parallel with -n 4
- Add release prereleased trigger to api_test.yml and api_test_effect.yml
- Deduplicate oc2ov_test P0 cases (20→12, ~30-55min saved):
  - Delete test_memory_write.py (covered by V2 suite)
  - Remove events/tools from V2 suite (structurally identical to entities/skills)
  - Remove test_memory_read_verify (covered by V2 suite)
  - Remove test_cross_session_recall (overlaps with recall_explicit_search)
- Add ensure_resources_dir fixture to prevent NOT_FOUND on fresh environments
- Add retry logic for 429/500/403 rate-limit in api_client.py
- Add retry for commit when task_id is None in test_memory_v2_full_suite.py
- Add exponential backoff retry for GitHub platform test 5xx errors
2026-05-15 14:05:26 +08:00
duyua9 ba54e38737 fix(cli): tolerate BOM in ov config (#1922) 2026-05-09 11:58:20 +08:00
Zayn JarvisandClaude Opus 4.6 fa5890623c fix(wizard): use volcengine provider for BytePlus + add Custom VLM option (#1915)
BytePlus was configured with provider="openai" but the BytePlus
endpoint uses the Volcengine API (multimodal_embeddings at
/embeddings/multimodal). Using the OpenAI SDK sends requests to the
wrong path (/embeddings with string input), causing 500 errors or
hangs.

Also adds a "Custom (OpenAI-compatible)" VLM option to both the cloud
and local wizard flows, so users can point to any OpenAI-compatible
endpoint (e.g., MiMo, vLLM, LiteLLM proxies).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-08 19:53:29 +08:00
Zayn JarvisandClaude Opus 4.7 d80b9ddcda feat(setup-wizard): openviking-server init 的一揽子优化 (#1735)
* feat(setup-wizard): add server binding step and reorder cloud providers

Add a Local/Remote host binding prompt with required root_api_key for
remote (0.0.0.0) so the wizard is usable inside Docker. Reorder cloud
providers to surface VolcEngine (火山引擎) first as the default, add
BytePlus as the second option (OpenAI-compatible ARK endpoint), and
drop OpenAI to third.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(setup-wizard): rotate .bak backups and mask API key input

When the previous .bak already exists, fall back to .bak.1, .bak.2, ...
so re-running init never silently overwrites an earlier backup.

For API key prompts, echo `*` per character at typing/paste time
(termios raw mode on Unix; getpass fallback on Windows; plain input
when stdin/stdout aren't TTYs so tests and pipes still work). Secrets
are no longer visible in scrollback or screen recordings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(setup-wizard): make Cloud API the first and default setup mode

Most users land on this wizard from a remote/cloud deployment path, so
Cloud API now appears first in the setup-mode prompt and is the default
selection. Local llama.cpp drops to second, Ollama to third, Custom
stays last.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 16:45:23 +08:00
Zayn JarvisandClaude Opus 4.7 ac027adba8 fix(docker): collapse persistent state into /app/.openviking (#1728)
* fix(docker): collapse persistent state into /app/.openviking

The Docker image previously crashed on startup when ov.conf was missing,
making it impossible to docker exec in to fix the configuration. This
also forced two separate volume mounts (config + data), which is awkward
on managed platforms that only offer one persistent volume.

Changes:
- Set HOME=/app and put all persistent state under /app/.openviking, so
  the in-container layout mirrors the host's ~/.openviking.
- docker-compose.yml mounts ~/.openviking -> /app/.openviking as a single
  volume that captures ov.conf, ovcli.conf, and the workspace.
- Entrypoint bootstraps ov.conf from OPENVIKING_CONF_CONTENT when set;
  otherwise prints a fix-it message and sleeps until the file exists, so
  the container stays up for docker exec.
- openviking-server init honors OPENVIKING_CONFIG_FILE and derives the
  workspace from its parent directory, so a single env var places init
  output where the server will read it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(docker): describe single-mount layout and no-mount fallbacks

Switch all Docker examples to the new single-volume layout
(~/.openviking -> /app/.openviking) and document the two ways to
configure when bind mounts aren't available: pass the full ov.conf JSON
through OPENVIKING_CONF_CONTENT, or docker exec in and run
openviking-server init while the entrypoint waits for the file.

Updates docs/{en,zh}/getting-started/02-quickstart.md and
docs/{en,zh}/guides/03-deployment.md, including the macOS socat block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: link

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 10:51:12 +08:00
Hao ZheandZayn Jarvis 01403312ea feat(vlm): add Codex, Kimi, and GLM VLM support (#1444)
* feat(vlm): add Codex OAuth-backed VLM setup and docs

* fix(codex): address PR review follow-up issues

* feat(vlm): add Kimi and GLM backends

* refactor(vlm): simplify codex auth flow and docs

* fix: update code comments and doctor validation

* chore: update uv.lock after merge

* Refine Codex auth flow and VLM backend integrations

* Take over mirrored Codex auth on refresh

* feat(vlm): refine provider setup and auth flow

* style: format VLM and setup files

* style: fix lint import ordering

* fix(codex): harden auth refresh and disable streaming

* fix(codex): translate tool history and refresh auth safely

* style(lint): fix changed-file ruff violations

* fix(init): refine cloud VLM setup prompts

* style(lint): format setup wizard changes

---------

Co-authored-by: Zayn Jarvis <zhiheng.liu@bytedance.com>
2026-04-22 11:01:23 +08:00
Qin Haojie a1e257e0dd fix(security): address targeted code scanning alerts (#1591)
Tighten local index path handling, sanitize stale lock logs, and stop
surfacing sensitive setup and demo server errors.
2026-04-20 18:12:25 +08:00
duyua9 af9780cd5b Add doctor Ollama coverage (#1499) 2026-04-17 16:39:21 +08:00
Qin Haojie cebc45907b feat(session): add account namespace policy and shared sessions (#1356)
* feat(session): add account namespace policy and shared sessions

Unify namespace resolution across filesystem, indexing, and session storage.
Add account-shared session paths, role_id auth semantics, and an HTTP demo
script for the four namespace-policy combinations.

* space

* fix(pack): skip derived semantic files in ovpack transfer

Keep ovpack imports resilient to stale sidecars and rebuild semantics through the normal queue instead of restoring derived files verbatim.

* Revert "fix(pack): skip derived semantic files in ovpack transfer"

This reverts commit f4e4db8401.

* fix(namespace): default legacy accounts to agent-shared policy

Clarify that memory.agent_scope_mode is deprecated and document the supported agent memory migration paths.
2026-04-17 15:12:45 +08:00
MaojiaShengandopenviking e15f95eb46 reorg: collect all envs from everywhere, and defined in consts.py (#1490)
* refactor: all env are listed in openviking_cli/utils/config/consts.py

* refactor: all env are listed in openviking_cli/utils/config/consts.py

* refactor: all env are listed in openviking_cli/utils/config/consts.py

* refactor: all env are listed in openviking_cli/utils/config/consts.py

* refactor: all env are listed in openviking_cli/utils/config/consts.py

---------

Co-authored-by: openviking <openviking@example.com>
2026-04-16 16:58:20 +08:00
Mingjian QueandGPT-5.4 3b0ac8a0d4 feat: add local llama-cpp embedding support (#1388)
* feat: local llama.cpp embedding support, setup wizard, lazy storage imports, and config singleton deadlock fix

Made-with: Cursor
Co-authored-by: GPT-5.4 <noreply@openai.com>

* fix: remove unsupported custom local gguf setup

---------

Co-authored-by: GPT-5.4 <noreply@openai.com>
2026-04-15 12:03:40 +08:00
t0sakiandClaude Opus 4.6 4287e36195 feat: add openviking-server init interactive setup wizard for local Ollama model deployment (#1353)
* feat: add `ov init` interactive setup wizard for local model deployment

Add an interactive CLI wizard that guides users through configuring
OpenViking with local Ollama models, especially targeting macOS/Apple
Silicon beginners. The wizard auto-detects and installs Ollama,
recommends models based on system RAM, pulls selected models, and
generates a valid ov.conf.

Supported models:
- Embedding: qwen3-embedding (0.6b/4b/8b), embeddinggemma:300m
- VLM: qwen3.5 (2b-122b), gemma4 (e2b/e4b/26b/31b)

Also fixes `ov doctor` to recognize Ollama providers as valid without
requiring an API key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add Ollama lifecycle management for server startup and health checks

Extract Ollama utilities into shared module (openviking_cli/utils/ollama.py)
so both `ov init` and `openviking-server` can reuse them. Server now
auto-detects Ollama from config and ensures it's running at startup
("ensure running, never stop" pattern). Adds Ollama connectivity to
`/ready` health check and `ov doctor` diagnostics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: move init and doctor from ov to openviking-server subcommands

These are server-side configuration commands (generate/validate ov.conf),
not client operations. Having them under `ov` (the client CLI) was
confusing. Now:

  openviking-server init     # setup wizard
  openviking-server doctor   # diagnostics
  ov <subcommand>            # client operations only

* restore rust_cli.py

* refactor: update command references to use 'openviking-server doctor'

* fix: add existence check for example config in custom configuration wizard

* refactor: update references from 'ov init' to 'openviking-server init' in setup wizard and tests

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 14:39:01 +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
Jiahui Zhou ca9a6ccc9d fix: align doctor AGFS check with bundled pyagfs (#1044) 2026-03-27 23:01:18 +08:00
liberion1994andQin Haojie f81419c11c feat(memory): support agent-only agent memory scope (#954)
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
2026-03-27 16:45:50 +08:00
IT Lackeyandqin-ctx 41a2609cb2 fix: expand env vars when loading ov.conf JSON config files (#908)
Apply os.path.expandvars() to raw config text before JSON parsing in all
config-loading code paths, so that $VAR and ${VAR} placeholders in ov.conf
are resolved from the environment. This is especially useful for container
deployments where secrets are injected as environment variables.

Files changed:
- openviking_cli/utils/config/config_loader.py: load_json_config()
- openviking_cli/utils/config/open_viking_config.py: _load_from_file()
- openviking_cli/doctor.py: check_config(), check_embedding(), check_vlm(), check_disk()
- bot/vikingbot/config/loader.py: load_config() (already had this, no change)

The server config path (openviking/server/config.py -> load_server_config)
delegates to load_json_config() and is covered by the fix above.

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-03-24 14:33:07 +08:00
everforge 0b9df76eeb refactor(cli): centralize ov.conf JSON loading in ov doctor (#913) 2026-03-24 11:22:36 +08:00
50e1ff91d2 feat(cli): add ov doctor diagnostic command (#851)
* feat(cli): add ov doctor diagnostic command

Adds a new `ov doctor` command that validates all OpenViking subsystems
and reports actionable diagnostics without requiring a running server.

Checks: config file, Python version, native vector engine (PersistStore),
AGFS, embedding provider, VLM provider, and disk space. Each check is
isolated so one failure doesn't block others, and every failure includes
a specific fix suggestion.

This addresses a real pain point: when the native engine is missing from
a pip wheel (e.g., Python 3.13), the only feedback is 50+ ERROR log
lines with no actionable guidance. `ov doctor` catches this immediately:

  Native Engine: FAIL  No compatible engine variant
    Fix: pip install openviking --upgrade --force-reinstall
    Alt: Use vectordb.backend = "volcengine" instead of "local"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add ov doctor screenshot examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(doctor): reuse resolve_config_path and drop hardcoded OPENAI_API_KEY fallback

Address review feedback from @qin-ctx:
- Replace _CONFIG_SEARCH_PATHS and _find_config() with resolve_config_path()
  from config_loader.py to avoid two sources of truth for config discovery
- Remove hardcoded OPENAI_API_KEY env var fallback from embedding and VLM
  checks - only check the api_key field in config
- Renumber inline comments in rust_cli.py (1/2/3 matching docstring)

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 00:34:57 +08:00
Matt Van HornandMatt Van Horn 76932d3e95 fix(core): add separator to agent_space_name to prevent hash collisions (#609)
agent_space_name() computed md5(user_id + agent_id) without a separator,
so different (user_id, agent_id) pairs could produce the same hash when
their concatenation matched (e.g. ("alice","bot") vs ("aliceb","ot")).

Add ":" separator between user_id and agent_id in the hash input. The ":"
character is safe because the validation regex [a-zA-Z0-9_-] prevents
either field from containing it.

Fix applied to all three implementations:
- openviking_cli/session/user_id.py (Python SDK)
- bot/vikingbot/openviking_mount/ov_server.py (bot server)
- examples/openclaw-memory-plugin/client.ts (TypeScript example)

Note: This is a breaking change for existing agent spaces. Existing data
directories were named using the old hash and will not be found with the
new hash. A migration script or fallback lookup may be needed.

Fixes #595

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-03-15 10:36:46 +08:00
MaojiaShengandopenviking e4b1ffed10 Feat: CLI optimization (#389)
* feat: remove python cli and disable python -m openviking

* feat: ls, tree, find, search, grep all use --node-limit as the result limiting arg

* feat: add ls -n

* feat: update agfs to support grep -n

* feat: update agfs to support grep -n

* docs: cancel modify

---------

Co-authored-by: openviking <openviking@example.com>
2026-03-03 13:23:37 +08:00
Qin HaojieandClaude Opus 4.6 4d7d222658 fix(test): 修复测试稳定性问题,清理废弃代码 (#353)
* fix(test): 修复测试稳定性问题,清理废弃代码

- 重构 is_closing 为基类正式 property,移除 getattr 防御性调用
- 测试用例使用唯一 account ID 避免跨测试数据冲突
- 服务器测试使用独立临时目录避免并发竞争
- 修复 ResourceWarning 测试因历史警告导致的误报
- 修复 CLI grep 命令参数顺序
- 更新路径遍历测试断言为 ValueError
- 移除已废弃的 CompressManager 测试
- 改进 AGFS_LIB_PATH 环境变量路径发现逻辑
- 新增 ragas/datasets/pandas 测试依赖
- 改进 CLI 服务器启动失败时的错误输出

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* revert: 回退 binding_client.py 的改动,由其他人负责修改

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:04:44 +08:00
Qin Haojie b92f2c0fc7 feat: 多租户 Phase 1 - API 层多租户能力 (#260)
* doc: update design

* feat: multi_tenant

* feat: multi_tenant

* feat: multi tenant

* feat: multi tenant

* fix: tests

* fix: rust cli
2026-02-24 13:40:44 +08:00
MaojiaSheng db7319f4a2 refactor: to accelerate cli launch speed, refactor openviking_cli dir (#150)
* fix: remove await asyncio and call agfs directly

* feat: mv cli out of openviking

* refactor: mv cli out of openviking

* refactor: mv cli out of openviking
2026-02-12 22:12:50 +08:00
qin-ctx 002e14087f refactor(client): 拆分 HTTP 客户端,分离嵌入模式与 HTTP 模式 (#141)
* refactor(client): 拆分 HTTP 客户端,分离嵌入模式与 HTTP 模式

- 将 HTTPClient 重命名为 AsyncHTTPClient,新增 SyncHTTPClient 同步封装
- AsyncOpenViking/SyncOpenViking 仅保留嵌入模式,HTTP 模式使用独立的 AsyncHTTPClient/SyncHTTPClient
- HTTP 客户端支持从 ovcli.conf 自动加载 url/api_key
- 移除客户端构造函数中的 user 参数,统一使用默认用户
- 简化 CLIContext,直接使用 SyncHTTPClient
- 简化 VikingFS._uri_to_path 实现
- 更新文档、示例和测试适配新 API

* fix queue
2026-02-12 12:25:54 +08:00
qin-ctx 6d55bf4aa1 feat: 新增 Bash CLI 基础框架与完整命令实现 (T3 + T5) (#132)
* feat: 新增 Typer CLI 并统一配置加载机制

引入基于 Typer 的完整 CLI 模块 (openviking/cli),支持 resources、
sessions、search、filesystem、content、relations、pack、debug、
observer、system 等子命令。

新增统一配置加载器 (config_loader),采用三级解析链(显式路径 →
环境变量 → ~/.openviking/),同时服务于 server (ov.conf) 和
CLI (ovcli.conf)。

精简 AsyncOpenViking / SyncOpenViking 客户端,移除 service 模式
(vectordb_url / agfs_url) 和环境变量回退逻辑,仅保留 embedded
和 HTTP 两种模式。

同步更新中英文文档、示例和测试。

* fix: remove user  when create session

* fix: tests

* fix: tests
2026-02-11 15:53:10 +08:00