Commit Graph

217 Commits

Author SHA1 Message Date
hetaoBackend
fa9fba3f8e fix: preserve reasoning_content in multi-turn conversations
When using thinking-enabled models (like Kimi K2.5, DeepSeek), the API
expects reasoning_content on all assistant messages. The original
ChatDeepSeek stores reasoning_content in additional_kwargs but doesn't
include it when making subsequent API calls, causing "reasoning_content
is missing" errors.

This adds PatchedChatDeepSeek which overrides _get_request_payload to
restore reasoning_content from additional_kwargs into the payload.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:04:35 +08:00
Henry Li
d075e7a234 feat: fallback to error reporting 2026-01-28 12:23:29 +08:00
hetao
b8c33e342b feat: add firecrawl community package with web_search and web_fetch tools
Add web_search_tool and web_fetch_tool implementations using the official
firecrawl-py SDK as an alternative to Tavily/Jina AI integrations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 19:58:08 +08:00
hetao
22004406a7 perf: parallelize TTS generation in podcast skill
Use ThreadPoolExecutor to generate audio for multiple script lines
concurrently, significantly speeding up podcast generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:50:56 +08:00
hetaoBackend
9f5658fa0e feat: add podcast generation skill
- Add podcast-generation skill for creating tech explainer podcasts
- Include generate.py script with TTS synthesis capabilities
- Add tech-explainer template for structured podcast content
- Increase sandbox command timeout from 30s to 600s to support
  longer-running skill scripts
2026-01-26 13:16:35 +08:00
hetaoBackend
139063283f fix: ensure MCP and skills config changes are immediately reflected
- Use ExtensionsConfig.from_file() instead of cached config to always
  read latest configuration from disk in LangGraph Server
- Add mtime-based cache invalidation for MCP tools to detect config
  file changes made through Gateway API
- Call reload_extensions_config() in Gateway API after updates to
  refresh the global cache
- Remove unnecessary MCP initialization from Gateway startup since
  MCP tools are only used by LangGraph Server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:40:09 +08:00
