feat(agent): 完成 DeepAgents 0.7 迁移与全仓依赖安全升级 - #971
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.
变更说明
本 PR 完成 xhome #39 所对应的 DeepAgents 0.7 迁移,并对全仓依赖执行分批升级与安全验证。
architectureCustomCompositeBackend,改用官方CompositeBackend。FilesystemMiddleware中显式限定工具 allowlist,排除未实现且缺少审批设计的delete。ProvisionerSandboxBackend.read()的结构化分页字段与grep()的max_count/truncated传播。SummarizationMiddleware0.7 签名与 session/media offload 机制。create_deep_agent(保留 Yuxi 自定义 AgentRun、审批、Steer、Skills 链路)。substantial(涉及 agent backend/middleware 装配重构、核心依赖升级与决策记录)。工程主张与 Owner
get_graph(context)时构造,并由FilesystemMiddleware与SummarizationMiddleware共用同一实例,artifacts_root派生 outputs 前缀。delete;open_kb_document豁免于 tool result eviction。uv audit --locked保持 0 漏洞。backend/package/yuxi/agents/backends/composite.py:负责每 Run backend 构造与 FilesystemMiddleware 工具 allowlist。backend/package/yuxi/agents/backends/sandbox/backend.py:负责 read 分页 metadata 与 grep max_count 截断。backend/package/yuxi/agents/middlewares/summary.py:负责上下文压缩与摘要会话隔离。docs/develop-guides/decisions/implemented/2026-08-23-deepagents-07-migration.md验证情况
DeepAgents 0.7+ 正确装配并保持隔离
yuxi.agents.backends.compositedocker compose exec api uv run --no-sync --group test pytest test/unit/backends/test_sandbox_backends.py -q上下文压缩与摘要正确派生 outputs 前缀
yuxi.agents.middlewares.summarydocker compose exec api uv run --no-sync --group test pytest test/unit/middlewares/test_summary_middleware.py -q后端全量 Unit 测试通过
docker compose exec api uv run --no-sync --group test pytest test/unit -m "not slow" -q工程信任契约与依赖安全审计
python3 scripts/verify_engineering_contracts.py+python3 -m unittest scripts.test_verify_engineering_contracts+cd backend && uv audit --locked+cd packages/yuxi-cli && uv audit --lockedWeb 前端构建与测试
web/cd web && pnpm run build && pnpm run test:unit && pnpm run lintyuxi-cli 构建与测试
packages/yuxi-cli/cd packages/yuxi-cli && uv run --isolated --no-dev --with pytest pytest tests -q简化 / 删除验收
CustomCompositeBackend,由官方CompositeBackend代替(0.7 已包含路由修复与truncated支持)。_SUMMARY_BACKENDContextVar,直接使用中间件实例的self._backend。_count_request_tokens,委托给父类_count_tokens。create_summary_middleware的手动 prefix 赋值,由artifacts_root自动派生。CustomCompositeBackend全仓 0 引用;搜索_SUMMARY_BACKEND0 引用。CompositeBackend在未来版本再次引入 route-aware glob 倒退且上游未修复时。独立语义 Review
已通过全量 unit 回归、契约检查与依赖审计核实;涉及装配重构、沙盒后端、摘要中间件、前端构建与 CLI 测试均全部通过。
未验证范围与风险
事故反馈
不涉及。
界面变更
不涉及。
关联事项
[08-19]DeepAgents 0.7 的迁移和调研补充说明
deepagents 0.7.7,pyproject.toml 声明deepagents>=0.7.7,<0.8以确保国内镜像与 Docker 构建稳定性。