-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Replace homepage with conversation manager using TypeScript SDK #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove most homepage content, keeping only settings button - Add ConversationManager React component with full CRUD functionality - Implement conversation listing, creation, messaging, and deletion - Display latest event and current state for each conversation - Add ConversationManager class to SDK for API operations - Export new types: ConversationSearchRequest/Response, ConversationManagerOptions - Update example app to showcase conversation management capabilities Co-authored-by: openhands <openhands@all-hands.dev>
- Update CreateConversationRequest interface to use Message type instead of string - Convert string initialMessage to proper Message object in RemoteConversation.create - Add Message import to conversation models - Fixes 422 error when creating conversations with initial messages Co-authored-by: openhands <openhands@all-hands.dev>
- Added HTTP request body logging in http-client.ts - Added agent object and request logging in remote-conversation.ts - These logs will help identify where model name is being passed as API key - Investigating 401 authentication errors in conversation creation
- Add loadConversationDetails function to fetch RemoteConversation and events - Update conversation click handler to load details when selected - Add conversation events display with messages, actions, and observations - Add proper styling for events list with color-coded event types - Clear conversation details when conversation is deleted or deselected - Show loading state while fetching conversation details Co-authored-by: openhands <openhands@all-hands.dev>
- Add debug logging to see actual conversation data structure - Update ConversationInfo interface to include stats field from API response - Add optional fields like title, created_at, updated_at to match API Co-authored-by: openhands <openhands@all-hands.dev>
- Use agent.kind instead of agent.name (API returns kind: 'Agent') - Display created_at timestamp instead of non-existent conversation_stats - Add fallback for both kind and name fields to handle API variations - Fix both conversation list and detail views Co-authored-by: openhands <openhands@all-hands.dev>
- Add console logs to track conversation selection and data flow - Remove unused state variables (selectedConversationDetails, currentAgent) - Clean up references to removed state setters - Debug conversation finding logic in details section Co-authored-by: openhands <openhands@all-hands.dev>
- Fixed property access issues in JSX rendering - Simplified data structure using single ConversationData interface - Corrected SDK API usage (host instead of baseUrl, getAllConversations instead of listConversations) - Fixed agent status access through state.getAgentStatus() - Removed complex state mixing between ConversationInfo and RemoteConversation types - Improved error handling and loading states - Added proper TypeScript types for all data structures - Cleaned up component structure for better maintainability This resolves the conversation details display issue where data was available but JSX rendering showed blank values due to incorrect property access.
- Changed ConversationManager to use settings.agentServerApiKey instead of settings.apiKey - Updated useEffect dependency to watch for agentServerApiKey changes - Keeps settings.apiKey for LLM authentication in agent creation - Resolves issue where x-session-api-key header was incorrectly set with LLM key This ensures proper separation between: - agentServerApiKey: for authenticating with the OpenHands agent server - apiKey: for LLM API calls within agent configurations
- Updated class names to match rewritten component (refresh-btn, create-btn, delete-btn, etc.) - Changed conversation-layout to conversation-content for grid layout - Updated header elements from h1/h2 to h2/h3 to match component structure - Added styles for new component elements (loading, no-selection, details-content, etc.) - Added proper styling for events-section, message-section, and detail-row elements - Updated responsive design to use correct class names - Fixed send button styling with send-btn class
- Added color: #374151 to .detail-row elements - Added color to .event-message and .event-content elements - Fixes conversation details being invisible due to white text on white background
- Added color: #374151 to .conversation-item for default text color - Added color to .conversation-status elements - Fixes conversation list items being invisible due to white text
- API returns events in { items: [...] } format, not directly as array
- Added proper handling to extract events from response.items
- Added debug logging to track response structure
|
@OpenHands fix |
|
I'm on it! rbren can track my progress at all-hands.dev |
- Added syncPromise to track initial sync completion - Added ensureSynced() method to wait for sync before returning events - Modified getEvents() to await sync completion before accessing cached events - Fixes issue where getEvents() returned empty array before sync completed This resolves the 'Loaded events: []' issue where events were not visible in the conversation manager despite successful API responses.
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI have successfully fixed the Prettier formatting issue that was causing the CI to fail on PR #10. Problem: The Solution:
Changes Made:
Verification:
The CI formatting check should now pass, resolving the build failure that was preventing the PR from being merged. |
Overview
This PR transforms the example application homepage into a comprehensive conversation manager that demonstrates the full capabilities of the TypeScript SDK for interacting with OpenHands Agent Server conversations.
Changes Made
Homepage Transformation
New ConversationManager React Component
SDK Enhancements
ConversationManagerclass for conversation CRUD operationsConversationSearchRequestandConversationSearchResponsetypesConversationManagerOptionsconfiguration typeDebugging & Investigation (Latest Updates)
http-client.tsto see exact request payloadremote-conversation.tsto trace data flowTechnical Implementation
Features Demonstrated
Current Status
✅ Completed Features:
🔍 Under Investigation:
Files Modified
example/src/App.tsx- Updated to use ConversationManagerexample/src/components/ConversationManager.tsx- New React componentexample/src/components/ConversationManager.css- Component stylingexample/vite.config.ts- Updated port configurationsrc/conversation/conversation-manager.ts- New SDK classsrc/conversation/remote-conversation.ts- Added debugging logssrc/client/http-client.ts- Added request body loggingsrc/models/conversation.ts- Added new typessrc/index.ts- Updated exportsTesting
Usage
The conversation manager provides an intuitive interface for:
This implementation serves as both a functional tool and a comprehensive example of how to build applications using the TypeScript SDK.
Next Steps