Feature/manus api integration and bug fixes - #13
Conversation
- Add .gitattributes to enforce LF line endings for shell scripts - Change Dockerfile CMD from sh to bash for better compatibility - Convert start.sh from CRLF to LF line endings Fixes container startup failures with ": not found" errors caused by Windows CRLF line endings being incompatible with Unix bash.
Add langchain-openai>=0.2.0 to requirements.txt to support OpenAI-compatible LLM clients. Fixes ModuleNotFoundError when attempting to import ChatOpenAI.
Create __init__.py with proper exports for all node functions to enable correct module imports. Fixes node module import failures in the agent workflow.
Add 'from langgraph.types import Command' import to browser_node.py and planner_node.py. Part of fixing TypeError: Expected a Runnable, callable or dict. Instead got an unsupported type: <class 'module'>
- Add 'from langgraph.types import Command' import
- Add type checking to handle both string and message object responses
- Only apply JSON repair to content that looks like JSON (starts with { or [)
Fixes multiple issues in coordinator_node:
- TypeError: Expected a Runnable, callable or dict
- AttributeError: 'str' object has no attribute 'content'
- Prevents corruption of plain text messages by json_repair
Remove invalid conditional edge syntax and let Command objects handle routing instead. Simplified graph to only set entry point. Fixes TypeError: add_edge() got an unexpected keyword argument 'condition'
- Fix regex backreference from r"{1}" to r"{\1}"
- Add TEAM_MEMBERS variable support in apply_prompt_template
- Improve dynamic template variable handling
Fixes IndexError: tuple index out of range and KeyError: 'TEAM_MEMBERS'
Change from dict access (msg["role"]) to attribute access (msg.role) for proper handling of Pydantic ChatMessage objects. Fixes TypeError: 'ChatMessage' object is not subscriptable
…tion - Add stream() method to PlaceholderLLM for compatibility - Implement actual LLM client creation when API keys are configured - Add ManusLLM detection and routing for Manus API - Import ManusLLM class Fixes: - AttributeError: 'PlaceholderLLM' object has no attribute 'stream' - Issue where system used placeholder even with valid API credentials - Enables Manus API integration
Complete rewrite of ChatInput component to add: - useState for input value management - onChange handler for input changes - onClick handler for send button - onKeyPress handler for Enter key submission Fixes non-functional send button - UI was completely non-interactive.
Implement handleSendMessage function with: - Fetch to /api/chat/stream endpoint - SSE stream parsing - Python dict format extraction (HumanMessage content parsing) - Comprehensive error handling with helpful messages Fixes network error and enables actual communication with backend.
- Add message bubbles with color distinction for user/assistant - Add empty state message - Improve spacing and readability - Add proper scrolling behavior Improves user experience with better visual presentation.
Complete rewrite of CLI client: - Update port from 5000 to 8000 - Change endpoint from /task to /api/chat/stream - Add SSE stream parsing - Add response extraction from Python dict format Fixes broken CLI client that couldn't connect to current API.
Create ManusLLM class for Manus task-based API:
- Implements LangChain-compatible invoke() and stream() methods
- Handles task creation via POST /v1/tasks
- Implements polling for task completion via GET /v1/tasks/{task_id}
- Extracts responses from task output array
- Uses API_KEY header authentication (not Bearer token)
- Handles both dict and LangChain message objects
Manus API is task-based (not OpenAI-compatible chat API), requiring
custom implementation. Maintains compatibility with existing agent workflow.
API Documentation: https://open.manus.ai/docs
Add .env.example with: - BASIC, REASONING, and VISION LLM configuration - Azure OpenAI alternative configuration - Browser configuration options - Detailed comments explaining each section Provides clear template for users to configure API keys.
Update Configuration section with: - Detailed API key setup instructions - Supported LLM providers list - Fixed docker-compose example - Updated API documentation - Corrected CLI usage examples Improves documentation accuracy and completeness for new users.
Add detailed documentation of all bugs encountered and fixed: - 17 bugs fixed (categorized by severity and component) - 1 new feature (Manus API integration) - Root cause analysis for each issue - Testing results and statistics - Recommendations for future work Provides complete reference for maintainers and contributors.
- Add .claude/ directory (IDE-specific) - Add COMMIT_PLAN.md and NEXT_STEPS.md (internal planning documents)
Daku3011
left a comment
There was a problem hiding this comment.
Review Summary
I have reviewed the changes and tested the implementation on my end. The reported issues have been resolved successfully, and the application is now functioning correctly across the backend, frontend, Docker setup, and CLI.
The Manus API integration is a valuable addition to the project. The custom LLM client is well implemented, follows the existing architecture, and maintains backward compatibility with the supported providers. The accompanying documentation, configuration examples, and bug report also make the changes much easier to understand and review.
Overall, the changes are well organized, the commit history is clean, and the improvements to stability and usability are appreciated.
Thank you for taking the time to identify, fix, and document these issues, as well as for contributing the new Manus API support.
Status: . Ready to merge.
Pull Request: Fix Critical Bugs and Add Manus API Integration
Summary
This PR fixes 17 critical bugs that made OpenManus non-functional and adds support for Manus API integration through a custom LLM client.
Status: ✅ All components now fully operational (Docker, Backend, Frontend, CLI)
Changes Overview
🔧 Infrastructure & Build Fixes (3 commits)
__init__.pyfor nodes package🔄 Backend Workflow Fixes (5 commits)
🤖 LLM Integration Fixes & Features (2 commits)
🎨 Frontend Fixes (3 commits)
💻 CLI Client Fix (1 commit)
📚 Documentation (3 commits)
🧹 Maintenance (1 commit)
Detailed Bug Fixes
Critical Issues Fixed
Container Startup Failure
: not foundin Docker container.gitattributesApplication Crash on Startup
TypeError: Expected a Runnable, callable or dictCommandimports in node filesGraph Configuration Error
add_edge() got an unexpected keyword argument 'condition'Non-functional Frontend
Frontend Not Connected to Backend
LLM Always Using Placeholder
get_llm_by_type()See
BUGFIX_REPORT.mdfor complete analysis of all 17 bugs.🌟 New Feature: Manus API Integration
Overview
Manus API uses a task-based architecture (not OpenAI-compatible), requiring a custom implementation:
Implementation
Created
ManusLLMclass insrc/llms/manus_llm.py:invoke()andstream()methodsAPI_KEYheader authentication (not Bearer token)API Documentation
https://open.manus.ai/docs
Testing
✅ CLI Client
$ python src/client.py --task "What is 2+2?" Response: 2+2 is 4.✅ Web Interface
✅ Docker Containers
✅ Manus API Integration
Breaking Changes
None - All changes are backwards compatible and additive.
Files Changed
Modified: 15 files
Created: 7 files
Total Lines Changed: ~800+
Key Files:
src/llms/manus_llm.py(NEW) - 175 linesBUGFIX_REPORT.md(NEW) - 413 lines.env.example(NEW) - 46 linessrc/agents/nodes/__init__.py(NEW)README.md- Updated configuration sectionDocumentation
New Documentation Files
BUGFIX_REPORT.md - Comprehensive analysis:
.env.example - Configuration template:
Updated README.md:
Commit History
All 18 commits follow conventional commit format and are organized by functionality:
Each commit is independently reviewable and focused on a single concern.
Future Enhancements
Recommendations for follow-up work:
taskIdparameterChecklist
Questions?
Feel free to ask questions or request clarification on any of the changes. All fixes are documented in detail in
BUGFIX_REPORT.md.Thank you for considering this contribution!