Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat: improve OpenCode lifecycle management and add CLI docs
cyhhaoea61511b01f1
diff --git a/README.md b/README.mdindex e504933fa..03f2b32ac 100644--- a/README.md+++ b/README.md@@ -140,7 +140,7 @@ When your agent needs input — file selection, confirmation, options — Slack| In Slack | What it does ||----------|--------------|-| `/start` | Open control panel |+| `@Vibe Remote /start` | Open control panel || `/stop` | Kill current session || Just type | Talk to your agent || Reply in thread | Continue conversation |@@ -244,8 +244,8 @@ vibe stop && uv tool uninstall vibe-remote && rm -rf ~/.vibe_remote## Docs+- **[CLI Reference](docs/CLI.md)** — Command-line usage and service lifecycle- **[Slack Setup Guide](docs/SLACK_SETUP.md)** — Detailed setup with screenshots-- **[中文安装指南](docs/SLACK_SETUP_ZH.md)** — Chinese guide---diff --git a/README_ZH.md b/README_ZH.mdindex 005c750e4..904254aa9 100644--- a/README_ZH.md+++ b/README_ZH.md@@ -140,7 +140,7 @@ Agent 需要输入时 — 文件选择、确认、选项 — Slack 弹出按钮| Slack 里 | 干嘛的 ||----------|--------|-| `/start` | 打开控制面板 |+| `@Vibe Remote /start` | 打开控制面板 || `/stop` | 停止当前会话 || 直接打字 | 跟 Agent 对话 || 在线程里回复 | 继续对话 |@@ -244,8 +244,8 @@ vibe stop && uv tool uninstall vibe-remote && rm -rf ~/.vibe_remote## 文档+- **[CLI 参考手册](docs/CLI_ZH.md)** — 命令行使用和服务生命周期- **[Slack 配置指南](docs/SLACK_SETUP_ZH.md)** — 详细配置和截图-- **[English Setup Guide](docs/SLACK_SETUP.md)** — English guide---diff --git a/config/v2_settings.py b/config/v2_settings.pyindex bd37bfe4b..a56446fe8 100644--- a/config/v2_settings.py+++ b/config/v2_settings.py@@ -35,6 +35,8 @@ class ChannelSettings:)custom_cwd: Optional[str] = Nonerouting: RoutingSettings = field(default_factory=RoutingSettings)+ # Per-channel require_mention override: None=use global default, True=require, False=don't require+ require_mention: Optional[bool] = None@dataclass@@ -81,6 +83,7 @@ class SettingsStore:),custom_cwd=channel_payload.get("custom_cwd"),routing=routing,+ require_mention=channel_payload.get("require_mention"),)self.settings = SettingsState(channels=channels)@@ -98,6 +101,7 @@ class SettingsStore:"opencode_model": settings.routing.opencode_model,"opencode_reasoning_effort": settings.routing.opencode_reasoning_effort,},+ "require_mention": settings.require_mention,}self.settings_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")diff --git a/core/controller.py b/core/controller.pyindex 4dcbad895..c31a9008a 100644--- a/core/controller.py+++ b/core/controller.py@@ -152,10 +152,17 @@ class Controller:custom_cwd = self.settings_manager.get_custom_cwd(settings_key)# Use custom CWD if available, otherwise use default from config- if custom_cwd and os.path.exists(custom_cwd):- return os.path.abspath(custom_cwd)- elif custom_cwd:- logger.warning(f"Custom CWD does not exist: {custom_cwd}, using default")+ if custom_cwd:+ abs_path = os.path.abspath(os.path.expanduser(custom_cwd))+ if os.path.exists(abs_path):+ return abs_path+ # Try to create it+ try:+ os.makedirs(abs_path, exist_ok=True)+ logger.info(f"Created custom CWD: {abs_path}")+ return abs_path+ except OSError as e:+ logger.warning(f"Failed to create custom CWD '{abs_path}': {e}, using default")# Fall back to default from config.jsondefault_cwd = self.config.claude.cwd@@ -370,7 +377,8 @@ class Controller:# Settings update handler (for Slack modal)async def handle_settings_update(- self, user_id: str, show_message_types: list, channel_id: Optional[str] = None+ self, user_id: str, show_message_types: list, channel_id: Optional[str] = None,+ require_mention: Optional[bool] = None,):"""Handle settings update (typically from Slack modal)"""try:@@ -389,8 +397,12 @@ class Controller:# Save settings - using the correct method nameself.settings_manager.update_user_settings(settings_key, user_settings)+ # Save require_mention setting+ self.settings_manager.set_require_mention(settings_key, require_mention)+logger.info(- f"Updated settings for {settings_key}: show types = {show_message_types}"+ f"Updated settings for {settings_key}: show types = {show_message_types}, "+ f"require_mention = {require_mention}")# Create context for sending confirmation (without 'message' field)@@ -573,6 +585,7 @@ class Controller:opencode_agent: Optional[str],opencode_model: Optional[str],opencode_reasoning_effort: Optional[str] = None,+ require_mention: Optional[bool] = None,):"""Handle routing update submission (from Slack modal)"""from modules.settings_manager import ChannelRouting@@ -592,6 +605,9 @@ class Controller:# Save routingself.settings_manager.set_channel_routing(settings_key, routing)+ # Save require_mention setting+ self.settings_manager.set_require_mention(settings_key, require_mention)+# Build confirmation messageparts = [f"Backend: **{backend}**"]if backend == "opencode":@@ -602,6 +618,14 @@ class Controller:if opencode_reasoning_effort:parts.append(f"Reasoning Effort: **{opencode_reasoning_effort}**")+ # Add require_mention status to confirmation+ if require_mention is None:+ parts.append("Require @mention: **(Default)**")+ elif require_mention:+ parts.append("Require @mention: **Yes**")+ else:+ parts.append("Require @mention: **No**")+# Create context for confirmation messagecontext = MessageContext(user_id=user_id,@@ -617,7 +641,7 @@ class Controller:logger.info(f"Routing updated for {settings_key}: backend={backend}, "- f"agent={opencode_agent}, model={opencode_model}"+ f"agent={opencode_agent}, model={opencode_model}, require_mention={require_mention}")except Exception as e:diff --git a/core/handlers/command_handlers.py b/core/handlers/command_handlers.pyindex df5942d81..82308905a 100644--- a/core/handlers/command_handlers.py+++ b/core/handlers/command_handlers.py@@ -77,13 +77,13 @@ class CommandHandlers:f"Channel/Chat ID: {formatter.format_code_inline(context.channel_id)}","",formatter.format_bold("Commands:"),- formatter.format_text("/start - Show this message"),- formatter.format_text("/clear - Reset session and start fresh"),- formatter.format_text("/cwd - Show current working directory"),- formatter.format_text("/set_cwd <path> - Set working directory"),- formatter.format_text("/settings - Personalization settings"),+ formatter.format_text("@Vibe Remote /start - Show this message"),+ formatter.format_text("@Vibe Remote /clear - Reset session and start fresh"),+ formatter.format_text("@Vibe Remote /cwd - Show current working directory"),+ formatter.format_text("@Vibe Remote /set_cwd <path> - Set working directory"),+ formatter.format_text("@Vibe Remote /settings - Personalization settings"),formatter.format_text(- f"/stop - Interrupt {agent_display_name} execution"+ f"@Vibe Remote /stop - Interrupt {agent_display_name} execution"),"",formatter.format_bold("How it works:"),@@ -303,7 +303,7 @@ Use the buttons below to manage your {agent_display_name} sessions, or simply tychannel_context = self._get_channel_context(context)await self.im_client.send_message(channel_context,- "📂 Click the 'Change Work Dir' button in the /start menu to change working directory.",+ "📂 Click the 'Change Work Dir' button in the @Vibe Remote /start menu to change working directory.",)async def handle_stop(self, context: MessageContext, args: str = ""):diff --git a/core/handlers/settings_handler.py b/core/handlers/settings_handler.pyindex 98393b6a8..7b66018de 100644--- a/core/handlers/settings_handler.py+++ b/core/handlers/settings_handler.py@@ -104,6 +104,10 @@ class SettingsHandler:message_types = self.settings_manager.get_available_message_types()display_names = self.settings_manager.get_message_type_display_names()+ # Get current require_mention override for this channel+ current_require_mention = self.settings_manager.get_require_mention_override(settings_key)+ global_require_mention = self.config.slack.require_mention+try:await self.im_client.open_settings_modal(trigger_id,@@ -111,6 +115,8 @@ class SettingsHandler:message_types,display_names,context.channel_id,+ current_require_mention=current_require_mention,+ global_require_mention=global_require_mention,)except Exception as e:logger.error(f"Error opening settings modal: {e}")@@ -236,7 +242,7 @@ class SettingsHandler:items=[("Real-time", f"Messages are immediately sent to {agent_label}"),("Persistent", "Each chat maintains its own conversation context"),- ("Commands", "Use /start for menu, /clear to reset session"),+ ("Commands", "Use @Vibe Remote /start for menu, @Vibe Remote /clear to reset session"),("Work Dir", "Change working directory with /set_cwd or via menu"),("Settings", "Customize message visibility in Settings"),],@@ -311,6 +317,10 @@ class SettingsHandler:# Get current backend (from routing or default)current_backend = self.controller.resolve_agent_for_context(context)+ # Get current require_mention override for this channel+ current_require_mention = self.settings_manager.get_require_mention_override(settings_key)+ global_require_mention = self.config.slack.require_mention+# Get OpenCode agents/models if availableopencode_agents = []opencode_models = {}@@ -342,6 +352,8 @@ class SettingsHandler:opencode_agents=opencode_agents,opencode_models=opencode_models,opencode_default_config=opencode_default_config,+ current_require_mention=current_require_mention,+ global_require_mention=global_require_mention,)except Exception as e:logger.error(f"Error opening routing modal: {e}", exc_info=True)diff --git a/docs/CLI.md b/docs/CLI.mdnew file mode 100644index 000000000..60d5e0acf--- /dev/null+++ b/docs/CLI.md@@ -0,0 +1,201 @@+# Vibe Remote CLI Reference++## Quick Start++```bash+vibe # Start Vibe Remote (opens web UI)+vibe status # Check service status+vibe stop # Stop all services+```++## Commands++### `vibe`++Start or restart Vibe Remote. Opens the web UI in your browser.++```bash+vibe+```++**Behavior:**+- Restarts the main service if already running+- Opens the setup wizard at `http://127.0.0.1:5123`+- **Preserves OpenCode server** — Running tasks are not interrupted++### `vibe stop`++Fully stop all Vibe Remote services.++```bash+vibe stop+```++**Behavior:**+- Stops the main service+- Stops the web UI server+- **Terminates OpenCode server** — Use this when you need to restart OpenCode++### `vibe status`++Display current service status.++```bash+vibe status+```++**Output:**+```json+{+ "state": "running",+ "running": true,+ "pid": 12345+}+```++### `vibe doctor`++Run diagnostic checks on your configuration.++```bash+vibe doctor+```++**Checks:**+- Configuration file validity+- Slack token configuration+- Agent CLI availability (Claude Code, OpenCode, Codex)+- Runtime environment++### `vibe version`++Show the installed version.++```bash+vibe version+```++### `vibe check-update`++Check if a newer version is available.++```bash+vibe check-update+```++### `vibe upgrade`++Upgrade to the latest version.++```bash+vibe upgrade+```++## Service Lifecycle++### Understanding "Restart" vs "Stop"++Vibe Remote manages two types of processes:++| Process | Description |+|---------|-------------|+| **Main Service** | Handles Slack communication, routes messages to agents |+| **OpenCode Server** | Backend server for OpenCode agent (if enabled) |++The key difference between commands:++| Command | Main Service | OpenCode Server |+|---------|--------------|-----------------|+| `vibe` | Restart | **Preserved** |+| `vibe stop` | Stop | **Terminated** |++### Why This Matters++When you run `vibe` to restart:+- Any **running OpenCode tasks continue uninterrupted**+- The new Vibe Remote instance "adopts" the existing OpenCode server+- Session state is preserved++When you run `vibe stop`:+- **Everything stops cleanly**+- OpenCode server is terminated+- Use this before updating OpenCode or its configuration++## Common Scenarios++### Daily Restart++Just want to restart Vibe Remote without interrupting work:++```bash+vibe+```++### Update OpenCode Configuration++After editing `~/.config/opencode/opencode.json`:++```bash+vibe stop && vibe+```++### Update OpenCode Binary++After installing a new version of OpenCode:++```bash+vibe stop && vibe+```++### Update Vibe Remote++```bash+vibe upgrade+# Then restart:+vibe stop && vibe+```++### Troubleshooting++If something seems stuck:++```bash+# Check status+vibe status++# Run diagnostics+vibe doctor++# Full restart (stops everything including OpenCode)+vibe stop && vibe+```++## Web UI Controls++The web UI (`http://127.0.0.1:5123`) provides the same controls:++| Button | Equivalent CLI | OpenCode Behavior |+|--------|---------------|-------------------|+| **Start** | `vibe` | Preserved |+| **Restart** | `vibe` | Preserved |+| **Stop** | `vibe stop` | Terminated |++## File Locations++| Path | Description |+|------|-------------|+| `~/.vibe_remote/config/config.json` | Main configuration |+| `~/.vibe_remote/state/settings.json` | Channel routing settings |+| `~/.vibe_remote/logs/vibe_remote.log` | Application logs |+| `~/.vibe_remote/logs/opencode_server.json` | OpenCode server PID file |++## Environment Variables++| Variable | Description |+|----------|-------------|+| `OPENCODE_PORT` | Override OpenCode server port (default: 4096) |++## See Also++- [Slack Setup Guide](SLACK_SETUP.md)+- [Codex Setup Guide](CODEX_SETUP.md)diff --git a/docs/CLI_ZH.md b/docs/CLI_ZH.mdnew file mode 100644index 000000000..f726a67ff--- /dev/null+++ b/docs/CLI_ZH.md@@ -0,0 +1,201 @@+# Vibe Remote CLI 参考手册++## 快速开始++```bash+vibe # 启动 Vibe Remote(打开 Web UI)+vibe status # 查看服务状态+vibe stop # 停止所有服务+```++## 命令详解++### `vibe`++启动或重启 Vibe Remote。会在浏览器中打开 Web UI。++```bash+vibe+```++**行为:**+- 如果已在运行,则重启主服务+- 打开设置向导 `http://127.0.0.1:5123`+- **保留 OpenCode 服务器** — 正在执行的任务不会被中断++### `vibe stop`++完全停止所有 Vibe Remote 服务。++```bash+vibe stop+```++**行为:**+- 停止主服务+- 停止 Web UI 服务器+- **终止 OpenCode 服务器** — 当你需要重启 OpenCode 时使用此命令++### `vibe status`++显示当前服务状态。++```bash+vibe status+```++**输出示例:**+```json+{+ "state": "running",+ "running": true,+ "pid": 12345+}+```++### `vibe doctor`++运行配置诊断检查。++```bash+vibe doctor+```++**检查内容:**+- 配置文件有效性+- Slack token 配置+- Agent CLI 可用性(Claude Code、OpenCode、Codex)+- 运行时环境++### `vibe version`++显示已安装的版本。++```bash+vibe version+```++### `vibe check-update`++检查是否有新版本可用。++```bash+vibe check-update+```++### `vibe upgrade`++升级到最新版本。++```bash+vibe upgrade+```++## 服务生命周期++### 理解「重启」与「停止」的区别++Vibe Remote 管理两类进程:++| 进程 | 说明 |+|------|------|+| **主服务** | 处理 Slack 通信,将消息路由到 Agent |+| **OpenCode 服务器** | OpenCode Agent 的后端服务(如已启用) |++命令的关键区别:++| 命令 | 主服务 | OpenCode 服务器 |+|------|--------|-----------------|+| `vibe` | 重启 | **保留** |+| `vibe stop` | 停止 | **终止** |++### 为什么这很重要++当你运行 `vibe` 重启时:+- **正在运行的 OpenCode 任务会继续执行**,不会中断+- 新的 Vibe Remote 实例会「认领」现有的 OpenCode 服务器+- 会话状态得以保留++当你运行 `vibe stop` 时:+- **一切都会干净地停止**+- OpenCode 服务器被终止+- 更新 OpenCode 或其配置前使用此命令++## 常见场景++### 日常重启++只想重启 Vibe Remote,不中断正在进行的工作:++```bash+vibe+```++### 更新 OpenCode 配置++修改 `~/.config/opencode/opencode.json` 后:++```bash+vibe stop && vibe+```++### 更新 OpenCode 程序++安装新版本 OpenCode 后:++```bash+vibe stop && vibe+```++### 更新 Vibe Remote++```bash+vibe upgrade+# 然后重启:+vibe stop && vibe+```++### 故障排查++如果遇到卡住的情况:++```bash+# 检查状态+vibe status++# 运行诊断+vibe doctor++# 完全重启(停止所有服务包括 OpenCode)+vibe stop && vibe+```++## Web UI 控制++Web UI (`http://127.0.0.1:5123`) 提供相同的控制功能:++| 按钮 | 等效 CLI | OpenCode 行为 |+|------|---------|---------------|+| **Start** | `vibe` | 保留 |+| **Restart** | `vibe` | 保留 |+| **Stop** | `vibe stop` | 终止 |++## 文件位置++| 路径 | 说明 |+|------|------|+| `~/.vibe_remote/config/config.json` | 主配置文件 |+| `~/.vibe_remote/state/settings.json` | 频道路由设置 |+| `~/.vibe_remote/logs/vibe_remote.log` | 应用日志 |+| `~/.vibe_remote/logs/opencode_server.json` | OpenCode 服务器 PID 文件 |++## 环境变量++| 变量 | 说明 |+|------|------|+| `OPENCODE_PORT` | 覆盖 OpenCode 服务器端口(默认:4096) |++## 另请参阅++- [Slack 配置指南](SLACK_SETUP_ZH.md)+- [Codex 配置指南](CODEX_SETUP.md)diff --git a/docs/SLACK_SETUP.md b/docs/SLACK_SETUP.mdindex 5d26e9992..287e1f0ee 100644--- a/docs/SLACK_SETUP.md+++ b/docs/SLACK_SETUP.md@@ -133,7 +133,7 @@ From here you can:## Using in Slack1. Invite bot to channel: `/invite @Vibe Remote`-2. Type `/start` or `@Vibe Remote` to open control panel+2. Type `@Vibe Remote /start` to open control panel3. Start coding!**Tips:**diff --git a/docs/SLACK_SETUP_ZH.md b/docs/SLACK_SETUP_ZH.mdindex b911f58d4..1ae981544 100644--- a/docs/SLACK_SETUP_ZH.md+++ b/docs/SLACK_SETUP_ZH.md@@ -133,7 +133,7 @@ vibe## 在 Slack 中使用1. 邀请 bot 到频道:`/invite @Vibe Remote`-2. 输入 `/start` 或 `@Vibe Remote` 打开控制面板+2. 输入 `@Vibe Remote /start` 打开控制面板3. 开始写代码!**技巧:**diff --git a/modules/agents/opencode_agent.py b/modules/agents/opencode_agent.pyindex e09beccfc..79b940bc8 100644--- a/modules/agents/opencode_agent.py+++ b/modules/agents/opencode_agent.py@@ -330,9 +330,17 @@ class OpenCodeServerManager:if self._process and self._process.returncode is None and self._process.pid == pid:return+ # Check if the server is healthy before deciding to kill it.+ # If it's healthy, we should adopt it rather than kill it.+ if await self._is_healthy():+ logger.info(+ f"Adopting healthy OpenCode server pid={pid} from previous run"+ )+ return+cmd = self._get_pid_command(pid)if cmd and self._is_opencode_serve_cmd(cmd, self.port) and self._pid_exists(pid):- await self._terminate_pid(pid, reason="orphaned from previous run")+ await self._terminate_pid(pid, reason="orphaned and unhealthy")self._clear_pid_file()async def ensure_running(self) -> str:@@ -441,23 +449,12 @@ class OpenCodeServerManager:self._http_session = Noneself._http_session_loop = None- if self._process and self._process.returncode is None:- self._process.terminate()- try:- await asyncio.wait_for(self._process.wait(), timeout=5)- except asyncio.TimeoutError:- self._process.kill()- logger.info("OpenCode server stopped")- else:- info = self._read_pid_file()- pid = info.get("pid") if isinstance(info, dict) else None- port = info.get("port") if isinstance(info, dict) else None- if isinstance(pid, int) and port == self.port and self._pid_exists(pid):- cmd = self._get_pid_command(pid)- if cmd and self._is_opencode_serve_cmd(cmd, self.port):- await self._terminate_pid(pid, reason="shutdown")+ # Don't terminate OpenCode server on vibe-remote shutdown.+ # Let it continue running so the next vibe-remote instance can adopt it.+ # This prevents interrupting tasks that are still in progress.+ logger.info("OpenCode server left running for next vibe-remote instance to adopt")- self._clear_pid_file()+ # Keep pid_file so next instance knows about the running server.self._process = Nonedef stop_sync(self) -> None:@@ -473,23 +470,13 @@ class OpenCodeServerManager:self._http_session = Noneself._http_session_loop = None- if self._process and self._process.returncode is None:- self._process.terminate()- logger.info("OpenCode server terminated (sync)")- else:- info = self._read_pid_file()- pid = info.get("pid") if isinstance(info, dict) else None- port = info.get("port") if isinstance(info, dict) else None- if isinstance(pid, int) and port == self.port and self._pid_exists(pid):- cmd = self._get_pid_command(pid)- if cmd and self._is_opencode_serve_cmd(cmd, self.port):- try:- os.kill(pid, signal.SIGTERM)- logger.info("OpenCode server terminated (sync via pid file)")- except Exception as e:- logger.debug(f"Failed to terminate OpenCode server pid={pid}: {e}")+ # Don't terminate OpenCode server on vibe-remote shutdown.+ # Let it continue running so the next vibe-remote instance can adopt it.+ # This prevents interrupting tasks that are still in progress.+ logger.info("OpenCode server left running for next vibe-remote instance to adopt")- self._clear_pid_file()+ # Keep pid_file so next instance knows about the running server.+ # Don't clear _process reference - just let it be garbage collected.self._process = None@classmethod@@ -498,36 +485,9 @@ class OpenCodeServerManager:cls._instance.stop_sync()return- pid_file = Path(__file__).resolve().parents[2] / "logs" / "opencode_server.json"- try:- raw = pid_file.read_text()- except FileNotFoundError:- return- except Exception as e:- logger.debug(f"Failed to read OpenCode pid file: {e}")- return-- try:- info = json.loads(raw)- except Exception:- info = None-- pid = info.get("pid") if isinstance(info, dict) else None- port = info.get("port") if isinstance(info, dict) else None-- if isinstance(pid, int) and isinstance(port, int) and cls._pid_exists(pid):- cmd = cls._get_pid_command(pid)- if cmd and cls._is_opencode_serve_cmd(cmd, port):- try:- os.kill(pid, signal.SIGTERM)- logger.info("OpenCode server terminated (sync via pid file)")- except Exception as e:- logger.debug(f"Failed to terminate OpenCode server pid={pid}: {e}")-- try:- pid_file.unlink()- except Exception:- pass+ # Don't terminate OpenCode server on vibe-remote shutdown.+ # Let it continue running so the next vibe-remote instance can adopt it.+ logger.info("OpenCode server left running for next vibe-remote instance to adopt")async def create_session(self, directory: str, title: Optional[str] = Nonediff --git a/modules/im/slack.py b/modules/im/slack.pyindex 8d00dad77..a8cd18739 100644--- a/modules/im/slack.py+++ b/modules/im/slack.py@@ -536,7 +536,14 @@ class SlackBot(BaseIMClient):# For threads: only respond if the bot is active in that threadis_thread_reply = event.get("thread_ts") is not None- if self.config.require_mention and not channel_id.startswith("D"):+ # Resolve effective require_mention: per-channel override or global default+ effective_require_mention = self.config.require_mention+ if self.settings_manager:+ effective_require_mention = self.settings_manager.get_require_mention(+ channel_id, global_default=self.config.require_mention+ )++ if effective_require_mention and not channel_id.startswith("D"):# In channel main thread: require mention (silently ignore)if not is_thread_reply:logger.debug(f"Ignoring non-mention message in channel: '{text}'")@@ -714,7 +721,7 @@ class SlackBot(BaseIMClient):if response_url:await self.send_slash_response(response_url,- f"❌ Unknown command: `/{command}`\n\nPlease use `/start` to access all bot features.",+ f"❌ Unknown command: `/{command}`\n\nPlease use `@Vibe Remote /start` to access all bot features.",)async def _handle_interactive(self, payload: Dict[str, Any]):@@ -807,12 +814,27 @@ class SlackBot(BaseIMClient):# Get the values from selected optionsshow_types = [opt.get("value") for opt in selected_options]+ # Extract require_mention setting+ require_mention_data = values.get("require_mention_block", {}).get(+ "require_mention_select", {}+ )+ require_mention_value = require_mention_data.get("selected_option", {}).get("value")+ # Convert to Optional[bool]: "__default__" -> None, "true" -> True, "false" -> False+ if require_mention_value == "__default__":+ require_mention = None+ elif require_mention_value == "true":+ require_mention = True+ elif require_mention_value == "false":+ require_mention = False+ else:+ require_mention = None+# Get channel_id from the view's private_metadata if availablechannel_id = view.get("private_metadata")# Update settings - need access to settings managerif hasattr(self, "_on_settings_update"):- await self._on_settings_update(user_id, show_types, channel_id)+ await self._on_settings_update(user_id, show_types, channel_id, require_mention)elif callback_id == "change_cwd_modal":# Handle change CWD modal submission@@ -918,10 +940,25 @@ class SlackBot(BaseIMClient):if oc_reasoning == "__default__":oc_reasoning = None+ # Extract require_mention (optional)+ require_mention_data = values.get("require_mention_block", {}).get(+ "require_mention_select", {}+ )+ require_mention_value = require_mention_data.get("selected_option", {}).get("value")+ # Convert to Optional[bool]: "__default__" -> None, "true" -> True, "false" -> False+ if require_mention_value == "__default__":+ require_mention = None+ elif require_mention_value == "true":+ require_mention = True+ elif require_mention_value == "false":+ require_mention = False+ else:+ require_mention = None+# Update routing via callbackif hasattr(self, "_on_routing_update"):await self._on_routing_update(- user_id, channel_id, backend, oc_agent, oc_model, oc_reasoning+ user_id, channel_id, backend, oc_agent, oc_model, oc_reasoning, require_mention)def run(self):@@ -1068,6 +1105,8 @@ class SlackBot(BaseIMClient):message_types: list,display_names: dict,channel_id: str = None,+ current_require_mention: object = None, # None=default, True, False+ global_require_mention: bool = False,):"""Open a modal dialog for settings"""self._ensure_clients()@@ -1120,6 +1159,40 @@ class SlackBot(BaseIMClient):if selected_options:multi_select_element["initial_options"] = selected_options+ # Build require_mention selector+ global_mention_label = "On" if global_require_mention else "Off"+ require_mention_options = [+ {+ "text": {"type": "plain_text", "text": f"(Default) - {global_mention_label}"},+ "value": "__default__",+ },+ {+ "text": {"type": "plain_text", "text": "Require @mention"},+ "value": "true",+ },+ {+ "text": {"type": "plain_text", "text": "Don't require @mention"},+ "value": "false",+ },+ ]++ # Determine initial option for require_mention+ initial_require_mention = require_mention_options[0] # Default+ if current_require_mention is not None:+ target_value = "true" if current_require_mention else "false"+ for opt in require_mention_options:+ if opt["value"] == target_value:+ initial_require_mention = opt+ break++ require_mention_select = {+ "type": "static_select",+ "action_id": "require_mention_select",+ "placeholder": {"type": "plain_text", "text": "Select @mention behavior"},+ "options": require_mention_options,+ "initial_option": initial_require_mention,+ }+# Create the modal viewview = {"type": "modal",@@ -1133,7 +1206,35 @@ class SlackBot(BaseIMClient):"type": "header","text": {"type": "plain_text",- "text": "Message Visibility Settings",+ "text": "Channel Behavior",+ "emoji": True,+ },+ },+ {+ "type": "input",+ "block_id": "require_mention_block",+ "element": require_mention_select,+ "label": {+ "type": "plain_text",+ "text": "Require @mention to respond",+ "emoji": True,+ },+ },+ {+ "type": "context",+ "elements": [+ {+ "type": "mrkdwn",+ "text": "_When enabled, the bot only responds when @mentioned in channels (DMs always work)._",+ }+ ],+ },+ {"type": "divider"},+ {+ "type": "header",+ "text": {+ "type": "plain_text",+ "text": "Message Visibility","emoji": True,},},@@ -1144,7 +1245,6 @@ class SlackBot(BaseIMClient):"text": "Choose which message types to *show* from agent output. Unselected types won't appear in your Slack workspace.",},},- {"type": "divider"},{"type": "input","block_id": "show_message_types",@@ -1298,6 +1398,8 @@ class SlackBot(BaseIMClient):selected_opencode_agent: object = _UNSET,selected_opencode_model: object = _UNSET,selected_opencode_reasoning: object = _UNSET,+ current_require_mention: object = _UNSET, # None=default, True, False+ global_require_mention: bool = False,) -> dict:"""Build modal view for agent/model routing settings."""# Build backend options@@ -1352,6 +1454,48 @@ class SlackBot(BaseIMClient):},]+ # Add require_mention selector+ # Build options: Default (uses global), Require @mention, Don't require @mention+ global_mention_label = "On" if global_require_mention else "Off"+ require_mention_options = [+ {+ "text": {"type": "plain_text", "text": f"(Default) - {global_mention_label}"},+ "value": "__default__",+ },+ {+ "text": {"type": "plain_text", "text": "Require @mention"},+ "value": "true",+ },+ {+ "text": {"type": "plain_text", "text": "Don't require @mention"},+ "value": "false",+ },+ ]++ # Determine initial option+ initial_require_mention = require_mention_options[0] # Default+ if current_require_mention is not _UNSET and current_require_mention is not None:+ target_value = "true" if current_require_mention else "false"+ for opt in require_mention_options:+ if opt["value"] == target_value:+ initial_require_mention = opt+ break++ require_mention_select = {+ "type": "static_select",+ "action_id": "require_mention_select",+ "placeholder": {"type": "plain_text", "text": "Select @mention behavior"},+ "options": require_mention_options,+ "initial_option": initial_require_mention,+ }++ blocks.append({+ "type": "input",+ "block_id": "require_mention_block",+ "element": require_mention_select,+ "label": {"type": "plain_text", "text": "Require @mention to respond"},+ })+# OpenCode-specific options (only if opencode is registered)if "opencode" in registered_backends:# Get current opencode settings@@ -1788,6 +1932,8 @@ class SlackBot(BaseIMClient):opencode_agents: list,opencode_models: dict,opencode_default_config: dict,+ current_require_mention: object = None, # None=default, True, False+ global_require_mention: bool = False,):"""Open a modal dialog for agent/model routing settings"""self._ensure_clients()@@ -1800,6 +1946,8 @@ class SlackBot(BaseIMClient):opencode_agents=opencode_agents,opencode_models=opencode_models,opencode_default_config=opencode_default_config,+ current_require_mention=current_require_mention,+ global_require_mention=global_require_mention,)try:@@ -1823,6 +1971,8 @@ class SlackBot(BaseIMClient):selected_opencode_agent: Optional[str] = None,selected_opencode_model: Optional[str] = None,selected_opencode_reasoning: Optional[str] = None,+ current_require_mention: object = None,+ global_require_mention: bool = False,) -> None:"""Update routing modal when selections change."""self._ensure_clients()@@ -1839,6 +1989,8 @@ class SlackBot(BaseIMClient):selected_opencode_agent=selected_opencode_agent,selected_opencode_model=selected_opencode_model,selected_opencode_reasoning=selected_opencode_reasoning,+ current_require_mention=current_require_mention,+ global_require_mention=global_require_mention,)try:diff --git a/modules/settings_manager.py b/modules/settings_manager.pyindex 06656e2c8..c124a4277 100644--- a/modules/settings_manager.py+++ b/modules/settings_manager.py@@ -534,3 +534,54 @@ class SettingsManager:settings.channel_routing = Noneself.update_user_settings(settings_key, settings)logger.info(f"Cleared channel routing for {settings_key}")++ # ---------------------------------------------+ # Per-channel require_mention management+ # ---------------------------------------------+ def get_require_mention(+ self, channel_id: Union[int, str], global_default: bool = False+ ) -> bool:+ """Get effective require_mention value for a channel.++ Args:+ channel_id: The channel to check+ global_default: The global require_mention setting from config++ Returns:+ True if mention is required, False otherwise.+ Uses per-channel setting if set, otherwise falls back to global_default.+ """+ self._reload_if_changed()+ key = str(channel_id)+ channel_settings = self.store.settings.channels.get(key)++ if channel_settings is not None and channel_settings.require_mention is not None:+ return channel_settings.require_mention++ return global_default++ def set_require_mention(+ self, channel_id: Union[int, str], value: Optional[bool]+ ):+ """Set per-channel require_mention override.++ Args:+ channel_id: The channel to configure+ value: True=require mention, False=don't require, None=use global default+ """+ key = str(channel_id)+ channel_settings = self.store.get_channel(key)+ channel_settings.require_mention = value+ self.store.update_channel(key, channel_settings)+ logger.info(f"Updated require_mention for channel {key}: {value}")++ def get_require_mention_override(+ self, channel_id: Union[int, str]+ ) -> Optional[bool]:+ """Get the raw per-channel require_mention override (may be None)."""+ self._reload_if_changed()+ key = str(channel_id)+ channel_settings = self.store.settings.channels.get(key)+ if channel_settings is not None:+ return channel_settings.require_mention+ return Nonediff --git a/ui/src/components/steps/ChannelList.tsx b/ui/src/components/steps/ChannelList.tsxindex 430e7c801..607418d7f 100644--- a/ui/src/components/steps/ChannelList.tsx+++ b/ui/src/components/steps/ChannelList.tsx@@ -1,10 +1,28 @@import React, { useEffect, useState } from 'react';-import { Hash, CheckSquare, Square, RefreshCw } from 'lucide-react';+import { Hash, CheckSquare, Square, RefreshCw, HelpCircle } from 'lucide-react';import { useTranslation } from 'react-i18next';import { useApi } from '../../context/ApiContext';import { useToast } from '../../context/ToastContext';import clsx from 'clsx';+/** Input that only commits value on blur */+function BlurInput({+ value,+ onCommit,+ ...props+}: { value: string; onCommit: (v: string) => void } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'onBlur'>) {+ const [local, setLocal] = useState(value);+ useEffect(() => setLocal(value), [value]);+ return (+ <input+ {...props}+ value={local}+ onChange={(e) => setLocal(e.target.value)}+ onBlur={() => { if (local !== value) onCommit(local); }}+ />+ );+}+interface ChannelListProps {data?: any;onNext?: (data: any) => void;@@ -22,6 +40,7 @@ interface ChannelConfig {opencode_model?: string | null;opencode_reasoning_effort?: string | null;};+ require_mention?: boolean | null; // null=use global default, true=require, false=don't require}export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onBack, isPage }) => {@@ -153,6 +172,7 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onBopencode_model: null,opencode_reasoning_effort: null,},+ require_mention: null,});const reasoningOptionsByModel = React.useMemo(() => {@@ -185,6 +205,15 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB><RefreshCw size={14} className={loading ? 'animate-spin' : ''} /> {t('channelList.refreshList')}</button>+ <span className="relative group">+ <span className="flex items-center gap-1 text-sm text-muted cursor-help">+ <HelpCircle size={14} />+ {t('channelList.cantFindChannel')}+ </span>+ <span className="absolute bottom-full left-0 mb-2 px-3 py-2 bg-text text-bg text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 w-64 whitespace-normal">+ {t('channelList.inviteBotHint')}+ </span>+ </span>{channels.length === 0 && !loading && (<span className="text-sm text-warning">{t('channelList.noChannelsFound')}</span>)}@@ -217,6 +246,8 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB...def.routing,...(rawConfig.routing || {}),},+ // Preserve require_mention from rawConfig (can be null, true, or false)+ require_mention: rawConfig.require_mention !== undefined ? rawConfig.require_mention : def.require_mention,};return (<div key={channel.id} className="p-4 hover:bg-neutral-50/50 transition-colors">@@ -250,14 +281,14 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB{channelConfig.enabled && (<div className="mt-4 pl-8 space-y-4">{/* Basic Settings */}- <div className="grid grid-cols-1 md:grid-cols-2 gap-3">+ <div className="grid grid-cols-1 md:grid-cols-3 gap-3"><div className="space-y-1"><label className="text-xs font-medium text-muted uppercase">{t('channelList.workingDirectory')}</label>- <input+ <BlurInputtype="text"placeholder={config.runtime?.default_cwd || t('channelList.useGlobalDefault')}value={channelConfig.custom_cwd}- onChange={(e) => updateConfig(channel.id, { custom_cwd: e.target.value })}+ onCommit={(v) => updateConfig(channel.id, { custom_cwd: v })}className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text placeholder:text-muted/50 font-mono"/></div>@@ -278,11 +309,36 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB<option value="codex">Codex</option></select></div>+ <div className="space-y-1">+ <label className="text-xs font-medium text-muted uppercase">{t('channelList.requireMention')}</label>+ <select+ value={channelConfig.require_mention === null || channelConfig.require_mention === undefined ? '' : channelConfig.require_mention ? 'true' : 'false'}+ onChange={(e) => {+ const val = e.target.value;+ updateConfig(channel.id, {+ require_mention: val === '' ? null : val === 'true',+ });+ }}+ className="w-full bg-bg border border-border rounded px-3 py-2 text-sm focus:outline-none focus:border-accent text-text"+ >+ <option value="">{t('common.default')} ({config.slack?.require_mention ? t('common.enabled') : t('common.disabled')})</option>+ <option value="true">{t('channelList.requireMentionOn')}</option>+ <option value="false">{t('channelList.requireMentionOff')}</option>+ </select>+ </div></div>{/* Show Message Types */}<div className="space-y-2">- <div className="text-xs font-medium text-muted uppercase">{t('channelList.showMessageTypes')}</div>+ <div className="text-xs font-medium text-muted uppercase flex items-center gap-1">+ {t('channelList.showMessageTypes')}+ <span className="relative group">+ <HelpCircle size={12} className="text-muted/50 cursor-help" />+ <span className="absolute bottom-full left-0 mb-2 px-3 py-2 bg-text text-bg text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 w-64 whitespace-normal font-normal normal-case">+ {t('channelList.showMessageTypesHint')}+ </span>+ </span>+ </div><div className="flex flex-wrap gap-3 text-sm">{['system', 'assistant', 'toolcall'].map((msgType) => {const checked = channelConfig.show_message_types.includes(msgType);diff --git a/ui/src/components/steps/SlackConfig.tsx b/ui/src/components/steps/SlackConfig.tsxindex 66f48c366..25f7b9daf 100644--- a/ui/src/components/steps/SlackConfig.tsx+++ b/ui/src/components/steps/SlackConfig.tsx@@ -162,26 +162,29 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }<ExternalLink size={16} />{t('slackConfig.createSlackApp')}</button>- <button- onClick={copyManifest}- disabled={!manifest || manifestLoading}- className="flex items-center gap-2 px-4 py-2 bg-neutral-100 hover:bg-neutral-200 text-text rounded-lg transition-colors font-medium border border-border"- >- {copied ? <Check size={16} /> : <Copy size={16} />}- {copied ? t('slackConfig.copied') : t('slackConfig.copyManifest')}- </button></div>{manifest && (- <details className="group">- <summary className="cursor-pointer text-sm text-accent hover:text-accent/80 flex items-center gap-1">- <ChevronDown size={14} className="transition-transform group-open:rotate-180" />- {t('slackConfig.viewManifest')}- </summary>- <pre className="mt-2 bg-neutral-900 text-neutral-100 p-3 rounded-lg text-xs overflow-x-auto max-h-40 overflow-y-auto font-mono">- {manifest}- </pre>- </details>+ <div className="flex items-center gap-3 text-sm">+ <details className="group">+ <summary className="cursor-pointer text-accent hover:text-accent/80 flex items-center gap-1">+ <ChevronDown size={14} className="transition-transform group-open:rotate-180" />+ {t('slackConfig.viewManifest')}+ </summary>+ <pre className="mt-2 bg-neutral-900 text-neutral-100 p-3 rounded-lg text-xs overflow-x-auto max-h-40 overflow-y-auto font-mono">+ {manifest}+ </pre>+ </details>+ <span className="text-muted">|</span>+ <button+ onClick={copyManifest}+ disabled={manifestLoading}+ className="flex items-center gap-1 text-accent hover:text-accent/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"+ >+ {copied ? <Check size={14} /> : <Copy size={14} />}+ {copied ? t('slackConfig.copied') : t('slackConfig.copyManifest')}+ </button>+ </div>)}{manifestLoading && (@@ -225,7 +228,7 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }type="password"value={botToken}onChange={(e) => setBotToken(e.target.value)}- placeholder="xoxb-..."+ placeholder={t('slackConfig.botTokenPlaceholder')}className="w-full bg-bg border border-border rounded-lg p-3 text-text focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent font-mono transition-colors"/><p className="text-xs text-muted">{t('slackConfig.botTokenHint')} <code className="bg-neutral-100 px-1.5 py-0.5 rounded text-text">xoxb-</code></p>@@ -262,7 +265,7 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }type="password"value={appToken}onChange={(e) => setAppToken(e.target.value)}- placeholder="xapp-..."+ placeholder={t('slackConfig.appTokenPlaceholder')}className="w-full bg-bg border border-border rounded-lg p-3 text-text focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent font-mono transition-colors"/><p className="text-xs text-muted">{t('slackConfig.appTokenHint')} <code className="bg-neutral-100 px-1.5 py-0.5 rounded text-text">xapp-</code></p>diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex 1006f1ed9..9fd223919 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -70,8 +70,10 @@"openSlackOAuth": "Open Slack OAuth","afterAuth": "After authorization, return here to continue.","botToken": "Bot User OAuth Token",+ "botTokenPlaceholder": "xoxb-... (paste here)","botTokenHint": "Starts with","appToken": "App-Level Token",+ "appTokenPlaceholder": "xapp-... (paste here)","appTokenHint": "Starts with","validateTokens": "Validate Tokens","tokenValidated": "Tokens validated",@@ -120,6 +122,8 @@"title": "Channel Settings","subtitle": "Enable channels and configure per-channel routing.","refreshList": "Refresh List",+ "cantFindChannel": "Can't find your channel?",+ "inviteBotHint": "Invite the bot to your channel first:\n1. Open the channel, click ⚙️ Settings → Integrations → Add apps\n2. Or type /invite @YourBotName in the channel","enabledCount": "{{count}} enabled","accessPolicy": "Access Policy","accessPolicyHint": "Channels are enabled only when checked below.",@@ -130,12 +134,16 @@"useGlobalDefault": "Use global default","backend": "Backend","showMessageTypes": "Show Message Types",+ "showMessageTypesHint": "Control which message types are displayed in Slack:\n\n• System: Agent startup/status messages\n• Assistant: Agent responses and explanations\n• Toolcall: Tool execution details (one-line summary)\n\nNote: The agent's final result is always shown regardless of these settings.","opencodeSettings": "OpenCode Settings","agent": "Agent","model": "Model","reasoningEffort": "Reasoning Effort","settingsSaved": "Settings saved",- "settingsSaveFailed": "Failed to save settings"+ "settingsSaveFailed": "Failed to save settings",+ "requireMention": "Require @Mention",+ "requireMentionOn": "Require @mention",+ "requireMentionOff": "Don't require @mention"},"summary": {"title": "Review & Finish",@@ -148,8 +156,8 @@"requireMention": "Require @Mention","requireMentionHint": "Bot only responds when @mentioned in channels","usageTips": "Quick Start Guide",- "tipStartCommand": "Use /start or @bot to begin",- "tipStartCommandDesc": "Type /start in any enabled channel, or @mention the bot to open the control panel.",+ "tipStartCommand": "Use @Vibe Remote /start to begin",+ "tipStartCommandDesc": "Type @Vibe Remote /start in any enabled channel to open the control panel.","tipAgentSwitch": "Switch agents instantly","tipAgentSwitchDesc": "Prefix your message with AgentName: to route to a specific agent. E.g., \"Plan: Design the API\"","tipThread": "Thread = Session",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 136ce382b..6ef1ab441 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -70,8 +70,10 @@"openSlackOAuth": "打开 Slack OAuth","afterAuth": "授权后返回此处继续","botToken": "Bot 用户 OAuth 令牌",+ "botTokenPlaceholder": "xoxb-...(粘贴至此处)","botTokenHint": "以此开头","appToken": "应用级别令牌",+ "appTokenPlaceholder": "xapp-...(粘贴至此处)","appTokenHint": "以此开头","validateTokens": "验证令牌","tokenValidated": "令牌验证成功",@@ -120,6 +122,8 @@"title": "频道设置","subtitle": "启用频道并配置每个频道的路由","refreshList": "刷新列表",+ "cantFindChannel": "找不到你想要的频道?",+ "inviteBotHint": "请先将 Bot 邀请到频道:\n1. 打开频道,点击 ⚙️ 设置 → 集成 → 添加应用\n2. 或在频道中输入 /invite @你的Bot名称","enabledCount": "已启用 {{count}} 个","accessPolicy": "访问策略","accessPolicyHint": "只有勾选的频道才会启用",@@ -130,12 +134,16 @@"useGlobalDefault": "使用全局默认值","backend": "后端","showMessageTypes": "显示的消息类型",+ "showMessageTypesHint": "控制在 Slack 中显示哪些消息类型:\n\n• System:Agent 启动/状态消息\n• Assistant:Agent 的回复和解释\n• Toolcall:工具执行详情(单行摘要)\n\n注意:Agent 的最终结果消息会始终显示,不受此设置影响。","opencodeSettings": "OpenCode 设置","agent": "Agent","model": "模型","reasoningEffort": "推理强度","settingsSaved": "设置已保存",- "settingsSaveFailed": "保存设置失败"+ "settingsSaveFailed": "保存设置失败",+ "requireMention": "需要 @提及",+ "requireMentionOn": "需要 @提及",+ "requireMentionOff": "不需要 @提及"},"summary": {"title": "检查并完成",@@ -148,8 +156,8 @@"requireMention": "需要 @提及","requireMentionHint": "机器人仅在被 @提及时响应","usageTips": "快速上手",- "tipStartCommand": "使用 /start 或 @机器人 开始",- "tipStartCommandDesc": "在任意已启用的频道输入 /start,或 @提及机器人打开控制面板。",+ "tipStartCommand": "使用 @Vibe Remote /start 开始",+ "tipStartCommandDesc": "在任意已启用的频道输入 @Vibe Remote /start 打开控制面板。","tipAgentSwitch": "即时切换 Agent","tipAgentSwitchDesc": "在消息前加 AgentName: 前缀即可路由到指定 Agent,如 \"Plan: 设计 API\"","tipThread": "Thread = 会话",diff --git a/vibe/api.py b/vibe/api.pyindex 2300c8edb..178f972ed 100644--- a/vibe/api.py+++ b/vibe/api.py@@ -90,6 +90,7 @@ def save_settings(payload: dict) -> dict:),custom_cwd=channel_payload.get("custom_cwd"),routing=routing,+ require_mention=channel_payload.get("require_mention"),)store.settings.channels = channelsstore.save()@@ -252,6 +253,7 @@ def _settings_to_payload(store: SettingsStore) -> dict:settings.show_message_types),"custom_cwd": settings.custom_cwd,+ "require_mention": settings.require_mention,"routing": {"agent_backend": settings.routing.agent_backend,"opencode_agent": settings.routing.opencode_agent,diff --git a/vibe/cli.py b/vibe/cli.pyindex c7f23334b..bf1566876 100644--- a/vibe/cli.py+++ b/vibe/cli.py@@ -409,9 +409,52 @@ def cmd_vibe():+def _stop_opencode_server():+ """Terminate the OpenCode server if running."""+ pid_file = paths.get_logs_dir() / "opencode_server.json"+ if not pid_file.exists():+ return False++ try:+ info = json.loads(pid_file.read_text(encoding="utf-8"))+ except Exception:+ return False++ pid = info.get("pid") if isinstance(info, dict) else None+ if not isinstance(pid, int) or not _pid_alive(pid):+ pid_file.unlink(missing_ok=True)+ return False++ # Verify it's actually an opencode serve process+ try:+ import subprocess+ result = subprocess.run(+ ["ps", "-p", str(pid), "-o", "command="],+ capture_output=True,+ text=True,+ )+ cmd = result.stdout.strip()+ if "opencode" not in cmd or "serve" not in cmd:+ return False+ except Exception:+ return False++ try:+ os.kill(pid, signal.SIGTERM)+ pid_file.unlink(missing_ok=True)+ return True+ except Exception:+ return False++def cmd_stop():runtime.stop_service()runtime.stop_ui()++ # Also terminate OpenCode server on full stop+ if _stop_opencode_server():+ print("OpenCode server stopped")+_write_status("stopped")return 0diff --git a/vibe/ui_server.py b/vibe/ui_server.pyindex c457afee2..ca5eab0da 100644--- a/vibe/ui_server.py+++ b/vibe/ui_server.py@@ -154,6 +154,7 @@ class UiHandler(http.server.BaseHTTPRequestHandler):def do_POST(self) -> None:if self.path == "/control":from vibe import runtime+ from vibe.cli import _stop_opencode_serverpayload = self._read_json()action = payload.get("action")@@ -166,6 +167,8 @@ class UiHandler(http.server.BaseHTTPRequestHandler):runtime.write_status("running", "started", service_pid, status.get("ui_pid"))elif action == "stop":runtime.stop_service()+ # Also terminate OpenCode server on full stop+ _stop_opencode_server()runtime.write_status("stopped")elif action == "restart":runtime.stop_service()