WeKnora/internal/router
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
..
files.go feat(files): add message-scoped proxy for shared-agent chat images 2026-08-07 18:10:16 +08:00
rbac.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
rbac_selfcheck_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
router_api_key_capabilities_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
router_api_key_management_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router_files_test.go feat(files): add message-scoped proxy for shared-agent chat images 2026-08-07 18:10:16 +08:00
router_knowledge_download_test.go fix(knowledge): restrict source file download to Editor and above 2026-07-23 22:19:39 +08:00
router_presigned_test.go refactor(api-keys): remove API key reset endpoint and update documentation 2026-07-07 12:00:13 +08:00
router_static_test.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
router_wiki_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
routes_agent.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
routes_auth_tenant.go feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login 2026-08-11 15:41:48 +08:00
routes_chat.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
routes_infra.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
routes_knowledge.go feat(knowledge): browse folders like a file manager and allow re-filing 2026-08-04 20:45:29 +08:00
static.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
sync_task.go feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
sync_task_retry_test.go fix: retry document summaries before fallback 2026-08-05 19:29:32 +08:00
task.go feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
task_inspector.go feat(runtime): add bulk purge for archived queue tasks and chat_attachment i18n 2026-07-23 16:52:35 +08:00
task_inspector_errors.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_errors_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_kb_cancel_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
task_inspector_runtime_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00