feat: rebuild NeoCode MVP around runtime-centric architecture#68
Closed
wynxing wants to merge 9 commits into
Closed
feat: rebuild NeoCode MVP around runtime-centric architecture#68wynxing wants to merge 9 commits into
wynxing wants to merge 9 commits into
Conversation
minorcell
reviewed
Mar 26, 2026
minorcell
reviewed
Mar 27, 2026
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- 让 tools.Registry 只负责注册、schema 暴露和查找 - 新增 tools.Executor,统一工具执行结果与错误包装 - runtime 显式注入 tool catalog 和 tool executor - 将 tui 视图按 theme、panel、root、conversation、runtime 拆分文件 - 补充工具执行归一化、tool error 流程和 tui 渲染 smoke 测试 - 同步 README 和架构文档中的职责说明
- 新增 fs_edit_file,支持对已有文本文件做精确片段替换 - 限制编辑路径必须位于 workdir 内,并校验目标文件存在且不是目录 - 要求 old_text 恰好命中一次,避免误改或歧义编辑 - 使用临时文件替换方式写回,降低半写入风险 - 注册 fs_edit_file 到 builtin tools,并补充 prompt 中的工具使用提示 - 更新 README 与架构文档中的 filesystem 工具说明 - 补充 filesystem、bootstrap、prompt builder 相关测试
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 将当前实现重构为面向
NeoCode Coding Agent MVP的最小可用架构,聚焦跑通以下主链路:用户输入 -> Agent 推理 -> 调用工具 -> 获取结果 -> 继续推理 -> UI 展示重构目标是统一边界、收敛职责,并为后续扩展 provider、tools 和会话能力打下稳定基础。
涉及模块
configproviderruntimetoolstuiapp/bootstrap主要变更
1. 重建 MVP 项目结构
按新的目标结构重组代码,核心目录调整为:
cmd/neocodeinternal/appinternal/configinternal/providerinternal/runtimeinternal/toolsinternal/tuidocs2. 以 Runtime 为唯一编排中心
新架构下由
runtime统一负责:避免了 TUI、provider、tools 之间的跨层直连。
3. 收敛 Provider / Tools / TUI 职责
provider仅负责模型协议适配、请求响应转换和流式/错误处理tools提供统一的schema + execute + result抽象tui只负责交互与渲染,改为消费 runtime 事件,不再直接承担模型调用或工具执行4. 实现 MVP 主链路闭环
当前版本已具备以下能力:
5. 补充测试与文档
补充并更新了与新架构对应的:
是否影响主链路
是。
这是一次围绕 MVP 的架构级重建,直接调整了
TUI / Runtime / Provider / Tools / Config的职责分工,并替换了旧的实现组织方式。是否影响配置
是。
配置模型和启动校验逻辑已按新架构重建,请以上游评审结果为准确认是否还需要补充迁移说明。
已运行测试
go test ./... go build ./...