hetao
6e147a772e feat: add environment variable injection for Docker sandbox
- Add environment field to sandbox config for injecting env vars into container
- Support $VAR syntax to resolve values from host environment variables
- Refactor frontend API modules to use centralized getBackendBaseURL()
- Improve Doraemon skill with explicit input/output path arguments
- Add .env.example file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 22:36:05 +08:00
JeffJiang
38081306fe feat: adds docker-based dev environment (#18)
* feat: adds docker-based dev environment

* docs: updates Docker command help

* fix local dev
2026-01-24 22:01:00 +08:00
Henry Li
3ffce7667c Merge pull request #16 from amszuidas/experimental
fix: refactor env var resolution to support complex structures and fix in-place mutation bug
2026-01-24 10:14:20 +08:00
Henry Li
b1e7028ea0 Merge pull request #17 from amszuidas/fix/tavily-api-key-config
fix: support loading tavily ak from config.yaml
2026-01-24 10:14:04 +08:00
amszuidas
d6176e86d6 fix: support loading tavily ak from config.yaml 2026-01-23 23:50:40 +08:00
amszuidas
3972485fe0 fix: use return value of resolve_env_variables in config loading 2026-01-23 21:51:48 +08:00
hetao
f6a20a69e3 feat: implement file upload feature 2026-01-23 18:47:39 +08:00
amszuidas
eb802361e1 fix: correct spelling 2026-01-23 18:29:20 +08:00
amszuidas
82a6ae81bd fix: robust environment variable resolution in config 2026-01-23 17:01:38 +08:00
hetao
31bf49917c feat: add unified development environment with nginx proxy
Add a root-level Makefile to manage frontend, backend, and nginx services:
- `make check` validates required dependencies (Node.js 22+, pnpm, uv, nginx)
- `make install` installs all project dependencies
- `make dev` starts all services with unified port 2026
- `make stop` and `make clean` for cleanup

Update nginx configuration:
- Change port from 8000 to 2026
- Add frontend upstream and routing (port 3000)
- Add /api/langgraph/* routing with path rewriting to LangGraph server
- Keep other /api/* routes to Gateway API
- Route non-API requests to frontend

Update frontend configuration:
- Use relative URLs through nginx proxy by default
- Support environment variables for direct backend access
- Construct full URL for LangGraph SDK compatibility

Clean up backend Makefile by removing nginx and serve targets.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-22 12:00:46 +08:00
hetao
c00f780501 fix: fix nginx conf 2026-01-22 12:00:46 +08:00
hetao
5a45b9c131 feat: add SSE and HTTP transport support for MCP servers
- Add type, url, and headers fields to MCP server config
- Update MCP client to handle stdio, sse, and http transports
- Add todos field to ThreadState
- Add Deerflow branding requirement to frontend-design skill
- Update extensions_config.example.json with SSE/HTTP examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:14:00 +08:00
hetaoBackend
3191a3845f feat: integrate todo middleware 2026-01-20 22:38:04 +08:00
hetaoBackend
adbb03fc26 fix: fix sandbox cp issue 2026-01-20 22:08:36 +08:00
hetaoBackend
5888a5ba16 fix: fix skill md path 2026-01-20 21:10:05 +08:00
hetaoBackend
abc6c21b11 feat: enable public skills by default 2026-01-20 20:37:51 +08:00
hetaoBackend
50810c8212 feat: add skills api 2026-01-20 13:57:36 +08:00
hetaoBackend
8434cf4c60 feat: add MCP API endpoint and enhance API documentation
Add new MCP configuration management endpoint and enhance API documentation
with detailed descriptions, examples, and OpenAPI support for better
developer experience.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-20 13:20:50 +08:00
hetaoBackend
d11763dcc8 fix: fix backend 2026-01-20 09:58:27 +08:00
DanielWalnut
513332b746 feat: add nginx reversed proxy (#15)
* docs: add nginx reverse proxy documentation

Add comprehensive nginx configuration documentation to README including:
- Production deployment instructions with step-by-step setup
- Architecture diagram showing traffic routing between services
- Nginx features: unified entry point, CORS handling, SSE support
- Updated project structure with nginx.conf and service ports

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: implement nginx

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 23:23:38 +08:00
hetaoBackend
d6c1e5868d fix: fix proxy 2026-01-19 21:36:35 +08:00
hetaoBackend
1171598b2f feat: add MCP (Model Context Protocol) support
Add comprehensive MCP integration using langchain-mcp-adapters to enable
pluggable external tools from MCP servers.

Features:
- MCP server configuration via mcp_config.json
- Automatic lazy initialization for seamless use in both FastAPI and LangGraph Studio
- Support for multiple MCP servers (filesystem, postgres, github, brave-search, etc.)
- Environment variable resolution in configuration
- Tool caching mechanism for optimal performance
- Complete documentation and setup guide

Implementation:
- Add src/mcp module with client, tools, and cache components
- Integrate MCP config loading in AppConfig
- Update tool system to include MCP tools automatically
- Add eager initialization in FastAPI lifespan handler
- Add lazy initialization fallback for LangGraph Studio

Dependencies:
- Add langchain-mcp-adapters>=0.1.0

Documentation:
- Add MCP_SETUP.md with comprehensive setup guide
- Update CLAUDE.md with MCP system architecture
- Update config.example.yaml with MCP configuration notes
- Update README.md with MCP setup instructions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 18:58:13 +08:00
hetaoBackend
1a7c853811 fix: use shared httpx client to prevent premature closure in SSE streaming
The proxy was creating a temporary httpx.AsyncClient within an async context manager.
When returning StreamingResponse for SSE endpoints, the client was being closed before
the streaming generator could use it, causing "client has been closed" errors.

This change introduces a shared httpx.AsyncClient that persists for the application
lifecycle, properly cleaned up during shutdown. This also improves performance by
reusing TCP connections across requests.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 16:52:30 +08:00
hetaoBackend
8ea530e221 fix: stop tracking .claude/settings.local.json
Remove .claude/settings.local.json from git tracking and add it to .gitignore to prevent future accidental commits of local settings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 16:28:03 +08:00
DanielWalnut
9a3eaea54e feat: implement summarization (#14) 2026-01-19 16:17:31 +08:00
DanielWalnut
645923c3bc feat: add clarification feature (#13) 2026-01-18 19:55:36 +08:00
DanielWalnut
c50540e3fc fix: Long thinking but with empty content (#12) 2026-01-18 14:21:40 +08:00
DanielWalnut
1397f30f24 feat: implement lazy sandbox and thread data initialization (#11)
Defer sandbox acquisition and thread directory creation until first use to improve performance and reduce resource usage.

Changes:
- Add lazy_init parameter to SandboxMiddleware (default: true)
- Add ensure_sandbox_initialized() helper for lazy sandbox acquisition
- Update all sandbox tools to use lazy initialization
- Add lazy_init parameter to ThreadDataMiddleware (default: true)
- Create thread directories on-demand in AioSandboxProvider
- LocalSandbox already creates directories on write (no changes needed)

Benefits:
- Saves 1-2s Docker container startup for conversations without tools
- Reduces unnecessary directory creation and file system operations
- Backward compatible with lazy_init=false option

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 13:38:34 +08:00
DanielWalnut
bfe8a24350 fix: fix backend python execution (#10) 2026-01-18 12:41:48 +08:00
DanielWalnut
aa030410fc feat: fix todos (#9) 2026-01-17 23:23:12 +08:00
Henry Li
a66d515214 chore: add TODO for checking duplicate files in state.artifacts 2026-01-17 16:25:51 +08:00
Henry Li
1c74e9996f dos: update backend TODOs 2026-01-17 16:17:59 +08:00
Henry Li
962d8f04ec feat: support artifact preview 2026-01-17 15:09:44 +08:00
DanielWalnut
facde645d7 feat: add artifacts logic (#8) 2026-01-16 23:04:38 +08:00
DanielWalnut
4b69aed47b feat: add thread-safety and graceful shutdown to AioSandboxProvider (#7)
Add thread-safe port allocation and proper cleanup on process exit to
prevent port conflicts in concurrent environments and ensure containers
are stopped when the application terminates.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 22:28:19 +08:00
Henry Li
c0e63c5308 docs: rewording 2026-01-16 22:10:08 +08:00
Henry Li
1517e8675d feat: add present_file tool 2026-01-16 21:48:00 +08:00
DanielWalnut
9f755ecc30 feat: add skills system for specialized agent workflows (#6)
Implement a skills framework that enables specialized workflows for
specific tasks (e.g., PDF processing, web page generation). Skills are
discovered from the skills/ directory and automatically mounted in
sandboxes with path mapping support.

- Add SkillsConfig for configuring skills path and container mount point
- Implement dynamic skill loading from SKILL.md files with YAML frontmatter
- Add path mapping in LocalSandbox to translate container paths to local paths
- Mount skills directory in AIO Docker sandbox containers
- Update lead agent prompt to dynamically inject available skills
- Add setup documentation and expand config.example.yaml

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:44:51 +08:00
DanielWalnut
7284eb15f1 feat: add gateway module with FastAPI server (#5)
* chore: add .claude/ to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add gateway module with FastAPI server

- Add new gateway module with FastAPI app for API routing
- Add gateway and serve commands to Makefile
- Add fastapi, httpx, uvicorn, sse-starlette dependencies
- Fix model config retrieval in lead_agent (support both model_name and model)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:22:26 +08:00
DanielWalnut
b44144dd2c feat: support function factory (#4) 2026-01-15 22:05:54 +08:00
DanielWalnut
a39f799a7e fix: fix local path for local sandbox (#3) 2026-01-15 14:37:00 +08:00
DanielWalnut
c92eedc572 feat: add thread data middleware (#2) 2026-01-15 13:22:30 +08:00
DanielWalnut
ab427731dc feat: add AIO sandbox provider and auto title generation (#1)
- Add AioSandboxProvider for Docker-based sandbox execution with
  configurable container lifecycle, volume mounts, and port management
- Add TitleMiddleware to auto-generate thread titles after first
  user-assistant exchange using LLM
- Add Claude Code documentation (CLAUDE.md, AGENTS.md)
- Extend SandboxConfig with Docker-specific options (image, port, mounts)
- Fix hardcoded mount path to use expanduser
- Add agent-sandbox and dotenv dependencies

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:29:18 +08:00
Henry Li
de2d18561a feat: integrated with sandbox 2026-01-14 12:32:34 +08:00