Commit Graph

211 Commits

Author SHA1 Message Date
朱潮
148ebc5904 优化agent v3接口 2026-06-22 16:39:04 +08:00
朱潮
a2c2f182be fix: AgentConfig.bot_id 用 project_dir_key 覆盖,使 workspace 按用户隔离
deep_assistant/prompt_loader 用 config.bot_id 拼 projects/robot/{bot_id},
之前只改 project_dir 无效。from_v3_request 在 bot_config 带 project_dir_key 时
用它覆盖 bot_id,使 workspace、系统提示词路径、skills 目录都按用户隔离。
普通 bot 不返回 project_dir_key,行为不变。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-21 19:39:56 +08:00
朱潮
2898c9c42d Merge branch 'feature/tool-error-recovery' into bot_manager 2026-06-20 13:10:29 +08:00
朱潮
06974e9744 feat: recover tool exceptions into ToolMessage so SSE stream keeps flowing
Add ToolErrorRecoveryMiddleware as the outermost agent middleware so any
tool-call exception (notably MCP ToolException) is converted into a
ToolMessage with status="error" carrying the raw error text. The agent
can then loop once more and reply to the user in natural language about
what failed, instead of bubbling the exception up through agent.astream
and breaking the SSE response in routes/chat.py.

The recovery layer extracts the inner `text="..."` payload out of the MCP
TextContent repr when present, falling back to str(error) otherwise. It
deliberately re-raises asyncio.CancelledError so task cancellation still
propagates, and sits *outside* ToolMetricsMiddleware so the existing
status=error metric is still emitted before recovery kicks in.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-20 13:07:19 +08:00
朱潮
6babd6e134 safe print 的base64 字段替换为 [truncated] 2026-06-19 07:51:47 +08:00
朱潮
339144ad80 Merge branch 'feature/multimodal-image-input' into developing 2026-06-19 07:50:08 +08:00
朱潮
69eac00295 safe print 的base64 字段替换为 [truncated] 2026-06-19 07:49:53 +08:00
朱潮
01fb63c955 add EMBEDDING_BASE_URL 2026-06-18 14:56:27 +08:00
朱潮
aabb0ad072 Merge branch 'feature/multimodal-image-input' into developing 2026-06-18 12:54:31 +08:00
朱潮
13bdd9d40a feat: support multimodal image (base64) input in chat API
Normalize OpenAI-style and LangChain standard image blocks into LangChain
standard content blocks so provider block_translators auto-convert for
either OpenAI or Anthropic. Flatten multimodal content to plain text when
persisting history and computing term embeddings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 11:34:57 +08:00
朱潮
f85ddaf127 fix: remove stray sympy import causing startup failure
The unused 'from sympy.printing.cxx import none' was accidentally added
by IDE autocomplete. sympy is not installed in the image, so importing
agent/deep_assistant.py raised ModuleNotFoundError and the API server
crash-looped on startup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:47:52 +08:00
朱潮
d8378fbb70 add no answer tag 2026-06-16 13:19:23 +08:00
朱潮
195bd49236 Merge branch 'developing' into bot_manager 2026-06-13 19:28:37 +08:00
朱潮
73042c57a6 add subagent_context_middleware 2026-06-12 15:56:26 +08:00
朱潮
e2827c6a47 add mainAgentHiddenTools 2026-06-12 11:03:30 +08:00
朱潮
cb649d83ee Merge branch 'developing' into bot_manager
# Conflicts:
#	.features/skill/MEMORY.md
#	poetry.lock
#	requirements.txt
2026-06-08 20:07:30 +08:00
朱潮
66cde77117 Merge branch 'feature/fix_large_results_backend' into dev 2026-06-02 20:57:18 +08:00
朱潮
6bccd89e9a 在 agent/deep_assistant.py 把两个落盘 backend 改为 virtual_mode=True 修复 2026-06-02 20:56:43 +08:00
csh28
ecc2687f7b Add tool call metrics middleware 2026-05-29 11:10:31 +08:00
朱潮
be44c243fd Merge branch 'feature/mcp-ui' into staging 2026-05-28 09:55:30 +08:00
csh28
fb5562f977 fix: align mem0 pgvector config with validation 2026-05-26 10:36:52 +08:00
朱潮
4b50a75a3d Merge branch 'feature/mcp-ui' into bot_manager 2026-05-23 13:53:24 +08:00
csh28
1dd45107af fix: align mem0 pgvector config with validation 2026-05-22 11:28:23 +08:00
csh28
dc2a212f35 Merge branch 'optimize/docker-size-baseline' into dev 2026-05-22 10:59:43 +08:00
csh28
5129fdcc05 fix: import asyncio. 2026-05-22 10:59:34 +08:00
csh28
e38fd17b97 Merge docker embedding dependency optimization 2026-05-21 20:31:44 +08:00
csh28
45cf140472 Optimize catalog-agent image embedding dependencies 2026-05-21 20:30:54 +08:00
朱潮
776acc2373 DaytonaSandbox support shell env 2026-05-21 19:46:22 +08:00
朱潮
eb307cb1de fix requirements 2026-05-15 17:54:42 +08:00
朱潮
5dfe2eba28 feat: add bot_id and model to langfuse metadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 18:14:41 +08:00
朱潮
32508ae9d4 fix: langfuse CallbackHandler API and tarfile dereference parameter
- Update langfuse CallbackHandler to use trace_context instead of removed trace_id/session_id/user_id params
- Pass session_id/user_id via LangChain metadata with langfuse_ prefix
- Move dereference param from TarFile.add() to tarfile.open()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 17:14:37 +08:00
朱潮
0c84beaeb0 add langfuse 2026-05-14 16:45:21 +08:00
朱潮
3f895f8fe4 add langfuse 2026-05-14 12:14:21 +08:00
朱潮
718ec5302e Merge branch 'developing' into bot_manager 2026-05-12 12:44:19 +08:00
csh28
65db950aa8 Merge branch 'feature/agent-final-answer-first-char' into dev 2026-05-11 21:05:53 +08:00
csh28
a9aaa851e9 chore: Add methods tools/call. 2026-05-11 21:05:41 +08:00
csh28
6d9bcc0400 Merge origin/dev into dev 2026-05-11 20:56:47 +08:00
csh28
e4fc0db07d chore: improve agent error logging 2026-05-11 20:29:27 +08:00
朱潮
5b634bc2ab 增加子agent支持 2026-05-11 18:55:25 +08:00
csh28
1f06450402 Propagate trace id through MCP metadata 2026-05-08 18:59:42 +08:00
csh28
951948639e Add agent final answer first char metric 2026-05-08 15:43:48 +08:00
朱潮
f5bb23a2d1 merge 2026-05-07 19:36:27 +08:00
朱潮
425f3c5bb4 chore: replace Chinese comments and log messages with English
Convert all Chinese comments, docstrings, logger/print output,
HTTPException detail messages, and API response messages to English
across the entire codebase. Functional zh/ja localized strings
(e.g. prompt templates, timezone display names, date formats) are
preserved as-is.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 19:45:35 +08:00
朱潮
45a94942b8 异步执行 _execute_post_agent_hooks 2026-04-24 13:07:44 +08:00
朱潮
51fbf01236 update hook_content 2026-04-23 16:46:55 +08:00
朱潮
8446dab1e4 daytona support 2026-04-23 15:09:09 +08:00
朱潮
c9e07898fc daytona support 2026-04-23 11:42:50 +08:00
朱潮
8e35d860a5 merge 2026-04-20 22:42:53 +08:00
朱潮
f13f208900 add ENABLE_SELF_KNOWLEDGE 2026-04-20 19:24:30 +08:00
朱潮
dfc1c003c6 sanitize_model_kwargs 2026-04-20 19:00:15 +08:00