Commit Graph

219 Commits

Author SHA1 Message Date
朱潮
148ebc5904 优化agent v3接口 2026-06-22 16:39:04 +08:00
朱潮
41b2c898ec fix: 通用智能体工作目录按用户隔离
projects/robot/general-agent 所有用户共享会导致文件/会话产物互串。
get_general_agent_runtime_config 生成 project_dir_key=general-agent-{user},
v3 chat 优先用它作为 create_project_directory 的目录标识。
普通 bot 不返回 project_dir_key,行为不变。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-21 18:29:09 +08:00
朱潮
f4f39e4356 fix: 通用智能体注入当前登录用户的 api_key
通用智能体没有 owner,配置文件默认也不写 api_key。
复用普通 bot 的 owner token 逻辑:按 user_identifier 查 agent_user.new_api_token。
若配置文件里显式配置了 api_key,则优先用配置的。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-21 17:17:29 +08:00
朱潮
f57949520f feat: 新增配置文件驱动的通用智能体
- 新增 config/general_agent.json 与 utils/general_agent_config.py
- 登录返回的单智能体改为读取配置文件,不再复制 bot/skills
- 新增 GET /api/v1/general-agent/settings 接口
- v3 chat 在 bot_id=general-agent 时从配置文件读取运行时配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-21 17:01:33 +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
朱潮
9bd40d9bd7 Merge branch 'feature/no_answer' into dev 2026-06-16 13:22:12 +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
csh28
f42a9e484a Remove heavy embedding dependencies 2026-06-09 08:56:31 +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
朱潮
77079539c1 refactor: remove file-parsing knowledge-base pipeline and Huey queue
The local file-parsing pipeline (upload -> Huey async parse -> generate
projects/data/.../document.txt) is no longer needed: RAG retrieval runs
against the backend vector store and does not read the local parse output,
so removing this has zero impact on existing bot Q&A.

- Delete task_queue/ (Huey queue, consumer, tasks, task status store)
- Delete parsing utils: dataset_manager, single_file_processor,
  data_merger, project_manager
- Delete db_manager.py (only managed task_status.db)
- routes/files.py: keep only POST /api/v1/upload; drop all
  parse/queue/task endpoints
- routes/projects.py: drop /tasks endpoint and task_status import
- utils/__init__.py & api_models.py: remove exports/models for deleted
  modules and queue task models
- start_unified.py & start_all_optimized.sh: no longer launch the
  queue consumer
- Drop huey dependency (keep redis)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 19:40:58 +08:00
朱潮
e6b28818bf add REDIS_URL 2026-06-08 19:00:55 +08:00
朱潮
1fc105a732 透传接口现在支持视觉图片识别 2026-06-07 11:02:10 +08:00
朱潮
be44c243fd Merge branch 'feature/mcp-ui' into staging 2026-05-28 09:55:30 +08:00
csh28
45cf140472 Optimize catalog-agent image embedding dependencies 2026-05-21 20:30:54 +08:00
朱潮
3809536746 refactor: replace mcp_resources API with direct /robots/ static file access
- Remove routes/mcp_resources.py (ui:// URI resolver endpoint)
- Frontend now directly accesses /robots/{bot_id}/skills/{server}/apps/{resource}.html
- Add Daytona fallback middleware to fetch files from sandbox on 404
- Add utils/daytona_file_fetcher.py for on-demand single file download
- Resolve merge conflict: keep voice, knowledge_base routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 19:21:40 +08:00
朱潮
b4f8bb2935 refactor: replace mcp_resources API with direct /robots/ static file access
- Remove routes/mcp_resources.py (ui:// URI resolver endpoint)
- Frontend now directly accesses /robots/{bot_id}/skills/{server}/apps/{resource}.html
- Add Daytona fallback middleware to fetch files from sandbox on 404
- Add utils/daytona_file_fetcher.py for on-demand single file download

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 18:58:58 +08:00
朱潮
eb307cb1de fix requirements 2026-05-15 17:54:42 +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
朱潮
3f895f8fe4 add langfuse 2026-05-14 12:14:21 +08:00
朱潮
a8f643a10c fix: use POST /api/token/{id}/key to get full unmasked key for new NewAPI v0.13.2
New version of NewAPI masks token keys with asterisks in list/detail endpoints.
Added get_token_key() method that calls the dedicated endpoint to retrieve
the full key, and integrated it into get_or_create_token() flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 12:49:38 +08:00
朱潮
718ec5302e Merge branch 'developing' into bot_manager 2026-05-12 12:44:19 +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
朱潮
3c0fa498b5 🐛 fix(sync): sync dataset symlinks to Daytona sandbox
The incremental sync used `find -type f` which misses symlinks (type l),
so dataset symlinks were never detected and synced to the sandbox.
Additionally, `tar.add()` without `dereference=True` would store broken
symlinks pointing to host-only paths.

- _list_local_changed_files: match both regular files and symlinks
- _tar_workspace_entries: dereference symlinks to pack actual content
- Unify dataset path to `datasets/` (plural) in prompts and SKILL.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-06 19:37:00 +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
朱潮
d554317db6 触发更新 2026-04-25 09:08:45 +08:00
朱潮
c93df5400e modify DAYTONA_SERVER_URL 2026-04-24 19:54:45 +08:00
朱潮
45a94942b8 异步执行 _execute_post_agent_hooks 2026-04-24 13:07:44 +08:00
朱潮
ac32ef8d0b update utils/daytona_sync.py 2026-04-23 16:38:44 +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
朱潮
7c72a52bb7 SKILLS_SUBDIR改成PROJECT_NAME 2026-04-19 09:47:49 +08:00
朱潮
0addc55fa2 SKILLS_SUBDIR改成PROJECT_NAME 2026-04-19 09:45:09 +08:00
朱潮
5b109d5c27 修改skill目录 2026-04-19 09:21:14 +08:00
朱潮
fd7d838e09 修改skill目录 2026-04-19 00:28:14 +08:00
朱潮
990f50ed55 修改skill目录 2026-04-18 23:58:30 +08:00
朱潮
2911c67771 修改skill目录 2026-04-18 23:39:47 +08:00
朱潮
0adfbad600 修改skill目录 2026-04-18 23:36:32 +08:00
朱潮
db783a7c3d 修改skill目录 2026-04-18 23:19:46 +08:00
朱潮
2fa779e61e disable for autoload 2026-04-18 23:08:28 +08:00
朱潮
90229ffeaf 优化skill覆盖逻辑 2026-04-17 11:43:20 +08:00
朱潮
9d47324a76 add rag_retrieve-only 2026-04-16 20:09:02 +08:00
朱潮
e1bf685314 add rag_retrieve autoload 2026-04-16 19:38:13 +08:00
朱潮
8c49997ed6 dataset to datsets 2026-04-15 11:09:55 +08:00