Skip to content

Commit 606630a

Browse files
Remove duplicate status field display
- Remove duplicate 'Agent Status' field from conversation details - Consolidate to single 'Status' field that shows agent_status - Update all status refresh logic to use unified status field - Remove unused agentStatus from ConversationData interface - Clean up unused AgentExecutionStatus import - Eliminates confusing duplicate status information in UI Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 0dab6d8 commit 606630a

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

example/src/components/ConversationManager.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import {
44
ConversationInfo,
55
RemoteConversation,
66
AgentBase,
7-
AgentExecutionStatus,
87
Event
98
} from '@openhands/agent-server-typescript-client';
109
import { useSettings } from '../contexts/SettingsContext';
1110

1211
interface ConversationData extends ConversationInfo {
1312
remoteConversation?: RemoteConversation;
1413
events?: Event[];
15-
agentStatus?: AgentExecutionStatus;
1614
}
1715

1816
// Utility function to extract displayable content from events
@@ -136,7 +134,7 @@ export const ConversationManager: React.FC = () => {
136134
const status = await selectedConversation.remoteConversation!.state.getAgentStatus();
137135
setConversations(prev => prev.map(conv =>
138136
conv.id === selectedConversation.id
139-
? { ...conv, agentStatus: status }
137+
? { ...conv, status: status }
140138
: conv
141139
));
142140
} catch (err) {
@@ -146,13 +144,13 @@ export const ConversationManager: React.FC = () => {
146144

147145
// Refresh every 2 seconds if the agent is running
148146
const interval = setInterval(() => {
149-
if (selectedConversation.agentStatus === 'running') {
147+
if (selectedConversation.status === 'running') {
150148
refreshStatus();
151149
}
152150
}, 2000);
153151

154152
return () => clearInterval(interval);
155-
}, [selectedConversation?.id, selectedConversation?.agentStatus]);
153+
}, [selectedConversation?.id, selectedConversation?.status]);
156154

157155
const loadConversations = async (conversationManager?: SDKConversationManager) => {
158156
const mgr = conversationManager || manager;
@@ -313,7 +311,7 @@ export const ConversationManager: React.FC = () => {
313311
remoteConversation.state.getAgentStatus().then(status => {
314312
setConversations(prev => prev.map(conv =>
315313
conv.id === conversationId
316-
? { ...conv, agentStatus: status }
314+
? { ...conv, status: status }
317315
: conv
318316
));
319317
}).catch(err => console.warn('Failed to update agent status:', err));
@@ -353,7 +351,7 @@ export const ConversationManager: React.FC = () => {
353351
// Update the conversation in our state with additional details
354352
setConversations(prev => prev.map(conv =>
355353
conv.id === conversationId
356-
? { ...conv, remoteConversation, events, agentStatus }
354+
? { ...conv, remoteConversation, events, status: agentStatus }
357355
: conv
358356
));
359357

@@ -532,12 +530,7 @@ export const ConversationManager: React.FC = () => {
532530
<span className="font-medium text-gray-900 dark:text-white">Updated:</span>
533531
<span className="text-gray-600 dark:text-gray-400">{formatDate(selectedConversation.updated_at)}</span>
534532
</div>
535-
{selectedConversation.agentStatus && (
536-
<div className="flex justify-between">
537-
<span className="font-medium text-gray-900 dark:text-white">Agent Status:</span>
538-
<span className="text-gray-600 dark:text-gray-400">{selectedConversation.agentStatus}</span>
539-
</div>
540-
)}
533+
541534
<div className="flex justify-between">
542535
<span className="font-medium text-gray-900 dark:text-white">Total Events:</span>
543536
<span className="text-gray-600 dark:text-gray-400">{selectedConversation.events?.length || 0}</span>

0 commit comments

Comments
 (0)