refactor(app):优化 App 层装配逻辑、消除过度设计并修复子进程残留#264
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
需要补全测试覆盖率 |
Collaborator
Author
|
/simplify |
Contributor
|
已按你的要求完成:先处理历史未解决 review 项,再做简化复查,并已提交推送到当前 PR 分支。 处理结果
验证
|
- ensure BuildRuntime cleans MCP resources on tool-manager init failure - ensure NewProgram closes runtime bundle when TUI init fails - restore GenerateText error on unexpected stream events - add regression tests for cleanup and stream-event handling Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
Collaborator
Author
|
/review -codex |
Collaborator
Author
|
/simplify |
Contributor
处理结果已按触发指令完成:先检查历史未解决 review 项并修复,再做简化复查,最后提交推送。
未完成项:无。 |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
Collaborator
Author
|
/code -codex 给我提升测试覆盖率直到100% |
Contributor
结果已按你的要求补测试并推送到当前 PR 分支,覆盖了这轮改动里未覆盖的关键分支。 本次新增测试点:
验证
说明:仓库整体 提交与推送
|
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
…99/neo-code into fork-pr-264-1776091287
fix(review): preserve cleanup semantics and error contracts
Collaborator
Author
|
/review -codex |
Collaborator
Author
|
/simplify |
Contributor
完成结果已按触发指令完成:先处理历史未解决 review 项,再进行 code-simplifier 复查,并已提交推送。 本次改动
验证
提交与推送
未完成项:无。 |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
test(app): close unresolved review follow-ups
Collaborator
|
/review |
| // defaultRootProgramLauncher 负责在默认根命令路径下启动 TUI。 | ||
| func defaultRootProgramLauncher(ctx context.Context, opts app.BootstrapOptions) error { | ||
| program, err := newRootProgram(ctx, opts) | ||
| func defaultRootProgramLauncher(ctx context.Context, opts app.BootstrapOptions) (err error) { |
Contributor
There was a problem hiding this comment.
已重点审阅 defaultRootProgramLauncher 的运行错误与清理错误合并路径(errors.Join),语义与测试覆盖匹配,未发现问题。
Closed
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 主要聚焦于
internal/app层及相关核心模块的代码重构与生命周期管理优化。通过向上透传清理钩子解决了 MCP 僵尸子进程残留的问题,提取了纯函数以简化大模型文本生成逻辑,并极其严格地审查了项目结构,清除了“过度设计”的碎片化胶水文件,使管线装配回归极简。主要改动
app.RuntimeBundle结构,透传了Close func() error方法。在internal/tools/mcp/registry.go中新增资源释放的Close方法,并由internal/cli/root.go顶层进行defer捕获调用。internal/provider/generate.go,将冗长的流式转非流式拼接逻辑封装在独立的GenerateText纯函数中,彻底消除样板代码。internal/app/memo_adapter.go及其配套的测试文件。runtimeMemoExtractorFunc和textGenAdapter)以闭包类型的形式直接内联回internal/app/bootstrap.go。internal/app/bootstrap_test.go中,消除测试碎片。预期收益
bootstrap.go时即可一览无遗地理解全部装配逻辑。