Skip to content

feat/vikingbot: viking bot mvp based on openviking#335

Merged
MaojiaSheng merged 132 commits intomainfrom
feat/vikingbot
Feb 28, 2026
Merged

feat/vikingbot: viking bot mvp based on openviking#335
MaojiaSheng merged 132 commits intomainfrom
feat/vikingbot

Conversation

@yeshion23333
Copy link
Collaborator

@yeshion23333 yeshion23333 commented Feb 27, 2026

Description

Vikingbot 基于openviking的初版bot

✨ 核心特性

Vikingbot 深度集成 OpenViking,提供强大的知识管理和记忆检索能力:

  • 本地/远程双模式:支持本地存储(~/.vikingbot/ov_data/)和远程服务器模式
  • 7 个专用 Agent 工具:资源管理、语义搜索、正则搜索、通配符搜索、记忆搜索
  • 三级内容访问:L0(摘要)、L1(概览)、L2(完整内容)
  • 会话记忆自动提交:对话历史自动保存到 OpenViking
  • Skill、Tool记忆:记录tool和skill的调用、检索,提交ov生成agent记忆

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

chenjw and others added 30 commits February 14, 2026 11:46
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- 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
## 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: ["/"]的危险配置
- 在SRT后端动态添加沙箱工作目录到allowWrite
- 确保只能操作沙箱内的文件,防止访问宿主机文件系统
- 说明SRT后端动态添加沙箱工作目录到allowWrite
- 明确沙箱内可操作、沙箱外被阻止的行为
- 记录默认配置为空列表,无需手动配置
- 在SRT后端动态添加/tmp到allowWrite
- 沙箱用户可以在/tmp目录下创建临时文件
- 自动激活虚拟环境
- 自动kill旧进程
- nohup后台启动并输出日志到~/logs/output.log
- 自动tail日志文件
- 在启动SRT进程时传递完整的环境变量
- 确保@anthropic-ai/sandbox-runtime能被正确找到
- 新增Console Web UI模块,基于FastAPI
- 添加配置管理、会话管理、工作区文件浏览API
- 集成HTMX前端,提供简洁的Web界面
- 新增deploy目录,包含本地、ECS、VKE部署配置
- 重构docker目录结构,移动到deploy/local
- 更新spec文档,添加13-console.md
- 更新飞书通道,支持图片消息接收
- 添加fastapi和uvicorn依赖
- 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>
- 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 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>
…pace

## 改动 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>
- 重构沙箱配置:去掉 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 添加缺少的方法
Adds html2text for HTML to Markdown conversion and beautifulsoup4 for HTML parsing, enabling richer content handling in Feishu channel.
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.
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.
…u 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
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;
… 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;
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;
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;
MaojiaSheng and others added 15 commits February 27, 2026 17:06
Co-authored-by: openviking <openviking@example.com>
* 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
@CLAassistant
Copy link

CLAassistant commented Feb 27, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
8 out of 12 committers have signed the CLA.

✅ yeshion23333
✅ SeanZ
✅ chenjw
✅ ponsde
✅ kkkwjx07
✅ MaojiaSheng
✅ shaoeric
✅ chuanbao666
❌ r266-tech
❌ honjiaxuan
❌ qin-ctx
❌ BytedanceFu
You have signed the CLA already but the status is still pending? Let us recheck it.

# Conflicts:
#	.github/workflows/release.yml
#	docs/en/guides/01-configuration.md
#	docs/zh/guides/01-configuration.md
#	openviking/server/routers/resources.py
#	tests/eval/test_ragas_validation.py
@yeshion23333 yeshion23333 changed the title feat/vikingbot: viking bot mvp based on openviking mvp feat/vikingbot: viking bot mvp based on openviking Feb 27, 2026
@MaojiaSheng MaojiaSheng merged commit 006a06f into main Feb 28, 2026
20 of 22 checks passed
@MaojiaSheng MaojiaSheng deleted the feat/vikingbot branch February 28, 2026 01:37
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.