WeKnora/internal/handler
wizardchen 738fe1ec53 feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断
沙箱的后端类型、凭据、模板、超时和私网访问策略此前分散在部署级
WEKNORA_SANDBOX_* 环境变量里,一个实例只能有一套,租户之间无法各用
自己的 E2B 账号或自建 Cube 集群。现在这些配置全部落到空间维度的具名
沙箱配置上:部署环境不再提供覆盖项,未选择配置的智能体直接不启用脚本
执行,而不是静默回落到某个部署默认值——后者会让「这个智能体到底跑在
哪」无从判断。

同时把连接检测从「能不能连上控制面」扩展成可解释的诊断:
- E2B 标准模板显式带上 default 标签构建。创建沙箱时裸模板名/ID 只解析
  default 标签,构建带了别的标签就永远拿不到,表现为一个与「模板不存在」
  无法区分的 404。
- 模板状态不再从历史构建或 spawn 次数反推就绪,只认当前构建;构建完成
  却没有 default 标签的模板单独报成 untagged,因为它在列表里和「仍在构建」
  长得一样,但等待永远不会有结果。
- 创建失败带上 HTTP 状态,404 走模板解释路径,给出具体到「重建模板」还是
  「Key 属于其他团队」的结论。
- 探针脚本改在进程工作目录下暂存。系统临时目录在 macOS 上位于
  /var/folders,Docker 虚拟机并不共享,挂载进容器后是空目录,真实技能执行
  (脚本在 skills/ 下)却不会踩到,检测因此报假失败。
- 检测失败不再只说「命令输出与预期不符」,带上退出码与 stderr 首行。

