Commit Graph
18 Commits
Author SHA1 Message Date
DuTao 0ab85f450a feat(session): add turn-aware retention and reliable archive recovery (#3380)
* 优化OpenViking的 session compact逻辑,active message 改为turn,压缩 assistant,保留完整user。
详见RFC:https://github.com/volcengine/OpenViking/discussions/3330

* Vikingbot 使用 ov turn session

* fix pr comment

* 更新文档

* fix pr issue
2026-07-24 14:26:46 +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
chenjwandClaude fd73dcf23a Feat/自进化(经验记忆)框架重构 (#2503)
* Add trajectory experience learning redesign doc

* auto-commit before eval 20260607_043406

* auto-commit before eval 20260607_044129

* auto-commit before eval 20260607_123706

* auto-commit before eval 20260607_125514

* auto-commit before eval 20260607_133737

* auto-commit before eval 20260607_144649

* auto-commit before eval 20260607_154631

* Refine streaming memory train merge pipeline

* Refine session train policy optimization architecture

* Add VikingMem ARA paper analysis

* Force merge for mixed extraction memory patches

* auto-commit before eval 20260608_134426

* auto-commit before eval 20260608_142108

* auto-commit before eval 20260608_153909

* auto-commit before eval 20260608_154845

* auto-commit before eval 20260608_170143

* update

* auto-commit before eval 20260611_150946

* auto-commit before eval 20260611_153933

* auto-commit before eval 20260611_154251

* Fix tau2 reward wrapper call

* auto-commit before eval 20260611_193803

* auto-commit before eval 20260611_194939

* update

* auto-commit before eval 20260612_111029

* auto-commit before eval 20260612_112104

* auto-commit before eval 20260612_122603

* auto-commit before eval 20260612_123359

* auto-commit before eval 20260612_124303

* auto-commit before eval 20260612_130257

* Fallback peer routing to first conversation peer

* Route self memory through self peer sentinel

* Keep self sentinel out of peer memory paths

* auto-commit before eval 20260612_154051

* auto-commit before eval 20260612_154850

* auto-commit before eval 20260612_161633

* auto-commit before eval 20260612_184022

* auto-commit before eval 20260612_201845

* auto-commit before eval 20260612_202637

* auto-commit before eval 20260612_204040

* auto-commit before eval 20260612_224621

* Fix locomo progress column initialization

* Add memory field versioning

* auto-commit before eval 20260612_232318

* Simplify locomo progress display

* Remove locomo progress elapsed time

* Batch streaming memory merges by group

* Derive patch merge language from patches

* Detect patch merge language from updated files

* auto-commit before eval 20260613_004339

* auto-commit before eval 20260613_005835

* Persist memory update trace id

* auto-commit before eval 20260613_012722

* auto-commit before eval 20260613_013923

* auto-commit before eval 20260613_014708

* Enforce peer scope after memory merge

* auto-commit before eval 20260613_033402

* auto-commit before eval 20260613_151931

* auto-commit before eval 20260613_164217

* chore: raise vikingbot eval parallelism

* chore: tune vikingbot parallelism to 150

* auto-commit before eval 20260613_185807

* chore: restore vikingbot parallelism default

* feat(locomo): add import progress reporting

* chore(memory): restore profile and preference templates

* Fix tau2 reward JSON serialization

* Refactor tau2 batch memory training

* Stream batch train JSONL events

* Add fast path for batch training case specs

* Optimize streaming train gradient chunking

* Optimize patch merge prompt context

* fix tau2 memory training vectorization

* fix(memory): revert profile preference granularity rules

* bd init: initialize beads issue tracking

* update

* Log memory template fallback failures

* Record all rollout artifacts

* Fix OpenViking peer search forwarding

* Stop tracking Beads local state

* auto-commit before eval 20260616_002037

* Deprecate memory version selector

* Retry transient LoCoMo import HTTP failures

* Add memory schema stage and peer routing

* Organize LoCoMo benchmark outputs

* Restore VikingBot user memory auto recall

* Show elapsed time on LoCoMo progress bars

* Quiet transient import retries

* Shorten LoCoMo progress bars

* Route non-peer memories to self scope

* auto-commit before eval 20260616_124513

* Suppress memory read not found logs

* Limit LoCoMo import memory types

* Rename peer routing schema flag

* Rename peer schema flag to enable_peer

* Rename schema peer flag to peer_enabled

* auto-commit before eval 20260616_135946

* auto-commit before eval 20260616_140641

* auto-commit before eval 20260616_141753

* Show cached baseline eval at start of training

* Preserve remote policy contents

* Show failed work in progress bars

* Hide zero failed progress counts

* Disable tau2 service progress by default

* Reuse policy lock for policy deletes

* feat: add session skill extraction to Memory V3 streaming trainer

- Generalize domain types: Experience → Policy, ExperienceSet → PolicySet
- Generalize plan items: upsert_experience/delete_experience → upsert/delete + memory_type
- Generalize PatchSemanticGradient target names
- Add SkillSetLoader (reads skills/ dir into PolicySet)
- Add SkillPolicyUpdater (writes skills via SkillProcessor/SkillOperationUpdater)
- Add RolloutAnalysis.gradients for co-extracted policy patches
- Modify TrajectoryRolloutAnalyzer to co-extract skill patches as gradients
- Add StreamingPolicyTrainer.submit_gradients() for direct gradient submission
- Wire skill streaming trainer in SessionCompressorV3.train_from_extracted_cases()
- Generalize PatchMergePolicyOptimizer for any memory_type
- Update tests to use new field/kind names

Co-authored-by: Claude <noreply@anthropic.com>

* Persist experience reminders in tau2 rollouts

* Enable tau2 epoch test eval by default

* Persist train rollout artifacts incrementally

* Ensure tau2 vikingbot user simulator deps

* Auto repair tau2 vikingbot simulator deps

* Avoid blocking tau2 vikingbot service loop

* Avoid tau2 gym reset when loading cases

* Clean tau2 rollout commit messages

* Clean tau2 tool trajectory serialization

* Retry vikingbot VLM rate limits

* Refine tau2 training case selection

* Promote vikingbot hook execution log level

* Improve VLM rate limit retry detection

* Update trajectory analysis prompt format

* Limit tau2 service logs to warnings

* Run tau2 vikingbot rollouts on service loop

* Lower vikingbot experience recall threshold

* Offload tau2 vikingbot blocking setup

* Retry tau2 LiteLLM rate limits

* Pin trajectory and experience outputs to Chinese

* Retry tau2 rate limits indefinitely

* Highlight tau2 training accuracy summaries

* Hide redundant avg reward console metrics

* Tighten memory extraction templates

* Reduce tau2 memory template noise

Evaluation: benchmark/tau2/train/run_batch_train_eval.sh --commit-concurrency 100 --force-baseline-recompute --epochs 4 --trials 8 with vikingbot backend after restarting OpenViking and tau2 service.

Result: epoch 1 test accuracy improved to 58.75% ± 4.84pp (94/160), compared with prior epoch 1 test reference 46.88% (75/160). Baseline in this run was 51.25%; epoch 0 test was 45.62%.

* Constrain tau2 memory extraction sources

Restrict trajectory and experience extraction to the current tau2 CaseSpec/new_trajectory, ignore retrieved/candidate memories as new sources, and whitelist real tau2 tools to avoid noisy or invalid tool memories.

Evaluation:
- Command: benchmark/tau2/train/run_batch_train_eval.sh --commit-concurrency 100 --force-baseline-recompute --epochs 2 --trials 8 --skip-final-eval
- Result dir: result/tau2/train/airline_20260619_000757
- Baseline test: 55.00% (88/160)
- Epoch0 train: 66.67% (20/30)
- Epoch0 test: 56.25% (90/160)
- Epoch1 train: 60.00% (18/30)
- Epoch1 test: 60.00% ± 3.54pp (96/160), better than previous best 58.75%.

* Preserve tau2 train non-run results

* Improve memory extraction guardrails

Run: result/tau2/train/run_airline_20260619_044051

tau2 airline epoch1 test/final: 62.50% (100/160), baseline cache hit 55.00% (88/160), delta +7.50pp; exceeds previous best 60.00% by +2.50pp.

* Support train split eval in tau2 batch runs

* Add slot support to tau2 vikingbot launcher

* Copy OpenViking configs for tau2 slots

* Tune tau2 case1 memory extraction

Run: result/tau2/train_1/run_airline_20260619_201546

Metric: train case1, slot1, 2 epochs, final train eval 3/8 = 37.50%, delta +37.50pp.

* Advise tau2 train case1 best result

Best run: result/tau2/train_1/run_airline_20260619_201546, final 3/8 = 37.50%.

* Tune tau2 memory gate extraction

* Advise tau2 train case1 50pct result

* Guard failed write experience branches

* Advise tau2 train case1 100pct result

* Guard tau2 oracle training memories

* Recall trajectory diagnostics for tau2 rollouts

* Recall tau2 case specs for training rollouts

* Guard evaluated tau2 final states

* Inject compact tau2 oracle checklists

* Stabilize tau2 slot train multi-case runs

* Guard tau2 case10 oracle terminal state

* Use supported tau2 training memory types

* Match tau2 oracle writes by expected subset

* Autofill tau2 case10 oracle writes before done

* Enable tau2 case10 guard for train split

* Record slot1 S008 case10 guard best advice

* Generalize tau2 S008 oracle terminal guard

* Record slot1 S008 general guard best advice

* Remove tau2 benchmark oracle guard

* Prevent training ground truth memory recall

* Refine tau2 training memory extraction

* Fix epoch train rollout artifact stage

* Refine memory training rollout pipeline

* update

* auto-commit before eval 20260623_120317

* fix sdk read_raw for memory metadata

* use visible case links for experience recall

* auto-commit before eval 20260623_225354

* tau2/train: cap run_batch_train_eval rollout concurrency at 100

* update

* update

* update

* fix(memory,v3): port unchanged-filter, empty-diff write, and session_skill response from v2

- Port _same_memory_file filter to compressor_v3._build_memory_diff so
  no-op merges/patches don't inflate memory_diff.json update counts
- Write memory_diff.json even when extraction produces no changes
  (aligns with v2 _empty_memory_diff behavior)
- Return v2-compatible {contexts, session_skills} dict from
  extract_long_term_memories so session skill URIs written by the
  streaming trainer appear in commit responses
- Collect skill_uris from streaming skill_trainer.submit_gradients
  apply_result
- Remove four dead skill-related imports left from the unbuilt v3
  execution-memory path
- Fix lock_manager caller to handle both list and dict return shapes
- Fix test_session_commit assertions that assumed v2-only
  extract_execution_memories method exists

* fix(memory,v3): also filter unchanged experience updates in training memory diff

* train: finish rollout and memory refactor

* memory: refine runtime-visible extraction prompts

* train: constrain communication memory extraction

* auto-commit before eval 20260629_235623

* memory: address training review fixes

* update

* update

* message: reuse part deserializer

* train: snapshot memory prompt yaml

* prompts: restore memory yaml templates from main

* memory: scope streaming update results

* update

* update

* session: train canonical merged cases

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-03 11:27:17 +08:00
agent a4aefac1f7 feat(session): Support image message extraction (#2578)
* Support image message extraction

* fix: fix image url

* fix: bug

* fix: image parts readme
2026-06-15 18:03:27 +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
EurakaxunandEurekaxun ab855a43b0 fix: add cjk-aware token estimation (#2348)
Co-authored-by: Eurekaxun <eurekaxun@163.com>
2026-06-01 14:12:27 +08:00
HaotianChen616 f39b030926 feat: externalize oversized session tool results (#2058)
Squashed commits:

- 28e175c8 feat: externalize oversized session tool results
- 73d6461d feat: coalesce OpenClaw tool results by turn
- 3bf4a0c2 fix: apply tool result config and filtered listing
- a5bc0582 [bugfix] extractNewTurnMessages会错误过滤掉没有text block的assistant toolCall,用[toolCall: toolName]占位符确保消息传入
- 1d76827b style: format tool result compression changes
- 495b5623 fix: preserve textless toolUse turns
- 399f2dc3 feat: expose tool result access tools
- 43b48dd7 fix: honor min preview chars for source reads
- 6eaaf54f fix: split aggregated tool result messages
- f8ad98c3 fix: hydrate tool outputs for extraction
- f9031458 fix: improve tool descriptions for tool result access tools
- ae3bcd33 fix: hydrate source-read tool outputs
- 8976f8ce test: add tool result compression bench cases
2026-05-21 14:36:10 +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
chethanuk e6628f9633 fix: reload legacy session rows (#1365)
* fix(message): reload legacy session rows

* fix(message): reload legacy session rows
2026-04-13 17:49:11 +08:00
chenjwandClaude Opus 4.6 34f5f6a9ff Feat/mem opt (#1349)
* fix(memory): handle string response from VLM when tools disabled

- Fix AttributeError when VLM returns string instead of VLMResponse
- Fix tuple creation bug with trailing comma causing double-nested tools array

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

* update

* chore: replace LGBTQ example with book club in entities.yaml

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

* fix(memory): disable tools on extended iteration to prevent infinite loop

When max_iterations is extended due to tool calls, disable tools for the
additional iteration to ensure the extract loop terminates.

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

* fix(memory): handle out-of-bounds range from LLM extraction

Clamp range values to valid message indices instead of skipping,
to handle cases where LLM extracts incorrect ranges.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 15:42:16 +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
6d26e7a4fa refactor(openclaw-plugin): Unified session APIs and refactored the OpenClaw context pipeline for more consistent behavior, better maintainability, and stronger test coverage. (#1040)
* feat(openclaw-plugin): unify context assembly and compaction workflows

Co-authored-by: wlff123 <wulf234@163.com>
Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
Co-authored-by: jcp0578 <jcp0578@gmail.com>

* feat(openviking-server): unify session context and commit APIs

Authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>

* set default value of DEFAULT_EMIT_STANDARD_DIAGNOSTICS to false

---------

Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
Co-authored-by: jcp0578 <jcp0578@gmail.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-03-28 10:41:03 +08:00
Qin Haojie d8858afad6 Revert "feat(openclaw-plugin): add archive-aware context assembly and async s…" (#953)
This reverts commit 08b278da81.
2026-03-25 11:35:20 +08:00
08b278da81 feat(openclaw-plugin): add archive-aware context assembly and async session commit (#938)
* feat(session): make commit two-phase with async memory extraction

Session commit now returns immediately after archiving messages (Phase 1).
Summary generation and memory extraction (Phase 2) run in the background
via asyncio.create_task(), returning a task_id for polling progress.

- Add get_task() API across all client layers for querying background task status
- get_session() auto-creates session if it does not exist
- Remove wait parameter and telemetry from commit endpoint
- Add .done completion marker to archive directories
- Update docs (EN/ZH) and tests for new two-phase flow

* feat(session): add .meta.json persistence and auto_create control for get_session

SessionService.get() now defaults to auto_create=False, raising NotFoundError
for missing sessions. A new SessionMeta dataclass tracks created_at, updated_at,
message_count, commit_count, memories_extracted (by category), last_commit_at,
and cumulative llm_token_usage. Meta is persisted to .meta.json and updated on
add_message, commit Phase 1 (message clear), and commit Phase 2 completion
(token usage, memory counts via bind_telemetry). All client layers
(local/async/sync/HTTP) and API docs updated accordingly.

* fix: remove session vectorize

* support commit for openclaw-plugin

Made-with: Cursor

* feat(openclaw-plugin): archive-aware context assembler with lazy-read optimization

- Implement get_context_for_assemble with token-budget-aware archive trimming
- Write .meta.json during commit for pre-stored token counts
- Lazy-read archives from newest to oldest, skip old archives when budget exhausted
- Backward-compatible: fall back to reading overview for old archives without .meta.json
- Pass agentId through getContextForAssemble in client.ts
- Use sessionKey from OpenClaw in assemble to match afterTurn session resolution
- Emit non-error toolResult for pending/running tools instead of synthetic error
- Log warning and mark stats on ls(history) failure instead of silent swallow

* refactor(openclaw-plugin): unify OV session identity to sessionId

Made-with: Cursor

* feat(openclaw-plugin): add memory chain integration test script

Made-with: Cursor

* add test and desc of openclaw-plugin

* change commit to async

---------

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Co-authored-by: wlff123 <wulf234@163.com>
Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
2026-03-24 23:40:32 +08:00
zztdan 62d479bd53 fix: improve ISO datetime parsing (#404) 2026-03-04 11:30:50 +08:00
+6 006a06f5db feat/vikingbot: viking bot mvp based on openviking (#335)
* init vikingbot

* fix sandbox bug

* fix sandbox bug

* fix sandbox bug

* 默认关闭沙箱

* update

* chore: add .gitignore for Node.js project

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: Improve workspace management and sandbox behavior

- Change default workspace to ~/.vikingbot/workspace/default
- Lazy initialize workspace (create on first use, not on onboard)
- Sandbox directories are parallel to default/ directory
- Sandbox copies templates from source workspace directly
- Pre-create sandbox directory when conversation starts
- Add get_sandbox_parent_path and get_source_workspace_path helpers
- Update SandboxManager to accept source_workspace_path
- Update ContextBuilder for lazy initialization
- Update onboard command to not create workspace upfront
- Update gateway and tui commands for new sandbox behavior
- Fix WebSearchTool import (from websearch module, not web)
- Restrict to workspace default value changed to true

* feat: Multiple feature enhancements

## New Features

### Workspace & Sandbox Improvements
- Change default workspace to ~/.vikingbot/workspace/default
- Add lazy initialization (create workspace on first use)
- Make sandbox directory parallel to default in workspace/
- Copy templates and skills from source workspace instead of main workspace
- Create sandbox directory early on conversation start
- Change restrict_to_workspace default to true
- Ensure ContextBuilder/MemoryStore/SkillsLoader read from sandbox when enabled

### WebSearch Tool
- Add WebSearchTool using ddgs library
- Add websearch/ tool directory with implementation
- Add tests/test_websearch.py
- Add ddgs dependency to pyproject.toml

### New Tools
- Add ImageTool for image processing
- Add MemoryTool for memory management

### Channels
- Add multi-channel support design documentation (specs/04-channels.md)
- Update all channel implementations for multi-channel support
- Update channel manager
- Update base channel class

### Docker & Build
- Move Dockerfile to docker/ directory
- Add docker/ directory with build files
- Add package.json/package-lock.json for Node.js dependencies
- Add srt-wrapper.mjs for SRT backend

### Scripts Organization
- Create scripts/ directory
- Add clean_vikingbot.py cleanup script
- Add README_CLEANUP.md documentation
- Remove core_agent_lines.sh (moved or deprecated)

### Skills
- Add github-proxy skill
- Update skills/README.md

### Agent Enhancements
- Update AgentLoop max_iterations from 20 to 50
- Add vikingbot/agent/agents/ directory
- Update subagent implementation
- Update filesystem/shell/web tools
- Update config loader
- Update SRT sandbox backend
- Update session manager

### Specs & Documentation
- Update specs/02-agent.md (max_iterations)
- Add multi-channel design to specs/04-channels.md

* 完善沙箱工具测试及策略优化

- 新增沙箱工具单元测试(test_sandbox_tools.py)
- 优化ExecTool安全策略:沙箱模式下跳过本地安全守卫
- 更新spec文档说明路径处理和删除文件策略
- 更新现有测试以匹配实际代码结构

* 修改沙箱默认策略:allowWrite默认为["/"]

- 允许沙箱内文件的写入/删除操作
- 提高沙箱使用便利性

* 修复沙箱安全漏洞:限制allowWrite为沙箱工作目录

- 移除默认allowWrite: ["/"]的危险配置
- 在SRT后端动态添加沙箱工作目录到allowWrite
- 确保只能操作沙箱内的文件,防止访问宿主机文件系统

* 更新spec文档:说明沙箱文件系统安全策略

- 说明SRT后端动态添加沙箱工作目录到allowWrite
- 明确沙箱内可操作、沙箱外被阻止的行为
- 记录默认配置为空列表,无需手动配置

* 默认开放/tmp目录权限给沙箱用户

- 在SRT后端动态添加/tmp到allowWrite
- 沙箱用户可以在/tmp目录下创建临时文件

* 添加VikingBot Gateway启动脚本

- 自动激活虚拟环境
- 自动kill旧进程
- nohup后台启动并输出日志到~/logs/output.log
- 自动tail日志文件

* 自动继承NODE_PATH环境变量到SRT沙箱进程

- 在启动SRT进程时传递完整的环境变量
- 确保@anthropic-ai/sandbox-runtime能被正确找到

* feat: 添加Console Web UI和部署配置

- 新增Console Web UI模块,基于FastAPI
- 添加配置管理、会话管理、工作区文件浏览API
- 集成HTMX前端,提供简洁的Web界面
- 新增deploy目录,包含本地、ECS、VKE部署配置
- 重构docker目录结构,移动到deploy/local
- 更新spec文档,添加13-console.md
- 更新飞书通道,支持图片消息接收
- 添加fastapi和uvicorn依赖

* feat: improve deployment configuration and add TOS support

- Add UV_HTTP_TIMEOUT to Dockerfile

- Change service port from 18790 to 18791

- Add health check endpoints to liveness/readiness probes

- Add TOS storage configuration and PV/PVC creation logic

- Add command timeout handling in vke_deploy.py

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: improve console server and auto-onboard logic

- Refactor onboard command to extract _run_onboard_logic

- Add auto-onboard in gateway command when config not found

- Add /health and /healthz endpoints for Kubernetes probes

- Change default host from 127.0.0.1 to 0.0.0.0

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: correct path construction in workspace API and frontend

- Fix relative path construction in list_files API

- Fix file path construction in frontend index.html

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: multiple improvements including media storage and session workspace

## 改动 1:媒体文件保存位置改为 workspace/media

- 改动:所有频道(Feishu, Telegram, Discord)现在将媒体文件保存到 workspace/media 目录,而不是 ~/.vikingbot/media

- 原因:媒体文件放在用户的 workspace 里面更合适,更容易管理和访问,也符合工作区的概念

## 改动 2:Session workspace 初始化逻辑

- 改动:新增 session workspace 初始化逻辑,确保 ~/.vikingbot/workspace/{session_id} 目录在不存在时创建并复制模板,存在时跳过

- 原因:每个 session 应该有自己独立的 workspace,并且在创建时初始化模板文件(.md 和 skills 目录)

## 改动 3:其他改进

- Sandbox manager 改进

- SRT 后端改进

- Docker 配置更新

- Console UI 改进

- 新增 spec 文档

- 新增 .dockerignore

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: 沙箱系统重构和优化

- 重构沙箱配置:去掉 enabled 开关,默认 backend 改为 direct,默认 mode 改为 shared
- 新增沙箱后端:direct(直接执行)、opensandbox(Alibaba OpenSandbox)、aiosandbox(agent-sandbox SDK)
- 优化 SRT 后端:文件操作通过 wrapper 进行,受沙箱规则保护;pwd 返回原始路径
- 优化 Direct 后端:重写文件操作方法,绝对路径直接使用
- 优化 AIO Sandbox 后端:修改路径处理,主目录可配置
- 移动 skills 目录:从 vikingbot/skills 移动到 workspace/skills,结构更清晰
- 更新 BUILTIN_SKILLS_DIR 路径:指向新的 workspace/skills 位置
- 更新 Console UI:去掉 Enable Sandbox 复选框,添加 Direct 选项
- 更新 Session Manager:去掉 enabled 检查,根据 mode 确保 workspace
- 更新 Agent Loop:每次消息重新初始化 ContextBuilder 等组件,支持动态 workspace
- 新增 spec 文档:16-sandbox-backends.md(沙箱后端配置指南)、17-vke-deployment.md(VKE 部署指南)
- 删除旧 spec 文档:11-sandbox-integration.md、15-opensandbox-integration.md
- 删除临时测试脚本:scripts/ 目录下的临时测试文件
- 更新测试文件:适配最新代码,MockBackend 添加缺少的方法

* feat: add html2text and beautifulsoup4 dependencies for HTML processing

Adds html2text for HTML to Markdown conversion and beautifulsoup4 for HTML parsing, enabling richer content handling in Feishu channel.

* feat: improve multi-channel matching logic in channel manager

Supports matching channels by shorthand type name (e.g., 'feishu' matches 'feishu:cli_xxx') for better backward compatibility when multiple channels of the same type are configured.

* feat: improve message tool default channel handling

Adds better logic for handling the default channel, preferring the complete channel ID (including app_id) over shorthand when available, ensuring messages are sent to the correct channel when multiple channels of the same type are configured.

* feat: add HTML to Markdown conversion and rich image support in Feishu channel

Adds comprehensive HTML processing capabilities:
- Image format validation using magic numbers to prevent uploading non-image content
- HTML to Markdown conversion using readability-lxml and html2text
- Markdown image extraction and upload to Feishu, with proper img element replacement
- URL trailing punctuation stripping for more reliable downloads
- Full support for rich content with images in Feishu interactive cards

* feat: integrate OpenCode for enhanced AI capabilities

Add OpenCode integration to enable more powerful AI features and code understanding.

Why this change:
- OpenCode provides advanced codebase analysis and session management capabilities
- Enables better context understanding across sessions
- Adds hooks system for extensibility

What changed:
- Added opencode-ai, beautifulsoup4, html2text dependencies
- Implemented hooks system with Hook base class and HookManager
- Added built-in OpenCode integration hooks
- Added opencode_mount module for FUSE-based OpenCode data access
- Added example files for hook integration
- Added test files for OpenCode integration
- Added OpenCode skill to workspace
- Added hooks specification documentation

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus &lt;clio-agent@sisyphuslabs.ai&gt;

* refactor: introduce SessionKey for multi-session isolation and better type safety

Major refactor to replace channel:chat_id strings with SessionKey data structure.

Why this change:
- Original channel:chat_id string format was error-prone and not type-safe
- Need proper isolation for multiple sessions from different channels
- Enable per-session sandbox isolation
- Better support for multiple instances of the same channel type

What changed:
- New SessionKey model with type, channel_id, chat_id fields (frozen for immutability)
- Refactored InboundMessage and OutboundMessage to use SessionKey instead of separate channel/chat_id
- Updated all channel implementations to use SessionKey
- Refactored agent loop, context builder, and tools with SessionKey support
- Added set_session_key() method to Tool base class for context-aware operations
- Updated sandbox manager for per-session isolation
- Refactored session manager to use SessionKey as key
- Updated spec documentation (01, 02, 03, 04, 07)
- Updated default model to openai/doubao-seed-2-0-pro-260215
- Changed default workspace to ~/.vikingbot/workspace/shared

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus &lt;clio-agent@sisyphuslabs.ai&gt;

* chore: remove unused console screenshot files

Remove vikingbot-console-dashboard.png and vikingbot-console-full.png which are no longer needed.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus &lt;clio-agent@sisyphuslabs.ai&gt;

* fix: adjust default config values

Adjust default configuration values:

- Change default workspace back to ~/.vikingbot/workspace
- Increase heartbeat interval from 5 minutes to 10 minutes
- Enable OpenCode hooks by default

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus &lt;clio-agent@sisyphuslabs.ai&gt;

* feat: add default_skills config with all built-in skills

Add default_skills configuration to AgentDefaults with all 9 built-in skills: opencode, github-proxy, github, memory, cron, weather, tmux, skill-creator, summarize.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus &lt;clio-agent@sisyphuslabs.ai&gt;

* opencode skill默认关闭

* 修改readme

* 修复vikingbot agent和tui的爆粗9哦

* add openviking tools

* add openviking tools

* 优化hook

* 优化hook

* add openviking tools

* add openviking tools

* add openviking tools

* add openviking tools

* add openviking tools

* support skill/tool memory

* hooks提交一版

* hooks提交一版

* update

* add openviking tools

* add openviking tools

* update readme

* add openviking tools

* add openviking tools

* openviking memory

* ov Server

* ov Server

* tools message

* tools message

* tools message

* support skill memory

* update part

* refactor(deploy): 优化Docker部署配置

- 重构Dockerfile,优化构建流程和镜像大小
- 新增deploy/docker/Dockerfile,提供更灵活的构建配置
- 重构build-image.sh脚本,简化镜像构建流程
- 修改build-multiarch.sh,支持多架构构建
- 重构deploy.sh部署脚本,改进部署流程
- 新增docker-entrypoint.sh,优化容器启动流程
- 重构stop.sh脚本,改进容器停止逻辑

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* refactor(deploy): 重构VKE部署流程,移除Python脚本改用Shell

- 移除README.md和VKE_DEPLOY_README.md文档
- 新增deploy.sh Shell脚本替代原Python部署脚本
- 移除test.sh测试脚本
- 简化vke_deploy.example.yaml配置文件
- 移除vke_deploy.py和vke_with_opensandbox_deploy.py Python脚本
- 整体简化VKE部署流程,使用Shell脚本替代Python实现

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat(agent): 增强Agent工具功能

- 修改context.py,优化上下文构建
- 修改tools/base.py,改进工具基类
- 修改tools/image.py,增强图像处理工具功能
- 修改tools/registry.py,优化工具注册机制

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* refactor(channels): 重构Channels模块,优化飞书渠道实现

- 重构base.py,改进基础Channel类实现
- 大幅重构feishu.py,优化飞书渠道的消息处理流程
- 重构utils.py,改进渠道工具函数
- 整体提升Channels模块的可维护性和性能

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* refactor: 优化Console和Hooks模块

- 修改console/console_gradio_simple.py,优化控制台界面
- 修改hooks/builtins/openviking_hooks.py,改进钩子实现
- 修改hooks/manager.py,优化钩子管理器

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* tools message

* tools message

* 添加从镜像安装的方法

* tools message

* 添加从镜像安装的方法

* 版本限制不超过3.13(openviking 3.14上没有)

* 版本限制不超过3.13(openviking 3.14上没有)

* 版本限制不超过3.13(openviking 3.14上没有)

* 版本限制不超过3.13(openviking 3.14上没有)

* 版本限制不超过3.13(openviking 3.14上没有)

* vikingbot

* 优化图片生成逻辑

* vikingbot

* vikingbot

* vikingbot

* vikingbot

* vikingbot

* 飞书图片部分优化

* update tool

* vikingbot

* feat(skill): support zip upload for add_skill API (#312)

* feat(skill): support zip upload for add_skill API

- Add temp_path field to AddSkillRequest model
- Add zip extraction support in SkillProcessor._parse_skill()
- Add smart dual-mode upload in AsyncHTTPClient.add_skill()

This enables remote HTTP clients to upload skill directories as zip files,
following the same pattern as add_resource.

* feat(cli): add zip upload support for add_skill in Rust CLI

- Add smart dual-mode upload in add_skill() (same as add_resource)
- Fix missing auth headers in upload_temp_file()
- Reuse build_headers() to avoid code duplication

* feat(agfs): agfs新增binding client (#304)

* feat(agfs): agfs新增binding client

fix: viking_fs适配binding client, 简化agfs相关参数

* feat(agfs): agfs binding-client支持windows

* docs: 补充agfs binding-client用法

* fix(agfs): 默认带上agfs binding-client依赖库; setup.py支持编译该库

* fix(agfs): add agfs binding-client linux so

* fix(agfs): code format

* fix(parser): remove redundant mkdir in DirectoryParser (#318)

* fix: use original directory name for temp URI lookup in TreeBuilder (#319)

_finalize_from_temp() applies sanitize_segment() to the temp document
directory name (e.g. __test__ -> _test_), then uses the sanitized name
to construct temp_doc_uri. However, the actual temp directory retains
its original (unsanitized) name, causing FileNotFoundError during
_move_temp_to_dest().

Use the original directory name for temp_doc_uri (locating the temp
directory), while continuing to use the sanitized name for candidate_uri
(the final destination URI).

* fix: handle is_healthy() AttributeError when not initialized (closes #298) (#322)

ObserverService.is_healthy() threw AttributeError when called before
initialize() because self._config and self._vikingdb were None.

- Add None guards to vikingdb and vlm properties returning unhealthy
  ComponentStatus instead of crashing
- Add early return False in is_healthy() when dependencies not ready
- Add 4 tests covering the uninitialized state

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

* feat(docs,ci): 完善云上部署文档与 Docker CI 流程 (#320)

- release workflow 新增 Docker 镜像构建推送至 GHCR
- 重写 examples/cloud/GUIDE.md 云上部署指南,补充架构概览、systemd/Docker/Helm 三种部署方式、多租户管理、FAQ 等章节
- ov.conf.example 占位符改为 <your-xxx> 格式,移除 rerank 配置
- 中英文部署文档(docs/zh|en/guides/03-deployment.md)对齐:Docker 改用 GHCR 预构建镜像,Kubernetes 改用 Helm chart,并引用 GUIDE.md

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(agfs): import AGFSBindingClient error不阻塞http client使用 (#324)

* feat: Enhance add-resource functionality in cli and add unit tests (#323)

* tests(parsers): add unit tests for office extensions within add_resource directory

* feat: enhance add-resource functionality with new options

- Updated CLI commands to support additional parameters: --ignore-dirs, --include, --exclude, and --no-directly-upload-media.
- Modified resource processing to handle new parameters for directory scanning and file inclusion/exclusion.
- Improved README documentation for CLI usage and examples.

This update allows for more flexible resource management and better control over file uploads.

* feat(cli): enhance add-resource command with new options

- Added support for additional parameters: --no-strict, --ignore-dirs, --include, --exclude, and --no-directly-upload-media.
- Updated the handling of resource addition to accommodate new options for improved directory scanning and file management.
- Enhanced README documentation with examples for the new functionality.

This update provides users with greater flexibility in managing resources.

* chore(cli): remove unused cargo feature for edition 2024 in Cargo.toml

* chore(pyproject): update tag_regex in setuptools_scm configuration for version parsing

* feat: expose session(must_exist) and session_exists() on public API (#321)

The internal Session.exists() and SessionService.get() (added in #235)
provide session existence checks at the service layer, but these are
not accessible through the public client API (BaseClient and its
implementations).

This commit exposes two opt-in mechanisms at the public API level:

1. session(must_exist=True) — raises NotFoundError if the session
   directory does not exist. Default must_exist=False preserves full
   backward compatibility.

2. session_exists(session_id) — async convenience method returning
   True/False without loading the full session.

Both delegate to the existing Session.exists() internally. No changes
to session.py or session_service.py — this is purely a public API
surface addition.

Files changed (7):
- base.py: updated abstract interface
- local.py: must_exist via Session.exists(), session_exists() delegate
- http.py: must_exist via get_session() HTTP call, session_exists()
- sync_http.py: pass-through
- async_client.py: session(must_exist) + session_exists()
- sync_client.py: pass-through
- test_session_lifecycle.py: 6 new tests

* feat: wrapper ov command (#325)

Co-authored-by: openviking <openviking@example.com>

* Feat/vectordb interface refactor (#327)

* refactor: route vector access through semantic gateway

* refactor vector storage to collection-bound drivers

* refactor(storage): collapse gateway/interface into single-collection backend

* refactor vectordb backend to single-collection adapter model

* chore: align naming with vikingdb and rename session test

* fix

* docs: add guide for integrating third-party vectordb adapters

* vikingbot

* vikingbot

* vikingbot

* read

* vikingbot

* vikingbot

* 更新readme

* vikingbot

* vikingbot

* vikingbot

* 格式化 + 生成图片工具增加开关 直接发给用户(默认开)

* upodate

---------

Co-authored-by: chenjunwen <chenjunwen@bytedance.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: fujiajie.1030 <fujiajie.1030@bytedance.com>
Co-authored-by: SeanZ <zhangxu.shon@bytedance.com>
Co-authored-by: chuanbao666 <sunchuanbao@bytedance.com>
Co-authored-by: Hon Jia Xuan <hjaxuan@gmail.com>
Co-authored-by: ponsde <2126824294@qq.com>
Co-authored-by: r266-tech <r2668940489@gmail.com>
Co-authored-by: r266-tech <r266-tech@users.noreply.github.com>
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Eric Shaw <shaoeric@foxmail.com>
Co-authored-by: MaojiaSheng <shengmaojia@bytedance.com>
Co-authored-by: openviking <openviking@example.com>
Co-authored-by: kkkwjx <zhoujiahui.01@bytedance.com>
2026-02-28 09:36:57 +08:00
kkkwjx d89d869176 fix(vectordb): resolve timestamp format and collection creation issues (#154)
- Standardize timestamp generation to UTC ISO 8601 format to ensure VikingDB compatibility
- Fix bug where `get_or_create_volcengine_collection` returned None
- Refactor `create_collection` to properly handle ScalarIndex and filter date_time fields for remote backends
- Explicitly define scalar index fields in collection schema
2026-02-13 14:42:31 +08:00
qin-ctx f98dc0ed1c first commit 2026-01-29 20:29:19 +08:00