Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
feat(bot):Refactoring, New Evaluation Module, Feishu channel Opt & Feature Enhancements (#428)
yeshion23333847e86ac360d
diff --git a/bot/.gitignore b/bot/.gitignoreindex d4a5f2ed4..19ba338ba 100644--- a/bot/.gitignore+++ b/bot/.gitignore@@ -9,6 +9,10 @@ yarn-debug.log*yarn-error.log*lerna-debug.log*+#eval+result/+test_data/+# OS.DS_StoreThumbs.dbdiff --git a/bot/README.md b/bot/README.mdindex c8e88a5cb..5f80c5170 100644--- a/bot/README.md+++ b/bot/README.md@@ -1,8 +1,17 @@-# Vikingbot**Vikingbot**, built on the [Nanobot](https://github.com/HKUDS/nanobot) project, is designed to deliver an OpenClaw-like bot integrated with OpenViking.+## ✨ Core Features of OpenViking++Vikingbot is deeply integrated with OpenViking, providing powerful knowledge management and memory retrieval capabilities:++- **Dual local/remote modes**: Supports local storage (`~/.openviking/data/`) and remote server mode+- **7 dedicated Agent tools**: Resource management, semantic search, regex search, glob search, memory search+- **Three-level content access**: L0 (summary), L1 (overview), L2 (full content)+- **Automatic session memory submission**: Conversation history is automatically saved to OpenViking+- **Model configuration**: Read from OpenViking configuration (`vlm` section), no need to set provider separately in bot configuration+## 📦 Install**Prerequisites**@@ -24,7 +33,6 @@ git clone https://github.com/volcengine/OpenVikingcd OpenViking/bot# Create a virtual environment using Python 3.11 or higher-# uv will automatically fetch the required Python version if it's missinguv venv --python 3.11# Activate environment@@ -79,6 +87,7 @@ vikingbot gatewayThis will automatically:- Create a default config at `~/.openviking/ov.conf`+- Create bot startup files in the OpenViking workspace, default path is `~/.openviking/data/bot/`- Start the Console Web UI at http://localhost:18791**2. Configure via Console**@@ -122,11 +131,12 @@ Verify Docker installation:docker --version```+### Quick Volcengine Image Registry Deployment (Recommended)### Quick Docker Deploy```bash# 1. Create necessary directories-mkdir -p ~/.vikingbot/+mkdir -p ~/.openviking/# 2. Start containerdocker run -d \@@ -161,325 +171,88 @@ If you want to build the Docker image locally:For more Docker deployment options, see [deploy/docker/README.md](deploy/docker/README.md).-## 💬 Chat Apps-Talk to your vikingbot through Telegram, Discord, WhatsApp, Feishu, Mochat, DingTalk, Slack, Email, or QQ — anytime, anywhere.-| Channel | Setup |-|---------|-------|-| **Telegram** | Easy (just a token) |-| **Discord** | Easy (bot token + intents) |-| **WhatsApp** | Medium (scan QR) |-| **Feishu** | Medium (app credentials) |-| **Mochat** | Medium (claw token + websocket) |-| **DingTalk** | Medium (app credentials) |-| **Slack** | Medium (bot + app tokens) |-| **Email** | Medium (IMAP/SMTP credentials) |-| **QQ** | Easy (app credentials) |--<details>-<summary><b>Telegram</b> (Recommended)</summary>--**1. Create a bot**-- Open Telegram, search `@BotFather`-- Send `/newbot`, follow prompts-- Copy the token--**2. Configure**--```json-{- "bot": {- "channels": [- {- "type": "telegram",- "enabled": true,- "token": "YOUR_BOT_TOKEN",- "allowFrom": ["YOUR_USER_ID"]- }- ]- }-}-```--> You can find your **User ID** in Telegram settings. It is shown as `@yourUserId`.-> Copy this value **without the `@` symbol** and paste it into the config file.---**3. Run**--```bash-vikingbot gateway-```--</details>--<details>-<summary><b>Mochat (Claw IM)</b></summary>--Uses **Socket.IO WebSocket** by default, with HTTP polling fallback.--**1. Ask vikingbot to set up Mochat for you**+For detailed configuration, please refer to [CHANNEL.md](bot/docs/CHANNEL.md).-Simply send this message to vikingbot (replace `xxx@xxx` with your real email):--```-Read https://raw.githubusercontent.com/HKUDS/MoChat/refs/heads/main/skills/vikingbot/skill.md and register on MoChat. My Email account is xxx@xxx Bind me as your owner and DM me on MoChat.-```--vikingbot will automatically register, configure `~/.openviking/ov.conf`, and connect to Mochat.--**2. Restart gateway**--```bash-vikingbot gateway-```--That's it — vikingbot handles the rest!--<br>--<details>-<summary>Manual configuration (advanced)</summary>--If you prefer to configure manually, add the following to `~/.openviking/ov.conf`:--> Keep `claw_token` private. It should only be sent in `X-Claw-Token` header to your Mochat API endpoint.--```json-{- "bot": {- "channels": [- {- "type": "mochat",- "enabled": true,- "base_url": "https://mochat.io",- "socket_url": "https://mochat.io",- "socket_path": "/socket.io",- "claw_token": "claw_xxx",- "agent_user_id": "6982abcdef",- "sessions": ["*"],- "panels": ["*"],- "reply_delay_mode": "non-mention",- "reply_delay_ms": 120000- }- ]- }-}-```----</details>--</details>--<details>-<summary><b>Discord</b></summary>--**1. Create a bot**-- Go to https://discord.com/developers/applications-- Create an application → Bot → Add Bot-- Copy the bot token--**2. Enable intents**-- In the Bot settings, enable **MESSAGE CONTENT INTENT**-- (Optional) Enable **SERVER MEMBERS INTENT** if you plan to use allow lists based on member data--**3. Get your User ID**-- Discord Settings → Advanced → enable **Developer Mode**-- Right-click your avatar → **Copy User ID**--**4. Configure**--```json-{- "bot": {- "channels": [- {- "type": "discord",- "enabled": true,- "token": "YOUR_BOT_TOKEN",- "allowFrom": ["YOUR_USER_ID"]- }- ]- }-}-```--**5. Invite the bot**-- OAuth2 → URL Generator-- Scopes: `bot`-- Bot Permissions: `Send Messages`, `Read Message History`-- Open the generated invite URL and add the bot to your server--**6. Run**--```bash-vikingbot gateway-```--</details>--<details>-<summary><b>WhatsApp</b></summary>--Requires **Node.js ≥18**.--**1. Link device**--```bash-vikingbot channels login-# Scan QR with WhatsApp → Settings → Linked Devices-```--**2. Configure**--```json-{- "bot": {- "channels": [- {- "type": "whatsapp",- "enabled": true,- "allowFrom": ["+1234567890"]- }- ]- }-}-```--**3. Run** (two terminals)--```bash-# Terminal 1-vikingbot channels login--# Terminal 2-vikingbot gateway-```--</details>--<details>-<summary><b>Feishu (飞书)</b></summary>--Uses **WebSocket** long connection — no public IP required.--**1. Create a Feishu bot**-- Visit [Feishu Open Platform](https://open.feishu.cn/app)-- Create a new app → Enable **Bot** capability-- **Permissions**: Add `im:message` (send messages)-- **Events**: Add `im.message.receive_v1` (receive messages)- - Select **Long Connection** mode (requires running vikingbot first to establish connection)-- Get **App ID** and **App Secret** from "Credentials & Basic Info"-- Publish the app+## 🌐 Agent Social Network-**2. Configure**+🐈 vikingbot is capable of linking to the agent social network (agent community). **Just send one message and your vikingbot joins automatically!**-```json-{- "bot": {- "channels": [- {- "type": "feishu",- "enabled": true,- "appId": "cli_xxx",- "appSecret": "xxx",- "encryptKey": "",- "verificationToken": "",- "allowFrom": []- }- ]- }-}-```+| Platform | How to Join (send this message to your bot) |+|----------|-------------|+| [**Moltbook**](https://www.moltbook.com/) | `Read https://moltbook.com/skill.md and follow the instructions to join Moltbook` |+| [**ClawdChat**](https://clawdchat.ai/) | `Read https://clawdchat.ai/skill.md and follow the instructions to join ClawdChat` |-> `encryptKey` and `verificationToken` are optional for Long Connection mode.-> `allowFrom`: Leave empty to allow all users, or add `["ou_xxx"]` to restrict access.+Simply send the command above to your vikingbot (via CLI or any chat channel), and it will handle the rest.-**3. Run**+## ⚙️ Configuration-```bash-vikingbot gateway-```+Config file: `~/.openviking/ov.conf` (custom path can be set via environment variable `OPENVIKING_CONFIG_FILE`)> [!TIP]-> Feishu uses WebSocket to receive messages — no webhook or public IP needed!--</details>--<details>-<summary><b>QQ (QQ单聊)</b></summary>--Uses **botpy SDK** with WebSocket — no public IP required. Currently supports **private messages only**.--**1. Register & create bot**-- Visit [QQ Open Platform](https://q.qq.com) → Register as a developer (personal or enterprise)-- Create a new bot application-- Go to **开发设置 (Developer Settings)** → copy **AppID** and **AppSecret**+> Vikingbot shares the same configuration file with OpenViking. Configuration items are located under the `bot` field of the file, and will automatically merge global configurations such as `vlm`, `storage`, `server`, etc. No need to maintain a separate configuration file.-**2. Set up sandbox for testing**-- In the bot management console, find **沙箱配置 (Sandbox Config)**-- Under **在消息列表配置**, click **添加成员** and add your own QQ number-- Once added, scan the bot's QR code with mobile QQ → open the bot profile → tap "发消息" to start chatting--**3. Configure**--> - `allowFrom`: Leave empty for public access, or add user openids to restrict. You can find openids in the vikingbot logs when a user messages the bot.-> - For production: submit a review in the bot console and publish. See [QQ Bot Docs](https://bot.q.qq.com/wiki/) for the full publishing flow.+> [!IMPORTANT]+> After modifying the configuration (either via Console UI or by editing the file directly),+> you need to restart the gateway service for changes to take effect.+### OpenViking Server Configuration+The bot will connect to the remote OpenViking server. Please start the OpenViking Server before use. By default, the OpenViking server information configured in `ov.conf` is used+- OpenViking default startup address is 127.0.0.1:1933+- If `root_api_key` is configured, multi-tenant mode is enabled. For details, see [Multi-tenant](https://github.com/volcengine/OpenViking/blob/main/examples/multi_tenant/README.md)+- OpenViking Server configuration example```json{- "bot": {- "channels": [- {- "type": "qq",- "enabled": true,- "appId": "YOUR_APP_ID",- "secret": "YOUR_APP_SECRET",- "allowFrom": []- }- ]+ "server": {+ "host": "127.0.0.1",+ "port": 1933,+ "root_api_key": "test"}}```-**4. Run**--```bash-vikingbot gateway-```--Now send a message to the bot from QQ — it should respond!--</details>--<details>-<summary><b>DingTalk (钉钉)</b></summary>--Uses **Stream Mode** — no public IP required.--**1. Create a DingTalk bot**-- Visit [DingTalk Open Platform](https://open-dev.dingtalk.com/)-- Create a new app -> Add **Robot** capability-- **Configuration**:- - Toggle **Stream Mode** ON-- **Permissions**: Add necessary permissions for sending messages-- Get **AppKey** (Client ID) and **AppSecret** (Client Secret) from "Credentials"-- Publish the app--**2. Configure**+### Bot Configuration+All configurations are under the `bot` field in `ov.conf`, with default values for configuration items. The optional manual configuration items are described as follows:+- `agents`: Agent configuration+ - `max_tool_iterations`: Maximum number of cycles for a single round of conversation tasks, returns results directly if exceeded+ - `memory_window`: Upper limit of conversation rounds for automatically submitting sessions to OpenViking+ - `gen_image_model`: Model for generating images+- `gateway`: Gateway configuration+ - `host`: Gateway listening address, default value is `0.0.0.0`+ - `port`: Gateway listening port, default value is `18790`+- `sandbox`: Sandbox configuration+ - `mode`: Sandbox mode, optional values are `shared` (all sessions share workspace) or `private` (private, workspace isolated by Channel and session). Default value is `shared`.+- `ov_server`: OpenViking Server configuration.+ - If not configured, the OpenViking server information configured in `ov.conf` is used by default+ - If you don't use the locally started OpenViking Server, you can configure the url and the corresponding root user's API Key here+- `channels`: Message platform configuration, see [Message Platform Configuration](bot/docs/CHANNEL.md) for details```json{"bot": {+ "agents": {+ "max_tool_iterations": 50,+ "memory_window": 50,+ "gen_image_model": "openai/doubao-seedream-4-5-251128"+ },+ "gateway": {+ "host": "0.0.0.0",+ "port": 18790+ },+ "sandbox": {+ "mode": "shared"+ },+ "ov_server": {+ "server_url": "http://127.0.0.1:1933",+ "root_api_key": "test"+ },"channels": [{- "type": "dingtalk",+ "type": "feishu","enabled": true,- "clientId": "YOUR_APP_KEY",- "clientSecret": "YOUR_APP_SECRET",+ "appId": "",+ "appSecret": "","allowFrom": []}]@@ -487,136 +260,34 @@ Uses **Stream Mode** — no public IP required.}```-> `allowFrom`: Leave empty to allow all users, or add `["staffId"]` to restrict access.+### OpenViking Agent Tools-**3. Run**+Vikingbot provides 7 dedicated OpenViking tools:-```bash-vikingbot gateway-```+| Tool Name | Description |+|----------|------|+| `openviking_read` | Read OpenViking resources (supports three levels: abstract/overview/read) |+| `openviking_list` | List OpenViking resources |+| `openviking_search` | Semantic search OpenViking resources |+| `openviking_add_resource` | Add local files as OpenViking resources |+| `openviking_grep` | Search OpenViking resources using regular expressions |+| `openviking_glob` | Match OpenViking resources using glob patterns |+| `user_memory_search` | Search OpenViking user memory |-</details>--<details>-<summary><b>Slack</b></summary>--Uses **Socket Mode** — no public URL required.+### OpenViking Hooks-**1. Create a Slack app**-- Go to [Slack API](https://api.slack.com/apps) → **Create New App** → "From scratch"-- Pick a name and select your workspace--**2. Configure the app**-- **Socket Mode**: Toggle ON → Generate an **App-Level Token** with `connections:write` scope → copy it (`xapp-...`)-- **OAuth & Permissions**: Add bot scopes: `chat:write`, `reactions:write`, `app_mentions:read`-- **Event Subscriptions**: Toggle ON → Subscribe to bot events: `message.im`, `message.channels`, `app_mention` → Save Changes-- **App Home**: Scroll to **Show Tabs** → Enable **Messages Tab** → Check **"Allow users to send Slash commands and messages from the messages tab"**-- **Install App**: Click **Install to Workspace** → Authorize → copy the **Bot Token** (`xoxb-...`)--**3. Configure vikingbot**+Vikingbot enables OpenViking hooks by default:```json{- "bot": {- "channels": [- {- "type": "slack",- "enabled": true,- "botToken": "xoxb-...",- "appToken": "xapp-...",- "groupPolicy": "mention"- }- ]- }+ "hooks": ["vikingbot.hooks.builtins.openviking_hooks.hooks"]}```-**4. Run**--```bash-vikingbot gateway-```--DM the bot directly or @mention it in a channel — it should respond!--> [!TIP]-> - `groupPolicy`: `"mention"` (default — respond only when @mentioned), `"open"` (respond to all channel messages), or `"allowlist"` (restrict to specific channels).-> - DM policy defaults to open. Set `"dm": {"enabled": false}` to disable DMs.--</details>--<details>-<summary><b>Email</b></summary>--Give vikingbot its own email account. It polls **IMAP** for incoming mail and replies via **SMTP** — like a personal email assistant.--**1. Get credentials (Gmail example)**-- Create a dedicated Gmail account for your bot (e.g. `[email protected]`)-- Enable 2-Step Verification → Create an [App Password](https://myaccount.google.com/apppasswords)-- Use this app password for both IMAP and SMTP--**2. Configure**--> - `consentGranted` must be `true` to allow mailbox access. This is a safety gate — set `false` to fully disable.-> - `allowFrom`: Leave empty to accept emails from anyone, or restrict to specific senders.-> - `smtpUseTls` and `smtpUseSsl` default to `true` / `false` respectively, which is correct for Gmail (port 587 + STARTTLS). No need to set them explicitly.-> - Set `"autoReplyEnabled": false` if you only want to read/analyze emails without sending automatic replies.--```json-{- "bot": {- "channels": [- {- "type": "email",- "enabled": true,- "consentGranted": true,- "imapHost": "imap.gmail.com",- "imapPort": 993,- "imapUsername": "[email protected]",- "imapPassword": "your-app-password",- "smtpHost": "smtp.gmail.com",- "smtpPort": 587,- "smtpUsername": "[email protected]",- "smtpPassword": "your-app-password",- "fromAddress": "[email protected]",- "allowFrom": ["[email protected]"]- }- ]- }-}-```---**3. Run**--```bash-vikingbot gateway-```--</details>--## 🌐 Agent Social Network--🐈 vikingbot is capable of linking to the agent social network (agent community). **Just send one message and your vikingbot joins automatically!**--| Platform | How to Join (send this message to your bot) |-|----------|-------------|-| [**Moltbook**](https://www.moltbook.com/) | `Read https://moltbook.com/skill.md and follow the instructions to join Moltbook` |-| [**ClawdChat**](https://clawdchat.ai/) | `Read https://clawdchat.ai/skill.md and follow the instructions to join ClawdChat` |--Simply send the command above to your vikingbot (via CLI or any chat channel), and it will handle the rest.--## ⚙️ Configuration--Config file: `~/.openviking/ov.conf`--> [!IMPORTANT]-> After modifying the configuration (either via Console UI or by editing the file directly),-> you need to restart the gateway service for changes to take effect.--> [!NOTE]-> Configuration has been migrated from `~/.vikingbot/config.json` to `~/.openviking/ov.conf`.-> The configuration is now nested under the `bot` key.+| Hook | Function |+|------|------|+| `OpenVikingCompactHook` | Automatically submit session messages to OpenViking |+| `OpenVikingPostCallHook` | Post tool call hook (for testing purposes) |### Manual Configuration (Advanced)@@ -741,11 +412,13 @@ Add to `~/.openviking/ov.conf`:```json{- "langfuse": {- "enabled": true,- "secret_key": "sk-lf-vikingbot-secret-key-2026",- "public_key": "pk-lf-vikingbot-public-key-2026",- "base_url": "http://localhost:3000"+ "bot": {+ "langfuse": {+ "enabled": true,+ "secret_key": "sk-lf-vikingbot-secret-key-2026",+ "public_key": "pk-lf-vikingbot-public-key-2026",+ "base_url": "http://localhost:3000"+ }}}```@@ -786,9 +459,11 @@ You only need to add sandbox configuration when you want to change these default**To use a different backend or mode:**```json{- "sandbox": {- "backend": "opensandbox",- "mode": "per-session"+ "bot": {+ "sandbox": {+ "backend": "opensandbox",+ "mode": "per-session"+ }}}```@@ -813,10 +488,12 @@ You only need to add sandbox configuration when you want to change these default**Direct Backend:**```json{- "sandbox": {- "backends": {- "direct": {- "restrictToWorkspace": false+ "bot": {+ "sandbox": {+ "backends": {+ "direct": {+ "restrictToWorkspace": false+ }}}}@@ -826,13 +503,15 @@ You only need to add sandbox configuration when you want to change these default**OpenSandbox Backend:**```json{- "sandbox": {- "backend": "opensandbox",- "backends": {- "opensandbox": {- "serverUrl": "http://localhost:18792",- "apiKey": "",- "defaultImage": "opensandbox/code-interpreter:v1.0.1"+ "bot": {+ "sandbox": {+ "backend": "opensandbox",+ "backends": {+ "opensandbox": {+ "serverUrl": "http://localhost:18792",+ "apiKey": "",+ "defaultImage": "opensandbox/code-interpreter:v1.0.1"+ }}}}@@ -842,12 +521,14 @@ You only need to add sandbox configuration when you want to change these default**Docker Backend:**```json{- "sandbox": {- "backend": "docker",- "backends": {- "docker": {- "image": "python:3.11-slim",- "networkMode": "bridge"+ "bot": {+ "sandbox": {+ "backend": "docker",+ "backends": {+ "docker": {+ "image": "python:3.11-slim",+ "networkMode": "bridge"+ }}}}@@ -857,25 +538,27 @@ You only need to add sandbox configuration when you want to change these default**SRT Backend:**```json{- "sandbox": {- "backend": "srt",- "backends": {- "srt": {- "settingsPath": "~/.vikingbot/srt-settings.json",- "nodePath": "node",- "network": {- "allowedDomains": [],- "deniedDomains": [],- "allowLocalBinding": false- },- "filesystem": {- "denyRead": [],- "allowWrite": [],- "denyWrite": []- },- "runtime": {- "cleanupOnExit": true,- "timeout": 300+ "bot": {+ "sandbox": {+ "backend": "srt",+ "backends": {+ "srt": {+ "settingsPath": "~/.vikingbot/srt-settings.json",+ "nodePath": "node",+ "network": {+ "allowedDomains": [],+ "deniedDomains": [],+ "allowLocalBinding": false+ },+ "filesystem": {+ "denyRead": [],+ "allowWrite": [],+ "denyWrite": []+ },+ "runtime": {+ "cleanupOnExit": true,+ "timeout": 300+ }}}}@@ -886,11 +569,13 @@ You only need to add sandbox configuration when you want to change these default**AIO Sandbox Backend:**```json{- "sandbox": {- "backend": "aiosandbox",- "backends": {- "aiosandbox": {- "baseUrl": "http://localhost:18794"+ "bot": {+ "sandbox": {+ "backend": "aiosandbox",+ "backends": {+ "aiosandbox": {+ "baseUrl": "http://localhost:18794"+ }}}}@@ -941,10 +626,12 @@ If `node` command is not found in PATH, specify the full path in your config:```json{- "sandbox": {- "backends": {- "srt": {- "nodePath": "/usr/local/bin/node"+ "bot": {+ "sandbox": {+ "backends": {+ "srt": {+ "nodePath": "/usr/local/bin/node"+ }}}}diff --git a/bot/README_CN.md b/bot/README_CN.mdindex 48f879663..ed97a0d88 100644--- a/bot/README_CN.md+++ b/bot/README_CN.md@@ -175,7 +175,7 @@ docker logs --tail 50 -f vikingbot通过 Telegram、Discord、WhatsApp、飞书、Mochat、钉钉、Slack、邮件或 QQ 与您的 vikingbot 对话 —— 随时随地。-详细配置请参考 [CHANNEL.md](CHANNEL.md)。+详细配置请参考 [CHANNEL.md](bot/docs/CHANNEL.md)。## 🌐 代理社交网络@@ -229,7 +229,7 @@ bot将连接远程的OpenViking服务器,使用前需启动Openviking Server- ov_server:OpenViking Server 配置。- 不配置,默认使用`ov.conf`中配置的OpenViking server信息- 若不使用本地启动的OpenViking Server,可在此配置url和对应的root user的API Key-- channels:消息平台配置,详见 [消息平台配置](CHANNEL.md)+- channels:消息平台配置,详见 [消息平台配置](bot/docs/CHANNEL.md)```json{diff --git a/bot/CHANNEL.md b/bot/docs/CHANNEL.mdsimilarity index 100%rename from bot/CHANNEL.mdrename to bot/docs/CHANNEL.mddiff --git a/bot/eval/locomo/judge.py b/bot/eval/locomo/judge.pynew file mode 100644index 000000000..bd76528ef--- /dev/null+++ b/bot/eval/locomo/judge.py@@ -0,0 +1,165 @@+import argparse+import csv+import json+import os+import asyncio+from openai import AsyncOpenAI+from dotenv import load_dotenv++load_dotenv()+++async def grade_answer(+ llm_client, model: str, question: str, gold_answer: str, response: str+) -> tuple[bool, str]:+ system_prompt = """+ You are an expert grader that determines if answers to questions match a gold standard answer+ """++ ACCURACY_PROMPT = f"""+ Your task is to label an answer to a question as 'CORRECT' or 'WRONG'. You will be given the following data:+ (1) a question (posed by one user to another user),+ (2) a 'gold' (ground truth) answer,+ (3) a generated answer+ which you will score as CORRECT/WRONG.++ The point of the question is to ask about something one user should know about the other user based on their prior conversations.+ The gold answer will usually be a concise and short answer that includes the referenced topic, for example:+ Question: Do you remember what I got the last time I went to Hawaii?+ Gold answer: A shell necklace+ The generated answer might be much longer, but you should be generous with your grading - as long as it touches on the same topic as the gold answer, it should be counted as CORRECT.++ For time related questions, the gold answer will be a specific date, month, year, etc. The generated answer might be much longer or use relative time references (like "last Tuesday" or "next month"), but you should be generous with your grading - as long as it refers to the same date or time period as the gold answer, it should be counted as CORRECT. Even if the format differs (e.g., "May 7th" vs "7 May"), consider it CORRECT if it's the same date.++ Now it's time for the real question:+ Question: {question}+ Gold answer: {gold_answer}+ Generated answer: {response}++ First, provide a short (one sentence) explanation of your reasoning, then finish with CORRECT or WRONG.+ Do NOT include both CORRECT and WRONG in your response, or it will break the evaluation script.++ Respond with JSON only: {{"is_correct": "CORRECT" or "WRONG", "reasoning": "your explanation"}}+ """++ try:+ resp = await llm_client.chat.completions.create(+ model=model,+ messages=[+ {"role": "system", "content": system_prompt},+ {"role": "user", "content": ACCURACY_PROMPT},+ ],+ temperature=0,+ timeout=60,+ )+ content = resp.choices[0].message.content.strip()+ # 提取JSON内容+ start_idx = content.find("{")+ end_idx = content.rfind("}")+ if start_idx != -1 and end_idx != -1:+ json_str = content[start_idx : end_idx + 1].strip()+ result = json.loads(json_str)+ is_correct = result.get("is_correct", "WRONG").strip().upper() == "CORRECT"+ reasoning = result.get("reasoning", "")+ return is_correct, reasoning+ return False, f"[PARSE ERROR] Invalid response: {content}"+ except Exception as e:+ return False, f"[API ERROR] {str(e)}"+++def load_answers(input_path: str) -> tuple[list[dict], list[str]]:+ """加载待评分的回答,返回所有行和表头"""+ if not os.path.exists(input_path):+ raise FileNotFoundError(f"Input file not found: {input_path}")++ with open(input_path, "r", encoding="utf-8", newline="") as f:+ reader = csv.DictReader(f)+ fieldnames = reader.fieldnames.copy()+ # 新增reasoning列如果不存在+ if "reasoning" not in fieldnames:+ fieldnames.append("reasoning")+ rows = list(reader)+ return rows, fieldnames+++async def main():+ parser = argparse.ArgumentParser(+ description="VikingBot QA judge script, same logic as openclaw evaluation"+ )+ parser.add_argument(+ "--input",+ default="./result/locomo_qa_result.csv",+ help="Path to QA result csv file, default: ./result/locomo_qa_result.csv",+ )+ parser.add_argument(+ "--base-url",+ default="https://ark.cn-beijing.volces.com/api/v3",+ help="Volcengine API base URL, default: https://ark.cn-beijing.volces.com/api/v3",+ )+ parser.add_argument(+ "--token",+ default=os.getenv("ARK_API_KEY", os.getenv("OPENAI_API_KEY", "")),+ help="Volcengine API token, default from ARK_API_KEY or OPENAI_API_KEY env var",+ )+ parser.add_argument(+ "--model",+ default="doubao-seed-2-0-pro-260215",+ help="Judge model name, default: doubao-seed-2-0-pro-260215",+ )+ parser.add_argument(+ "--parallel", type=int, default=5, help="Parallel request count, default: 5"+ )+ args = parser.parse_args()++ if not args.token:+ print("Error: API token is required, set ARK_API_KEY env var or pass via --token")+ exit(1)++ # 加载数据+ rows, fieldnames = load_answers(args.input)+ total = len(rows)+ # 筛选未评分的行+ ungraded = [i for i, row in enumerate(rows) if not row.get("result")]+ print(f"Total answers: {total}, ungraded: {len(ungraded)}")++ if not ungraded:+ print("All answers already graded, exit")+ return++ # 初始化OpenAI客户端+ client = AsyncOpenAI(base_url=args.base_url, api_key=args.token)++ # 并发处理+ semaphore = asyncio.Semaphore(args.parallel)++ async def process_row(idx):+ async with semaphore:+ row = rows[idx]+ question = row["question"]+ gold = row["answer"]+ response = row["response"]+ print(f"Grading {idx + 1}/{total}: {question[:60]}...")+ is_correct, reasoning = await grade_answer(client, args.model, question, gold, response)+ row["result"] = "CORRECT" if is_correct else "WRONG"+ row["reasoning"] = reasoning+ return idx, row++ tasks = [process_row(idx) for idx in ungraded]+ await asyncio.gather(*tasks)++ # 统计结果+ correct = sum(1 for row in rows if row.get("result") == "CORRECT")+ total_graded = sum(1 for row in rows if row.get("result"))+ accuracy = correct / total_graded if total_graded > 0 else 0.0+ print(f"\nGrading completed: {correct}/{total_graded} correct, accuracy: {accuracy:.2%}")++ # 写回CSV+ with open(args.input, "w", encoding="utf-8", newline="") as f:+ writer = csv.DictWriter(f, fieldnames=fieldnames)+ writer.writeheader()+ writer.writerows(rows)+ print(f"Results saved to {args.input}")+++if __name__ == "__main__":+ asyncio.run(main())diff --git a/bot/eval/locomo/run_eval.py b/bot/eval/locomo/run_eval.pynew file mode 100644index 000000000..65e61cb87--- /dev/null+++ b/bot/eval/locomo/run_eval.py@@ -0,0 +1,194 @@+import argparse+import json+import subprocess+import time+import csv+import os+import re+++def load_locomo_qa(+ input_path: str, sample_index: int | None = None, count: int | None = None+) -> list[dict]:+ """加载LoCoMo数据集的QA部分,逻辑同原eval.py"""+ with open(input_path, "r", encoding="utf-8") as f:+ data = json.load(f)++ qa_list = []+ if sample_index is not None:+ if sample_index < 0 or sample_index >= len(data):+ raise ValueError(f"sample index {sample_index} out of range (0-{len(data) - 1})")+ samples = [data[sample_index]]+ else:+ samples = data++ for sample in samples:+ sample_id = sample.get("sample_id", "")+ for qa in sample.get("qa", []):+ qa_list.append(+ {+ "sample_id": sample_id,+ "question": qa["question"],+ "answer": qa["answer"],+ "category": qa.get("category", ""),+ "evidence": qa.get("evidence", []),+ }+ )++ if count is not None:+ qa_list = qa_list[:count]+ return qa_list+++def run_vikingbot_chat(question: str) -> tuple[str, dict, float]:+ """执行vikingbot chat命令,返回回答、token使用情况、耗时(秒)"""+ input = f"Answer the question directly: {question}"+ cmd = ["vikingbot", "chat", "-m", input, "-e"]+ start_time = time.time()+ try:+ result = subprocess.run(cmd, capture_output=True, text=True, check=True, timeout=300)+ end_time = time.time()+ time_cost = end_time - start_time++ output = result.stdout.strip()+ # 解析返回的json结果,处理换行、多余前缀等特殊情况+ try:+ # 先去掉[Pasted前缀+ output = output.replace("[Pasted", "").strip()+ # 提取第一个{到最后一个}之间的有效JSON内容,清除换行和多余空白+ start_idx = output.find("{")+ end_idx = output.rfind("}")+ if start_idx != -1 and end_idx != -1:+ json_str = (+ output[start_idx : end_idx + 1].replace("\n", " ").replace("\r", "").strip()+ )+ # 处理text内容中未转义的双引号+ json_str = re.sub(+ r'"text": "(.*?)"(?=, "token_usage")',+ lambda m: '"text": "%s"' % m.group(1).replace('"', '\\"'),+ json_str,+ )+ resp_json = json.loads(json_str)+ response = resp_json.get("text", "")+ token_usage = resp_json.get(+ "token_usage", {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}+ )+ time_cost = resp_json.get("time_cost", time_cost)+ else:+ raise ValueError("No valid JSON structure found in output")+ except (json.JSONDecodeError, ValueError) as e:+ response = f"[PARSE ERROR] {output}"+ token_usage = {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}+ return response, token_usage, time_cost+ except subprocess.CalledProcessError as e:+ return (+ f"[CMD ERROR] {e.stderr}",+ {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0},+ 0,+ )+ except subprocess.TimeoutExpired:+ time_cost = 0+ return (+ "[TIMEOUT]",+ {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0},+ time_cost,+ )+++def load_processed_questions(output_path: str) -> set:+ """加载已处理的问题集合,避免重复执行"""+ processed = set()+ if os.path.exists(output_path):+ with open(output_path, "r", encoding="utf-8", newline="") as f:+ reader = csv.DictReader(f)+ for row in reader:+ processed.add(row["question"])+ return processed+++def main():+ parser = argparse.ArgumentParser(description="VikingBot QA evaluation script")+ parser.add_argument(+ "input",+ nargs="?",+ default="./locomo10.json",+ help="Path to locomo10.json file, default: ./locomo10.json",+ )+ parser.add_argument(+ "--output",+ default="./result/locomo_qa_result.csv",+ help="Path to output csv file, default: ./result/locomo_qa_result.csv",+ )+ parser.add_argument(+ "--sample",+ type=int,+ default=None,+ help="LoCoMo sample index (0-based), default all samples",+ )+ parser.add_argument(+ "--count", type=int, default=None, help="Number of QA questions to run, default all"+ )+ args = parser.parse_args()++ # 确保输出目录存在+ os.makedirs(os.path.dirname(args.output), exist_ok=True)++ # 加载QA数据+ qa_list = load_locomo_qa(args.input, args.sample, args.count)+ total = len(qa_list)++ # 加载已处理的问题+ processed_questions = load_processed_questions(args.output)+ remaining = total - len(processed_questions)+ print(+ f"Loaded {total} QA questions, {len(processed_questions)} already processed, {remaining} remaining"+ )++ fieldnames = [+ "sample_id",+ "question",+ "answer",+ "response",+ "token_usage",+ "time_cost",+ "result",+ ]+ # 打开CSV文件,不存在则创建写表头,存在则追加+ file_exists = os.path.exists(args.output)+ with open(args.output, "a+", encoding="utf-8", newline="") as f:+ writer = csv.DictWriter(f, fieldnames=fieldnames)+ if not file_exists:+ writer.writeheader()+ f.flush()++ processed_count = len(processed_questions)+ for idx, qa_item in enumerate(qa_list, 1):+ question = qa_item["question"]+ if question in processed_questions:+ print(f"Skipping {idx}/{total}: already processed")+ continue++ answer = qa_item["answer"]+ print(f"Processing {idx}/{total}: {question[:60]}...")+ response, token_usage, time_cost = run_vikingbot_chat(question)++ row = {+ "sample_id": qa_item["sample_id"],+ "question": question,+ "answer": answer,+ "response": response,+ "token_usage": json.dumps(token_usage, ensure_ascii=False),+ "time_cost": round(time_cost, 2),+ "result": "",+ }+ writer.writerow(row)+ f.flush()+ processed_questions.add(question)+ processed_count += 1+ print(f"Completed {processed_count}/{total}, time cost: {round(time_cost, 2)}s")++ print(f"Evaluation completed, results saved to {args.output}")+++if __name__ == "__main__":+ main()diff --git a/bot/vikingbot/agent/context.py b/bot/vikingbot/agent/context.pyindex 25570043e..0251a9abc 100644--- a/bot/vikingbot/agent/context.py+++ b/bot/vikingbot/agent/context.py@@ -89,14 +89,19 @@ class ContextBuilder:if self.sandbox_manager:sandbox_cwd = await self.sandbox_manager.get_sandbox_cwd(session_key)parts.append(- f"## Sandbox Environment\n\nYou are running in a sandboxed environment. All file operations and command execution are restricted to the sandbox directory.\nThe sandbox root directory is `{sandbox_cwd}` (use relative paths for all operations)."+ f"## Sandbox Environment\nYou are running in a sandboxed environment. All file operations and command execution are restricted to the sandbox directory.\nThe sandbox root directory is `{sandbox_cwd}` (use relative paths for all operations).")- # Add group chat context if applicable- if self._is_group_chat:- parts.append(- f"\n\n## Group Chat Context\nThis is a group chat session. Multiple users can participate in this conversation. Each user message is prefixed with the user ID in brackets like @<user_id>. "- f"You should pay attention to who is speaking to understand the context. Current user ID: {self._sender_id}")+ # Add session context+ session_context ="## Current Session"+ if session_key and session_key.type:+ session_context += f"\nChannel: {session_key.type}"+ if self._is_group_chat:+ session_context += (+ f"\n**Group chat session.** Current user ID: {self._sender_id}\n"+ f"Multiple users can participate in this conversation. Each user message is prefixed with the user ID in brackets like @<user_id>. "+ f"You should pay attention to who is speaking to understand the context. ")+ parts.append(session_context)# Viking user profileprofile = await self.memory.get_viking_user_profile(@@ -160,7 +165,6 @@ Skills with available="false" need dependencies installed first - you can try inworkspace_display = workspace_pathreturn f"""# vikingbot 🐈-You are VikingBot, an AI assistant built based on the OpenViking context database.When acquiring information, data, and knowledge, you **prioritize using openviking tools to read and search OpenViking (a context database) above all other sources**.You have access to tools that allow you to:@@ -193,7 +197,7 @@ Always be helpful, accurate, and concise. When using tools, think step by step:## Memory- Remember important facts: using openviking_memory_commit tool to commit-- Recall past events: prioritize using user_memory_search tool to search history, or grep {workspace_display}/memory/HISTORY.md"""+- Recall past events: prioritize using user_memory_search tool to search history"""def _load_bootstrap_files(self) -> str:"""Load all bootstrap files from workspace."""@@ -203,7 +207,8 @@ Always be helpful, accurate, and concise. When using tools, think step by step:file_path = self.workspace / filenameif file_path.exists():content = file_path.read_text(encoding="utf-8")- parts.append(f"## {filename}\n\n{content}")+ if content:+ parts.append(f"## {filename}\n\n{content}")return "\n\n".join(parts) if parts else ""@@ -230,8 +235,6 @@ Always be helpful, accurate, and concise. When using tools, think step by step:# System promptsystem_prompt = await self.build_system_prompt(session_key, current_message, history)- if session_key and session_key.channel_id and session_key.chat_id:- system_prompt += f"\n\n## Current Session\nChannel: {session_key.type}:{session_key.channel_id}\nChat ID: {session_key.chat_id}"messages.append({"role": "system", "content": system_prompt})# logger.debug(f"system_prompt: {system_prompt}")diff --git a/bot/vikingbot/agent/loop.py b/bot/vikingbot/agent/loop.pyindex 349dca90e..8a71adf82 100644--- a/bot/vikingbot/agent/loop.py+++ b/bot/vikingbot/agent/loop.py@@ -365,6 +365,7 @@ class AgentLoop:"""# Handle system messages (subagent announces)# The chat_id contains the original "channel:chat_id" to route back to+ start_time = time.time()if msg.session_key.type == "system":return await self._process_system_message(msg)@@ -437,11 +438,13 @@ class AgentLoop:)await self.sessions.save(session)+ time_cost = round(time.time() - start_time, 2)return OutboundMessage(session_key=msg.session_key,content=final_content,metadata=msg.metadata,- token_usage=self._token_usage+ token_usage=self._token_usage,+ time_cost=time_costor {}, # Pass through for channel-specific needs (e.g. Slack thread_ts))diff --git a/bot/vikingbot/agent/memory.py b/bot/vikingbot/agent/memory.pyindex 1a7b43a08..67ec7c714 100644--- a/bot/vikingbot/agent/memory.py+++ b/bot/vikingbot/agent/memory.py@@ -48,7 +48,7 @@ class MemoryStore:async def get_viking_memory_context(self, current_message: str, workspace_id: str) -> str:client = await VikingClient.create(agent_id=workspace_id)admin_user_id = load_config().ov_server.admin_user_id- result = await client.search_memory(current_message, user_id=admin_user_id, limit=5)+ result = await client.search_memory(current_message, user_id=admin_user_id, limit=3)if not result:return ""user_memory = self._parse_viking_memory(result["user_memory"])diff --git a/bot/vikingbot/agent/skills.py b/bot/vikingbot/agent/skills.pyindex b524ddbfa..2c0b06f7d 100644--- a/bot/vikingbot/agent/skills.py+++ b/bot/vikingbot/agent/skills.py@@ -46,16 +46,6 @@ class SkillsLoader:{"name": skill_dir.name, "path": str(skill_file), "source": "workspace"})- # Built-in skills- if self.builtin_skills and self.builtin_skills.exists():- for skill_dir in self.builtin_skills.iterdir():- if skill_dir.is_dir():- skill_file = skill_dir / "SKILL.md"- if skill_file.exists() and not any(s["name"] == skill_dir.name for s in skills):- skills.append(- {"name": skill_dir.name, "path": str(skill_file), "source": "builtin"}- )-# Filter by requirementsif filter_unavailable:return [s for s in skills if self._check_requirements(self._get_skill_meta(s["name"]))]@@ -113,7 +103,7 @@ class SkillsLoader:Returns:XML-formatted skills summary."""- all_skills = self.list_skills(filter_unavailable=False)+ all_skills = self.list_skills(filter_unavailable=True)if not all_skills:return ""diff --git a/bot/vikingbot/bus/events.py b/bot/vikingbot/bus/events.pyindex b3e9accb7..c1e8fca69 100644--- a/bot/vikingbot/bus/events.py+++ b/bot/vikingbot/bus/events.py@@ -40,6 +40,7 @@ class OutboundMessage:media: list[str] = field(default_factory=list)metadata: dict[str, Any] = field(default_factory=dict)token_usage: dict[str, int] = field(default_factory=dict)+ time_cost: float = field(default_factory=float)@propertydef channel(self) -> str:diff --git a/bot/vikingbot/channels/feishu.py b/bot/vikingbot/channels/feishu.pyindex d17ca8c04..42c6b8659 100644--- a/bot/vikingbot/channels/feishu.py+++ b/bot/vikingbot/channels/feishu.py@@ -45,6 +45,7 @@ try:GetMessageResourceRequest,ReplyMessageRequest,ReplyMessageRequestBody,+ GetChatRequest,)FEISHU_AVAILABLE = True@@ -87,6 +88,7 @@ class FeishuChannel(BaseChannel):self._loop: asyncio.AbstractEventLoop | None = Noneself._tenant_access_token: str | None = Noneself._token_expire_time: float = 0+ self._chat_mode_cache: dict[str, str] = {} # 缓存群类型:group(普通群)/thread(话题群)async def _get_tenant_access_token(self) -> str:"""Get tenant access token for Feishu API."""@@ -177,6 +179,28 @@ class FeishuChannel(BaseChannel):return temp_path+ async def _get_chat_mode(self, chat_id: str) -> str:+ """获取群类型:group(普通群)/thread(话题群)"""+ if chat_id in self._chat_mode_cache:+ return self._chat_mode_cache[chat_id]++ if not self._client:+ return "group" # 默认普通群++ try:+ request = GetChatRequest.builder().chat_id(chat_id).build()+ response = await self._client.im.v1.chat.aget(request)+ if response.success():+ chat_mode = getattr(response.data, "chat_mode", "group")+ mode = "thread" if chat_mode == "topic" else "group"+ self._chat_mode_cache[chat_id] = mode+ return mode+ logger.warning(f"Failed to get chat mode for {chat_id}: {response.msg}")+ except Exception as e:+ logger.warning(f"Error getting chat mode: {e}")++ return "group" # 失败默认普通群+async def start(self) -> None:"""Start the Feishu bot with WebSocket long connection."""if not FEISHU_AVAILABLE:@@ -454,7 +478,8 @@ class FeishuChannel(BaseChannel):try:# Determine receive_id_type based on chat_id format# open_id starts with "ou_", chat_id starts with "oc_"- if msg.session_key.chat_id.startswith("oc_"):+ reply_to = msg.metadata.get("reply_to")+ if reply_to.startswith("oc_"):receive_id_type = "chat_id"else:receive_id_type = "open_id"@@ -493,14 +518,16 @@ class FeishuChannel(BaseChannel):# Add @mention for the original sender when replyingoriginal_sender_id = None+ chat_type = "group"if reply_to_message_id and msg.metadata:original_sender_id = msg.metadata.get("sender_id")+ chat_type = msg.metadata.get("chat_type", "group")# Build content line: [@mention, text content]content_line = []- # Add @mention element for original sender when replying- if original_sender_id:+ # Add @mention element for original sender when replying (only in group chats)+ if original_sender_id and chat_type == "group":content_line.append({"tag": "at", "user_id": original_sender_id})# Add text content@@ -557,7 +584,7 @@ class FeishuChannel(BaseChannel):.receive_id_type(receive_id_type).request_body(CreateMessageRequestBody.builder()- .receive_id(msg.session_key.chat_id)+ .receive_id(reply_to).msg_type("post").content(content).build()@@ -713,14 +740,22 @@ class FeishuChannel(BaseChannel):reply_to = chat_id if chat_type == "group" else sender_idlogger.info(f"Received message from Feishu: {content}")+ # 话题群处理:如果是话题群,首次消息root_id为空时,将当前消息id设为root_id+ if chat_type == "group":+ chat_mode = await self._get_chat_mode(chat_id)+ if chat_mode == "thread" and not message.root_id:+ message.root_id = message.message_id+ if message.root_id:+ chat_id = f"{reply_to}#{message.root_id}"await self._handle_message(sender_id=sender_id,- chat_id=reply_to,+ chat_id=chat_id,content=content,media=media if media else None,metadata={"message_id": message_id,"chat_type": chat_type,+ "reply_to": reply_to,"msg_type": msg_type,"root_id": message.root_id, # Topic/thread ID for topic groups"sender_id": sender_id, # Original message sender ID for @mention in repliesdiff --git a/bot/vikingbot/channels/single_turn.py b/bot/vikingbot/channels/single_turn.pyindex d4c44f091..b6e45f924 100644--- a/bot/vikingbot/channels/single_turn.py+++ b/bot/vikingbot/channels/single_turn.py@@ -89,6 +89,7 @@ class SingleTurnChannel(BaseChannel):output = {"text": msg.content,"token_usage": msg.token_usage,+ "time_cost": msg.time_cost,}msg.content = json.dumps(output, ensure_ascii=False)self._last_response = msg.contentdiff --git a/bot/vikingbot/config/loader.py b/bot/vikingbot/config/loader.pyindex 4a17e76af..1673136f5 100644--- a/bot/vikingbot/config/loader.py+++ b/bot/vikingbot/config/loader.py@@ -112,6 +112,10 @@ def _merge_vlm_model_config(bot_data: dict, vlm_data: dict) -> None:Only sets model - provider config is read directly from OpenVikingConfig."""# Set default model from vlm.model+ if "agents" in bot_data:+ agents = bot_data["agents"]+ if "model" in agents and agents["model"]:+ returnif vlm_data.get("model"):if "agents" not in bot_data:bot_data["agents"] = {}diff --git a/bot/vikingbot/openviking_mount/ov_server.py b/bot/vikingbot/openviking_mount/ov_server.pyindex 1e40bbf61..987f3df76 100644--- a/bot/vikingbot/openviking_mount/ov_server.py+++ b/bot/vikingbot/openviking_mount/ov_server.py@@ -457,7 +457,7 @@ async def account_test():await client.initialize()# res = await client.admin_list_users("eval")- # res = await client.admin_remove_user("default", "ou_69e48b1314d1400af9d40fe3e4c24b8a")+ # res = await client.admin_remove_user("default", "")# res = await client.admin_remove_user("default", "admin")# res = await client.admin_list_accounts()res = await client.admin_create_account("eval", "default")@@ -465,5 +465,5 @@ async def account_test():if __name__ == "__main__":- asyncio.run(main_test())- # asyncio.run(account_test())+ # asyncio.run(main_test())+ asyncio.run(account_test())diff --git a/bot/vikingbot/sandbox/manager.py b/bot/vikingbot/sandbox/manager.pyindex 91bc651e0..82e2947b6 100644--- a/bot/vikingbot/sandbox/manager.py+++ b/bot/vikingbot/sandbox/manager.py@@ -4,6 +4,7 @@ import asynciofrom pathlib import Pathfrom typing import TYPE_CHECKING+from openviking.async_client import loggerfrom vikingbot.sandbox.base import SandboxBackend, SandboxDisabledError, UnsupportedBackendErrorfrom vikingbot.sandbox.backends import get_backend@@ -47,7 +48,8 @@ class SandboxManager:import tracebacktraceback.print_exc()- await self._copy_bootstrap_files(workspace)+ if not workspace.exists():+ await self._copy_bootstrap_files(workspace)return instanceasync def _copy_bootstrap_files(self, sandbox_workspace: Path) -> None:diff --git a/bot/vikingbot/utils/helpers.py b/bot/vikingbot/utils/helpers.pyindex cf1d761ce..46c17333f 100644--- a/bot/vikingbot/utils/helpers.py+++ b/bot/vikingbot/utils/helpers.py@@ -2,6 +2,7 @@from pathlib import Pathfrom datetime import datetime+from loguru import loggerdef ensure_dir(path: Path) -> Path: