From ac3286f02570358d2cc5a51c240c47c50bbfecdb Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Fri, 30 Oct 2026 09:41:41 -0700 Subject: [PATCH 1/5] fix(v2): show every message-wake choice at once in agent settings "Human messages only" appeared only after "Wake on messages" was ticked, so the setting the docs describe looked missing. Message wake is now one visible choice of three per pod: mentions only, messages from people, or every message. Each choice writes wakeOnMessage and humanOnly together. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N4VWLC9MiWprFWXFNjJSnr --- frontend/src/i18n/locales/en.json | 6 ++-- frontend/src/i18n/locales/zh-CN.json | 6 ++-- .../src/v2/__tests__/V2AgentWakePods.test.tsx | 27 ++++++++++++++ frontend/src/v2/agents/V2AgentWakePods.tsx | 35 +++++++++++++------ frontend/src/v2/agents/v2-agent-wake-pods.css | 2 ++ 5 files changed, 62 insertions(+), 14 deletions(-) diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 3dbd8b52a5..a773907da6 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -2651,8 +2651,10 @@ "listingSeparate": "Publishing a listing is managed separately from Settings.", "wakeTitle": "Wake", "mentionsAlwaysWake": "Mentions always wake this agent.", - "wakeOnMessage": "Wake on messages", - "humanOnly": "Human messages only", + "messageWake": "Messages that wake it", + "messageWake_mentions": "Mentions only", + "messageWake_human": "Messages from people", + "messageWake_all": "Every message", "boardWake": "Wake on board changes", "heartbeat": "Heartbeat", "heartbeatInterval": "Interval", diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json index 4755445bb2..52cb98182d 100644 --- a/frontend/src/i18n/locales/zh-CN.json +++ b/frontend/src/i18n/locales/zh-CN.json @@ -2642,8 +2642,10 @@ "listingSeparate": "发布市场条目需在设置页之外完成。", "wakeTitle": "唤醒", "mentionsAlwaysWake": "提及始终会唤醒此智能体。", - "wakeOnMessage": "收到消息时唤醒", - "humanOnly": "仅限真人消息", + "messageWake": "哪些消息会唤醒它", + "messageWake_mentions": "仅 @提及", + "messageWake_human": "真人发的消息", + "messageWake_all": "所有消息", "boardWake": "看板变更时唤醒", "heartbeat": "心跳间隔", "heartbeatInterval": "间隔", diff --git a/frontend/src/v2/__tests__/V2AgentWakePods.test.tsx b/frontend/src/v2/__tests__/V2AgentWakePods.test.tsx index a3ccb6e1ba..5bf53a3b47 100644 --- a/frontend/src/v2/__tests__/V2AgentWakePods.test.tsx +++ b/frontend/src/v2/__tests__/V2AgentWakePods.test.tsx @@ -43,6 +43,33 @@ describe('per-agent Wake and Pods settings', () => { )); }); + it('shows all three message-wake choices without first opting in (D173)', async () => { + client.get.mockResolvedValue({ data: { turnCap: 30, activePodCount: 1, podCount: 1, installations: [{ + podId: 'pod-1', podName: 'Launch', status: 'active', wakeOnMessage: false, humanOnly: false, + boardWake: false, heartbeatEnabled: false, heartbeatMinutes: 60, + }] } }); + renderSettings(); + expect(await screen.findByRole('group', { name: 'Messages that wake it' })).toBeInTheDocument(); + expect(screen.getByLabelText('Mentions only')).toBeChecked(); + expect(screen.getByLabelText('Every message')).not.toBeChecked(); + fireEvent.click(screen.getByLabelText('Messages from people')); + await waitFor(() => expect(updatePod).toHaveBeenCalledWith( + 'pod-1', + { wakeOnMessage: true, humanOnly: true, boardWake: false, heartbeatEnabled: false, heartbeatMinutes: 60 }, + )); + expect(screen.getByLabelText('Messages from people')).toBeChecked(); + }); + + it('marks the saved human-only setting and clears it on mentions only', async () => { + renderSettings(); + expect(await screen.findByLabelText('Messages from people')).toBeChecked(); + fireEvent.click(screen.getByLabelText('Mentions only')); + await waitFor(() => expect(updatePod).toHaveBeenCalledWith( + 'pod-1', + { wakeOnMessage: false, humanOnly: false, boardWake: false, heartbeatEnabled: false, heartbeatMinutes: 60 }, + )); + }); + it('removes a pod installation and leaves the settings view open', async () => { const confirm = jest.spyOn(window, 'confirm').mockReturnValue(true); renderSettings(); diff --git a/frontend/src/v2/agents/V2AgentWakePods.tsx b/frontend/src/v2/agents/V2AgentWakePods.tsx index 96b4ee20f6..1ca3e2acdc 100644 --- a/frontend/src/v2/agents/V2AgentWakePods.tsx +++ b/frontend/src/v2/agents/V2AgentWakePods.tsx @@ -16,6 +16,20 @@ interface InstallationSettings { heartbeatMinutes: number; } +// Message wake is one choice of three, shown together: the human-only +// filter used to appear only after "Wake on messages" was ticked (D173). +const MESSAGE_WAKE_CHOICES = ['mentions', 'human', 'all'] as const; +type MessageWakeChoice = typeof MESSAGE_WAKE_CHOICES[number]; +const MESSAGE_WAKE_SETTINGS: Record> = { + mentions: { wakeOnMessage: false, humanOnly: false }, + human: { wakeOnMessage: true, humanOnly: true }, + all: { wakeOnMessage: true, humanOnly: false }, +}; +const messageWakeChoice = (entry: InstallationSettings): MessageWakeChoice => { + if (!entry.wakeOnMessage) return 'mentions'; + return entry.humanOnly ? 'human' : 'all'; +}; + const V2AgentWakePods: React.FC<{ agentName: string; instanceId: string; @@ -136,16 +150,17 @@ const V2AgentWakePods: React.FC<{ {installations.map((entry) => (
{entry.podName} - - {entry.wakeOnMessage && } +
+ {t('agentSettings.messageWake')} + {MESSAGE_WAKE_CHOICES.map((choice) => ( + + ))} +