-
Notifications
You must be signed in to change notification settings - Fork 198
Feature/manus api integration and bug fixes #13
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
Open
valentt
wants to merge
18
commits into
henryalps:main
Choose a base branch
from
valentt:feature/manus-api-integration-and-bug-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/manus api integration and bug fixes #13
valentt
wants to merge
18
commits into
henryalps:main
from
valentt:feature/manus-api-integration-and-bug-fixes
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!