Skip to content

Commit 4d58a8c

Browse files
Fix conversation list UI issues
- Fix conversation list vertical cutoff by increasing max-height from 384px to 600px - Fix status field mapping from agent_status to status in ConversationInfo interface - Fix agent name display by using agent.kind instead of agent.name for Agent-Output schema - Update AgentExecutionStatus enum to match API schema (add waiting_for_confirmation and stuck) - Update status color classes and icons for new status values - Update AgentBase interface to use kind as primary field with name as fallback Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 7e99198 commit 4d58a8c

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

example/src/components/ConversationManager.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export const ConversationManager: React.FC = () => {
172172
agent: conv.agent,
173173
created_at: conv.created_at,
174174
updated_at: conv.updated_at,
175-
status: conv.status
175+
// Map agent_status to status for display
176+
status: conv.agent_status || conv.status
176177
}));
177178

178179
setConversations(conversationData);
@@ -192,7 +193,7 @@ export const ConversationManager: React.FC = () => {
192193
try {
193194
// Create a simple agent configuration
194195
const agent: AgentBase = {
195-
name: 'CodeActAgent',
196+
kind: 'Agent',
196197
llm: {
197198
model: settings.modelName,
198199
api_key: settings.apiKey || ''
@@ -388,27 +389,31 @@ export const ConversationManager: React.FC = () => {
388389
};
389390

390391
const getAgentName = (agent: AgentBase) => {
391-
return agent.name || 'Unknown Agent';
392+
return agent.kind || agent.name || 'Unknown Agent';
392393
};
393394

394395
const getStatusColorClass = (status?: string) => {
395396
switch (status) {
396397
case 'running': return 'text-green-500';
397-
case 'stopped': return 'text-red-500';
398+
case 'idle': return 'text-gray-500';
398399
case 'paused': return 'text-orange-500';
400+
case 'waiting_for_confirmation': return 'text-yellow-500';
399401
case 'finished': return 'text-blue-500';
400402
case 'error': return 'text-red-600';
403+
case 'stuck': return 'text-red-500';
401404
default: return 'text-gray-500';
402405
}
403406
};
404407

405408
const getStatusIcon = (status?: string) => {
406409
switch (status) {
407410
case 'running': return '🔄';
408-
case 'stopped': return '️';
411+
case 'idle': return '️';
409412
case 'paused': return '⏸️';
413+
case 'waiting_for_confirmation': return '⏳';
410414
case 'finished': return '✅';
411415
case 'error': return '❌';
416+
case 'stuck': return '🚫';
412417
default: return '❓';
413418
}
414419
};
@@ -455,7 +460,7 @@ export const ConversationManager: React.FC = () => {
455460
<p>No conversations yet. Create your first conversation!</p>
456461
</div>
457462
) : (
458-
<div className="space-y-3 max-h-96 overflow-y-auto">
463+
<div className="space-y-3 max-h-[600px] overflow-y-auto">
459464
{conversations.map((conversation) => (
460465
<div
461466
key={conversation.id}

example/src/utils/serverStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const testLLMConfiguration = async (settings: Settings): Promise<{ succes
5555
const conversation = await RemoteConversation.create(
5656
settings.agentServerUrl,
5757
{
58-
name: 'TestAgent',
58+
kind: 'Agent',
5959
llm: {
6060
model: settings.modelName,
6161
api_key: settings.apiKey,

src/models/conversation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export interface ConversationInfo {
2525
title?: string;
2626
created_at?: string;
2727
updated_at?: string;
28+
// Add status as an alias for agent_status for backward compatibility
29+
status?: AgentExecutionStatus;
2830
[key: string]: any;
2931
}
3032

src/types/base.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ export interface ImageContent extends MessageContent {
7272
}
7373

7474
export interface AgentBase {
75-
name: string;
75+
kind: string;
7676
llm: LLM;
77+
// Keep name for backward compatibility
78+
name?: string;
7779
[key: string]: any;
7880
}
7981

@@ -109,8 +111,10 @@ export enum AgentExecutionStatus {
109111
IDLE = 'idle',
110112
RUNNING = 'running',
111113
PAUSED = 'paused',
114+
WAITING_FOR_CONFIRMATION = 'waiting_for_confirmation',
112115
FINISHED = 'finished',
113116
ERROR = 'error',
117+
STUCK = 'stuck',
114118
}
115119

116120
export interface ConversationStats {

0 commit comments

Comments
 (0)