Repository navigation
feat: add workspace model settings - #1443
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
工作空间新增仅系统管理员可配置的模型管理,保留系统默认模型共享行为,同时支持指定已授权模型或暂停该空间的全部模型调用。页面问数、小助手和 MCP 使用同一套空间策略;小助手默认模型动态跟随空间配置。
Refs #1428
Evidence
7bbcc89c没有空间模型策略;默认调用使用系统默认模型,助手/MCP 的无效指定可静默回退。After: 在提交
4d609c0b验证页面、助手及 MCP 的继承、授权拒绝、空值禁用、失效引用、后续操作和整批影响处理。uv run --no-sync pytest -q tests/test_workspace_model_policy.py tests/test_assistant_welcome_defaults.py tests/test_embedded_auth_bypass_fix.py tests/test_supplier_config.py tests/test_execution_error_details.py,105 passed。使用真实路由、权限装饰器、SQLite 和本地模拟模型端点;隔离身份、无关会话构造及 SQL 任务执行。PLAYWRIGHT_BASE_URL=<local-frontend> npm --prefix tests/browser test -- --project=workspace-model,5 passed。真实产品路由与组件,受控 API/xpack 身份适配器;覆盖保存、取消、刷新、失效模型、删除模型及单项/批量撤销授权。npm run build、改动前端文件 ESLint、新增后端文件 Ruff 检查通过;现有后端文件相对基线无新增 Ruff 问题;新增翻译键五种语言一致。未执行真实 PostgreSQL 迁移、真实供应商、完整登录/SQL 问数链路或镜像部署验收。
Merge Danger
Door: two-way
迁移新增两列并提供 downgrade;回退前需记录空间策略,downgrade 会丢失新增配置。恢复旧版本也会恢复原有默认模型共享与回退语义。
Blast Radius: 问数
影响页面、小助手、页面嵌入、MCP 及推荐问题、分析、预测、重新生成的选型。历史空间默认行为保持兼容;显式指定未授权或失效模型将改为明确拒绝。部署需应用迁移 073。