refactor: split server application and execution orchestration#378
Merged
liujuanjuan1984 merged 2 commits intomainfrom Apr 2, 2026
Merged
refactor: split server application and execution orchestration#378liujuanjuan1984 merged 2 commits intomainfrom
liujuanjuan1984 merged 2 commits intomainfrom
Conversation
Collaborator
Author
|
本轮已基于 PR diff 完成自审,结论如下。 代码变动审查
风险与残余观察
PR 标题与描述审查
Issue 关联审查
结论
|
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.
背景
#374,收敛server.application的 app 装配、middleware 与 runtime 资源生命周期边界#375,收敛execution.executor的执行协调与 tool orchestration 边界Server 模块拆分
src/opencode_a2a/server/client_manager.py,迁出A2AClientManagersrc/opencode_a2a/server/middleware.py,集中 auth、agent card cache、request body guard、payload logging 等 HTTP middlewaresrc/opencode_a2a/server/lifespan.py,迁出 runtime lifespan 初始化与清理逻辑src/opencode_a2a/server/application.py收敛为更明确的 composition root,并保留既有常量与导出表面Execution 模块拆分
src/opencode_a2a/execution/coordinator.py,迁出ExecutionCoordinator、PreparedExecution与 session binding context 构造逻辑src/opencode_a2a/execution/tool_orchestration.py,迁出 A2A tool call 探测、执行与 streamed output merge 逻辑src/opencode_a2a/execution/metrics.py,收敛 metric log helpersrc/opencode_a2a/execution/executor.py保留OpencodeAgentExecutor对外适配面,并以薄包装维持历史 helper export / method surfaceCompatibility
execution.executor的历史 helper export 兼容,避免测试面与现有内部调用在本轮拆分中漂移Tests
tests/server/test_a2a_client_manager.py,把 client manager 测试边界对齐到新模块tests/execution/test_opencode_agent_session_binding.py,把直接依赖的 client manager 引用切到新模块./scripts/doctor.sh478 passed,总覆盖率91.39%Issue 关联