Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,12 @@
"action": "Add an agent"
},
"agentRoomLiveness": {
"neverConnected": "{{agentName}} isn't connected. Messages sent here will wait for this seat to connect.",
"neverConnected": "{{agentName}} isn't connected yet. Messages sent here will wait until it runs.",
"goneDark": "{{agentName}} hasn't checked in recently. A reply may take longer.",
"unknown": "{{agentName}}'s availability is unknown. A reply may take longer.",
"waiting": "Waiting for {{agentName}} to reply…",
"timedOut": "{{agentName}} hasn't replied yet. Your message is still in this conversation."
"timedOut": "{{agentName}} hasn't replied yet. Your message is still in this conversation.",
"runCommand": "To connect it, run:"
},
"podAgentLiveness": {
"notConnected": "{{agentName}} isn't connected yet, so it won't answer here until it's running.",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@
"goneDark": "{{agentName}} 最近没有接入,回复可能需要更长时间。",
"unknown": "{{agentName}} 的可用状态未知,回复可能需要更长时间。",
"waiting": "正在等待 {{agentName}} 回复…",
"timedOut": "{{agentName}} 还没有回复。你的消息仍在此对话中。"
"timedOut": "{{agentName}} 还没有回复。你的消息仍在此对话中。",
"runCommand": "要连接它,请运行:"
},
"podAgentLiveness": {
"notConnected": "{{agentName}} 还没有连接,运行起来之前不会在这里回复。",
Expand Down
29 changes: 29 additions & 0 deletions frontend/src/v2/__tests__/V2ThreadStarter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,35 @@ describe('V2Thread agent-room liveness', () => {
);
});

test('a never-connected direct seat says so and shows the owner the command to run', async () => {
axios.get.mockResolvedValue({
data: {
agents: [{
agentName: 'openclaw', instanceId: 'aria', displayName: 'Aria', state: 'never-connected', isOwner: true, fixCommand: 'commonly agent run aria',
}],
},
});
renderChat(makeAgentRoom());

const banner = await screen.findByTestId('agent-room-liveness');
expect(banner).toHaveTextContent("Aria isn't connected yet");
expect(screen.getByTestId('agent-room-fix-command')).toHaveTextContent('commonly agent run aria');
});

test('a never-connected direct seat shows a non-owner no command', async () => {
axios.get.mockResolvedValue({
data: {
agents: [{
agentName: 'openclaw', instanceId: 'aria', displayName: 'Aria', state: 'never-connected', isOwner: false,
}],
},
});
renderChat(makeAgentRoom());

expect(await screen.findByTestId('agent-room-liveness')).toHaveTextContent("Aria isn't connected yet");
expect(screen.queryByTestId('agent-room-fix-command')).not.toBeInTheDocument();
});

test('a live direct seat shows a wait until it replies', async () => {
axios.get.mockResolvedValue({
data: {
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/v2/components/V2Thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,14 @@ const V2Thread: React.FC<V2ThreadProps> = ({ detail, firstRunVisible = false, in
{showDirectAgentLiveness && directAgent && (
<div className="v2-chat__agent-room-status" data-testid="agent-room-liveness" role="status">
{t(directAgentLivenessKey, { agentName: directAgent.displayName })}
{directAgentReach === 'never-connected' && directAgent.state?.isOwner && directAgent.state?.fixCommand && (
<>
{' '}{t('podChat.agentRoomLiveness.runCommand')}
<code className="v2-chat__agent-room-command" data-testid="agent-room-fix-command">
{directAgent.state.fixCommand}
</code>
</>
)}
</div>
)}
{podAgentLiveness.map((row) => (
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/v2/v2.css
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,14 @@ body.modern-ui.v2-canvas {
line-height: 1.4;
}

.v2-chat__agent-room-command {
display: block;
margin-top: 4px;
font-family: var(--v2-font-mono, ui-monospace, monospace);
overflow-wrap: anywhere;
user-select: all;
}

.v2-chat__agent-room-status--wait {
border-color: var(--v2-border);
background: var(--v2-surface-hover);
Expand Down
Loading