前端把沙箱设置页与配置抽屉重做:凭据按「是否已配置」展示而非回显掩码,
删除与停用改为就地确认,占用情况走右侧抽屉,列表卡片展示模板状态、凭据、
超时等可判断健康度的事实。
2026-08-11 15:42:02 +08:00
..
dto feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
session feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
audit_log.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
audit_log_test.go feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
auth.go feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login 2026-08-11 15:41:48 +08:00
auth_change_password_test.go fix(auth): harden self-service change password after #2591 2026-08-07 15:49:58 +08:00
auth_oidc_start_test.go feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login 2026-08-11 15:41:48 +08:00
auth_register_by_invite.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
auth_register_by_invite_tenant_test.go feat(auth): support tenantless provisioning and gated self-service workspace creation 2026-07-13 18:13:51 +08:00
auth_register_invite_only_test.go fix(auth): do not sanitize registration password before hashing 2026-08-07 10:58:41 +08:00
chunk.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
chunker_debug.go fix(chunking): normalize line endings before splitting / 在分块前统一换行符 2026-08-05 19:24:45 +08:00
chunker_debug_test.go fix(chunking): normalize line endings before splitting / 在分块前统一换行符 2026-08-05 19:24:45 +08:00
custom_agent.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
custom_agent_api_key_scope_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
custom_agent_sandbox_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
datasource.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
datasource_credentials.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
datasource_test.go Validate sync log limit parameter 2026-06-12 22:52:25 +08:00
embed_channel.go fix(api): close the resource_urls=public gaps found in review 2026-08-05 14:42:51 +08:00
embed_channel_exchange_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_flow_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_resource_urls_test.go fix(api): close the resource_urls=public gaps found in review 2026-08-05 14:42:51 +08:00
embed_session_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
evaluation.go feat: 新增API Key认证支持,优化Swagger文档安全配置 2025-12-22 15:01:09 +08:00
faq.go feat(knowledge): enhance FAQ entry filtering and tagging 2026-07-23 10:50:32 +08:00
im.go fix(im): persist session mode configuration 2026-08-10 17:09:35 +08:00
im_platform_test.go feat(im,datasource): support Lark, Feishu's international edition 2026-07-17 11:05:54 +08:00
initialization.go feat: support Volcengine rerank 2026-07-20 19:58:48 +08:00
initialization_config_redaction_test.go fix(security): close init config and parser-check redaction gaps 2026-07-02 14:41:42 +08:00
knowledge.go fix(knowledge): sync folder APIs and address review follow-ups 2026-08-04 20:45:29 +08:00
knowledge_api_key_scope_test.go fix(api-keys): close KB scope gaps in handlers and CloneContext 2026-07-07 12:00:13 +08:00
knowledge_folder_test.go feat(knowledge): store folder path for folder uploads and expose folder tree API 2026-08-04 20:45:29 +08:00
knowledge_move_gate_test.go fix: reject cross-store reuse_vectors knowledge move 2026-06-05 15:00:41 +08:00
knowledge_preview_security_test.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
knowledge_spans_test.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
knowledge_tag_ids_test.go fix(knowledge): harden multi-tag data integrity and UX follow-ups 2026-06-26 10:52:52 +08:00
knowledgebase.go fix: harden shared agent source selector validation 2026-07-30 12:28:23 +08:00
knowledgebase_copy_preflight_test.go Simplify KB duplicate API and improve naming/docs coverage. 2026-07-08 20:55:54 +08:00
knowledgebase_hybrid_search_test.go fix(search): validate hybrid search query text 2026-07-23 12:05:57 +08:00
knowledgebase_not_found_test.go fix(kb): map ErrKnowledgeBaseNotFound to 404 across handler helpers 2026-05-14 20:12:41 +08:00
knowledgebase_pr3_response_test.go feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
knowledgebase_pr5_list_test.go feat: expose KB ↔ vector store binding in list, editor, and detail UI 2026-05-22 17:40:10 +08:00
knowledgebase_request_test.go feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
list_pagination.go feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
mcp_credentials.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
mcp_oauth.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
mcp_service.go fix(mcp): preserve omitted service update fields 2026-08-10 19:14:21 +08:00
message.go fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
message_resource_urls_test.go fix(api): close the resource_urls=public gaps found in review 2026-08-05 14:42:51 +08:00
message_session_not_found_test.go fix(chat): stabilize history pagination and keep message order 2026-05-20 21:03:39 +08:00
message_suggestion.go fix(sessions): 放行 embed 运行时读取自身会话,修复追问建议 500 与刷新丢对话 2026-07-30 17:51:34 +08:00
message_suggestion_test.go fix(sessions): 放行 embed 运行时读取自身会话,修复追问建议 500 与刷新丢对话 2026-07-30 17:51:34 +08:00
model.go fix(models): align model debug upload limit with global MAX_FILE_SIZE 2026-07-23 19:43:06 +08:00
model_credentials.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
model_test.go feat(models): add model test debugger for saved model configs 2026-06-25 17:05:33 +08:00
organization.go fix(org): disambiguate shared-space terms and tighten invite search 2026-07-24 11:42:27 +08:00
rbac_lookups.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
rbac_lookups_test.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
sandbox_check.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
sandbox_check_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
sandbox_config.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
sandbox_config_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
skill_handler.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
storage_allowlist.go fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storagebackend.go feat(storage): add storage backend management API and UI enhancements 2026-07-15 14:54:39 +08:00
system.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
system_admin_audit_test.go test(system): cover system.* audit constants + emitAdminAudit contract 2026-05-26 21:13:56 +08:00
system_parser_check_test.go fix(security): close init config and parser-check redaction gaps 2026-07-02 14:41:42 +08:00
system_password_reset_test.go feat(system): add admin password reset with session revocation 2026-07-13 20:11:00 +08:00
system_runtime_test.go feat(runtime): add bulk purge for archived queue tasks and chat_attachment i18n 2026-07-23 16:52:35 +08:00
system_storage_engine_test.go feat(storage): improve storage connectivity error handling and multi-instance support 2026-07-15 14:54:39 +08:00
system_storage_ssrf_test.go fix(security): close remaining GHSA gaps from security triage 2026-07-02 15:03:53 +08:00
tag.go refactor(rbac): KB-access guard at the route layer (no helper in handlers) 2026-05-18 17:28:58 +08:00
task_progress_auth.go fix(security): enforce KB access on wiki reads and related IDOR paths 2026-07-02 12:06:22 +08:00
task_progress_auth_test.go fix(security): enforce KB access on wiki reads and related IDOR paths 2026-07-02 12:06:22 +08:00
tenant.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
tenant_api_key_validation_test.go test(api-keys): add unit tests for tenant API key validation 2026-07-07 12:00:13 +08:00
tenant_invitation.go fix(invitation): harden auto-accept follow-ups from code review 2026-08-10 15:47:29 +08:00
tenant_invitation_accept_by_token_test.go feat: 邀请链接在 invite_only 模式下改为登录后加入空间 2026-08-10 14:57:38 +08:00
tenant_invitation_auto_accept_test.go fix(invitation): harden auto-accept follow-ups from code review 2026-08-10 15:47:29 +08:00
tenant_invite_link.go fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
tenant_member.go fix(invitation): harden auto-accept follow-ups from code review 2026-08-10 15:47:29 +08:00
tenant_member_test.go feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
tenant_parser_ssrf_test.go fix(security): redact IM list credentials and harden MinerU SSRF 2026-07-02 17:58:20 +08:00
tenant_policy.go feat(auth): support tenantless provisioning and gated self-service workspace creation 2026-07-13 18:13:51 +08:00
tenant_secret_disclosure_test.go refactor(api-keys): remove API key reset endpoint and update documentation 2026-07-07 12:00:13 +08:00
tenant_self_service_policy_test.go feat(auth): support tenantless provisioning and gated self-service workspace creation 2026-07-13 18:13:51 +08:00
user_resource_favorite.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
vectorstore.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
web_search.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
web_search_provider.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
web_search_provider_credentials.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
wechat_qrcode.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
weknoracloud.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
wiki_page.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00