Skip to content

armgit / avibe

Public Imported from GitHub
0

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.

fix(resume): guide users back to menu picker

cyh97fa4a1c23c6
diff --git a/core/handlers/command_handlers.py b/core/handlers/command_handlers.py
index 836d1e4e1..187500a54 100644
--- a/core/handlers/command_handlers.py
+++ b/core/handlers/command_handlers.py
@@ -347,6 +347,14 @@ class CommandHandlers(BaseHandler):
)
await self._send_wechat_resume_usage(context)
+ async def _send_resume_menu_prompt(self, context: MessageContext) -> None:
+ channel_context = self._get_channel_context(context)
+ await self._get_im_client(channel_context).send_message(
+ channel_context,
+ f"⏮️ {self._t('command.resume.clickButton')}",
+ )
+ await self.handle_start(channel_context)
+
async def handle_start(self, context: MessageContext, args: str = ""):
"""Handle /start command with interactive buttons"""
im_client = self._get_im_client(context)
@@ -684,10 +692,7 @@ class CommandHandlers(BaseHandler):
except Exception as e:
logger.error(f"Error opening resume modal: {e}")
channel_context = self._get_channel_context(context)
- await im_client.send_message(
- channel_context,
- f"⏮️ {self._t('command.resume.clickButton')}",
- )
+ await self._send_resume_menu_prompt(context)
return
if platform == "lark":
if hasattr(im_client, "open_resume_session_modal"):
@@ -705,10 +710,7 @@ class CommandHandlers(BaseHandler):
except Exception as e:
logger.error(f"Error opening resume session card for Lark: {e}")
channel_context = self._get_channel_context(context)
- await im_client.send_message(
- channel_context,
- f"⏮️ {self._t('command.resume.clickButton')}",
- )
+ await self._send_resume_menu_prompt(context)
return
if platform not in {"slack"}:
@@ -721,11 +723,7 @@ class CommandHandlers(BaseHandler):
trigger_id = context.platform_specific.get("trigger_id") if context.platform_specific else None
if not trigger_id:
- channel_context = self._get_channel_context(context)
- await im_client.send_message(
- channel_context,
- f"⏮️ {self._t('command.resume.clickButton')}",
- )
+ await self._send_resume_menu_prompt(context)
return
try:
diff --git a/tests/test_resume_session.py b/tests/test_resume_session.py
index 75cd2e860..6c83c9498 100644
--- a/tests/test_resume_session.py
+++ b/tests/test_resume_session.py
@@ -282,6 +282,28 @@ class ResumeSessionTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual([item.native_session_id for item in sessions], ["thread_123"])
self.assertEqual(ctrl.native_session_service.calls, [("/Users/cyh/vibe-remote", 100)])
+ async def test_command_handlers_handle_resume_without_trigger_sends_menu_prompt(self):
+ settings = _StubSettingsManager()
+ im_client = _StubIMClient()
+ ctrl = _StubController()
+ ctrl.init_minimal(im_client, settings, _StubConfig(platform="slack"))
+ ctrl.command_handler.handle_start = AsyncMock()
+
+ ctx = MessageContext(
+ user_id="U1",
+ channel_id="CCHAN",
+ thread_id="TH1",
+ message_id="TS1",
+ platform="slack",
+ platform_specific={},
+ )
+
+ await ctrl.command_handler.handle_resume(ctx)
+
+ self.assertEqual(len(im_client.messages), 1)
+ self.assertIn("menu message", im_client.messages[0][2])
+ ctrl.command_handler.handle_start.assert_awaited_once()
+
async def test_command_handlers_handle_resume_wechat_lists_recent_sessions(self):
settings = _StubSettingsManager()
im_client = _StubIMClient()
diff --git a/vibe/i18n/en.json b/vibe/i18n/en.json
index cdd1d9cb7..e415f959a 100644
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@ -210,7 +210,7 @@
},
"resume": {
"slackOnly": "Resume is currently available only on Slack. Continue in the same thread to auto-resume.",
- "clickButton": "Please click the Resume button inside Slack to open the picker.",
+ "clickButton": "Please click the Resume Session button in the menu message below to open the picker.",
"noStoredSessions": "No recent agent sessions found for this working directory.",
"noStoredSessionsForBackend": "No recent {backend} sessions found for this working directory.",
"listTitle": "Recent agent sessions for the current working directory",
diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.json
index bc5065336..b09b19acd 100644
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@ -210,7 +210,7 @@
},
"resume": {
"slackOnly": "恢复功能目前仅在 Slack 上可用。在同一线程中继续可自动恢复。",
- "clickButton": "请在 Slack 中点击“恢复”按钮打开选择器。",
+ "clickButton": "请在下面这条菜单消息中点击“恢复会话”按钮打开选择器。",
"noStoredSessions": "当前工作目录下未找到最近的 Agent 会话。",
"noStoredSessionsForBackend": "当前工作目录下未找到最近的 {backend} 会话。",
"listTitle": "当前工作目录下最近的 Agent 会话",