Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9f3ae4f
pref(provider):增加强构造器
phantom5099 Apr 4, 2026
53db590
Merge remote-tracking branch 'refs/remotes/upstream/main'
phantom5099 Apr 5, 2026
bc53f8c
feat(context): 增加旧工具结果的读时 Micro Compact
Apr 5, 2026
d12e43d
fix(context): avoid empty spans consuming micro compact budget
Apr 5, 2026
87e9752
pref(provider):去掉了provider为runtime迭代留下的兼容代码
phantom5099 Apr 5, 2026
7b80117
test(provider):补齐测试覆盖率
phantom5099 Apr 5, 2026
04b273c
fix(context): 增加 micro compact 回退开关并收敛工具名常量
Apr 5, 2026
4627929
fix(provider):修复“显式报错”流事件处理导致卡死问题
phantom5099 Apr 5, 2026
b3b0f88
feat(context): 增加旧工具结果的读时 Micro Compact
Apr 5, 2026
dea11dd
fix(context): avoid empty spans consuming micro compact budget
Apr 5, 2026
d1aea90
fix(context): 增加 micro compact 回退开关并收敛工具名常量
Apr 5, 2026
1f87038
Merge branch 'new_Feat-manual' of https://github.com/Yumiue/neo-code …
Apr 5, 2026
104ac2c
feat(security/runtime): add session remember once/always/reject
Cai-Tang-www Apr 5, 2026
b60d0f2
feat(security): complete permission ask loop and policy engine
Cai-Tang-www Apr 5, 2026
bcfcb63
test(runtime,tui): improve permission loop coverage
Cai-Tang-www Apr 5, 2026
d17cd20
fix: 收敛 micro compact 工具策略来源
Apr 6, 2026
19e3b5a
fix(security): enforce deny precedence and tighten webfetch whitelist
Cai-Tang-www Apr 6, 2026
098a263
test: 补充 micro compact 策略回归测试
Apr 6, 2026
c256044
test: 补充 micro compact 边界测试
Apr 6, 2026
ca06d78
fix(permission): harden approval flow and narrow session memory scope
Cai-Tang-www Apr 6, 2026
f59759e
Merge pull request #153 from phantom5099/main
minorcell Apr 6, 2026
ab510d7
feat(provider):增加透明重传以及解决缓冲区溢出问题
phantom5099 Apr 6, 2026
3612e9f
test(provider):补全测试率
phantom5099 Apr 6, 2026
aefa4fa
fix(provider):修复SSE Reader 缓冲区溢出以及重连消息污染风险
phantom5099 Apr 6, 2026
8aadd97
fix(provider):修复重试次数过多以及错误丢失问题
phantom5099 Apr 6, 2026
34063b0
Merge pull request #171 from phantom5099/main
minorcell Apr 6, 2026
6891ac9
Merge pull request #163 from Cai-Tang-www/main
minorcell Apr 6, 2026
6e64ec5
merge: integrate up/main into rebase_manual
Apr 6, 2026
b4202f9
Merge pull request #161 from Yumiue/new_Feat-manual
minorcell Apr 6, 2026
c9a0ec1
docs:删除过期mvp 文件
Apr 6, 2026
eb6b195
Merge pull request #173 from Yumiue/new_Feat-manual
minorcell Apr 6, 2026
daec744
pref(provider):删掉透明重传
phantom5099 Apr 6, 2026
2c45505
refactor(tui): introduce layered state package and boundary docs
creatang Apr 6, 2026
aa7a755
fix(tui/state): remove stray BOM to unblock CI build
creatang Apr 6, 2026
fe0eb64
docs(tui): fix entry path and untrack local SKILL guide
creatang Apr 6, 2026
9b52492
test(runtime): align scriptedProvider callers with stream-based chat
creatang Apr 6, 2026
4cf078d
Merge pull request #174 from phantom5099/main
minorcell Apr 7, 2026
33ee592
Merge pull request #166 from creatang/codex/tui-split-01-state-boundary
minorcell Apr 7, 2026
f40048e
refactor(provider):拆分type和openai
phantom5099 Apr 7, 2026
04ccc2e
refator:拆分出session模块
Apr 7, 2026
ffce7c3
test:补充测试文件
Apr 7, 2026
ae4750a
Merge pull request #185 from phantom5099/main
minorcell Apr 7, 2026
48ba7cf
feat: 新增 MCP Registry 与 Adapter 基础能力
Cai-Tang-www Apr 7, 2026
e6fb96e
feat: 将 MCP 工具接入 Registry 主执行链并增加 stdio 客户端
Cai-Tang-www Apr 7, 2026
7b5db03
feat: 强化 MCP 调用链错误处理与安全边界
Cai-Tang-www Apr 7, 2026
4bc19ab
feat: 补齐 MCP 并发与错误路径回归测试
Cai-Tang-www Apr 7, 2026
76f1b48
feat: 完善 MCP 新能力测试覆盖与边界用例
Cai-Tang-www Apr 7, 2026
8486c26
feat: 提升 #176/#177 差异覆盖率并补充分支测试
Cai-Tang-www Apr 7, 2026
31c61df
feat: 接入配置驱动 MCP 注册并补充使用文档
Cai-Tang-www Apr 7, 2026
a07b88d
feat: 补齐 MCP stdio initialize 握手与重连会话流程
Cai-Tang-www Apr 7, 2026
48530c6
feat: 增强MCP stdio握手兼容并补齐覆盖测试
Cai-Tang-www Apr 7, 2026
5e099a5
test: 补齐MCP接入路径覆盖用例
Cai-Tang-www Apr 7, 2026
e726eb3
fix: 规范registry中的provider引用以修复CI构建异常
Cai-Tang-www Apr 7, 2026
3cf3ea2
chore: 触发CI重跑
Cai-Tang-www Apr 7, 2026
24a6c08
test:添加测试文件
Apr 7, 2026
f1793af
refator:拆分出session模块
Apr 7, 2026
8566796
test:补充测试文件
Apr 7, 2026
360fb57
test:添加测试文件
Apr 7, 2026
704b018
test: 提升MCP与引导流程边界覆盖率
Cai-Tang-www Apr 7, 2026
0b8a829
resolve merge conflicts in runtime and session tests
Apr 7, 2026
48f7da0
fix:修复丢失问题,完全收口
Apr 7, 2026
e3d8984
Merge pull request #181 from Cai-Tang-www/P0-8
minorcell Apr 7, 2026
f56458b
Merge pull request #183 from creatang/codex/tui-split-02-adapters-inf…
minorcell Apr 7, 2026
d765467
Merge pull request #187 from Yumiue/new_Feat-manuale
minorcell Apr 7, 2026
9265d9f
refactor(tui): add core command status and workspace helpers
creatang Apr 6, 2026
ace9a42
fix(tui): remove BOM from runtime bridge and status snapshot
creatang Apr 7, 2026
b044039
test(tui/core): add coverage for status, utils and workspace
creatang Apr 7, 2026
013c29f
fix(tui): reject NUL bytes in ResolveWorkspaceDirectory and improve t…
creatang Apr 7, 2026
9358e43
fix(tui): use agentsession.Session instead of undefined agentruntime.…
creatang Apr 8, 2026
c2fa334
fix(tui): fix test file using undefined agentruntime.Session
creatang Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ go run ./cmd/neocode
- **`internal/provider/catalog`** — 模型发现、catalog 缓存与后台刷新
- **`internal/provider/selection`** — provider/model 选择与配置同步
- **`internal/provider/builtin`** — 内建 driver 注册
- **`internal/runtime`** — ReAct 主循环、事件流、会话管理
- **`internal/runtime`** — ReAct 主循环与事件流编排(不直接承载会话存储实现;不再导出会话模型与存储类型)
- **`internal/session`** — 会话模型、会话存储抽象与 JSON 持久化实现(统一对外暴露 `Session` / `Summary` / `Store`)
- **`internal/tools`** — 工具注册表与具体工具实现
- **`internal/tui`** — 终端 UI、交互体验、事件桥接
- **`internal/app`** — 应用装配与依赖注入
Expand All @@ -116,6 +117,7 @@ go run ./cmd/neocode
│ │ ├── catalog # 模型发现与缓存
│ │ └── selection # provider/model 选择服务
│ ├── runtime # ReAct 循环与事件流
│ ├── session # 会话模型与持久化
│ ├── tools # 工具系统
│ └── tui # 终端 UI
└── README.md
Expand Down
6 changes: 6 additions & 0 deletions docs/context-compact.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ context:
manual_strategy: keep_recent
manual_keep_recent_messages: 10
max_summary_chars: 1200
micro_compact_disabled: false
```

- `manual_strategy`
Expand All @@ -27,6 +28,11 @@ context:
在 `keep_recent` 模式下保留最近消息数量,并按 tool call 与 tool result 的原子块整体保留。
- `max_summary_chars`
控制 compact summary 的最大字符数。
- `micro_compact_disabled`
控制是否关闭默认启用的读时 micro compact;设为 `true` 时会回退为仅 trim、不清理旧 tool result。

新增工具时,micro compact 策略不再由 `context` 层静态白名单维护,而是由 `internal/tools` 中的工具实现声明。
默认情况下,已注册工具都会参与 micro compact;只有显式声明保留历史结果的工具才会跳过旧结果清理。

## 执行链路

Expand Down
4 changes: 4 additions & 0 deletions docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ context:
manual_strategy: keep_recent
manual_keep_recent_messages: 10
max_summary_chars: 1200
micro_compact_disabled: false
```

### 字段说明
Expand All @@ -324,5 +325,8 @@ context:
| `context.compact.manual_strategy` | string | `keep_recent` | 手动 `/compact` 策略,可选 `keep_recent` / `full_replace` |
| `context.compact.manual_keep_recent_messages` | int | `10` | `keep_recent` 模式下保留最近 N 条消息;会按 tool call 与 tool result 的原子块整体保留 |
| `context.compact.max_summary_chars` | int | `1200` | compact summary 最大字符数 |
| `context.compact.micro_compact_disabled` | bool | `false` | 是否关闭默认启用的读时 micro compact;设为 `true` 可快速回退到仅 trim、不做旧工具结果清理 |

新增工具默认会参与 micro compact;如果某个工具的历史结果必须保留,需要在 `internal/tools` 的工具实现中显式声明保留策略。

更多行为说明见 [context-compact.md](../context-compact.md)。
62 changes: 62 additions & 0 deletions docs/guides/mcp-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# MCP 配置指南(stdio)

本文档说明如何在 NeoCode 中通过配置注册 MCP server,并验证 `mcp.<server>.<tool>` 能力是否可用。

## 配置位置

在 `~/.neocode/config.yaml` 中添加 `tools.mcp.servers`:

```yaml
tools:
mcp:
servers:
- id: docs
enabled: true
source: stdio
version: v1
stdio:
command: node
args:
- ./mcp-server.js
workdir: ./mcp
start_timeout_sec: 8
call_timeout_sec: 20
restart_backoff_sec: 1
env:
- name: MCP_TOKEN
value_env: MCP_TOKEN
```

## 字段说明

- `id`:server 稳定标识,用于工具命名空间(`mcp.<id>.<tool>`)。
- `enabled`:是否启用该 server;仅 `true` 的 server 会在启动时注册。
- `source`:传输类型,当前仅支持 `stdio`。
- `version`:可选版本字段,用于可观测和后续策略命中。
- `stdio.command`:启动命令(必填,启用时)。
- `stdio.args`:启动参数列表。
- `stdio.workdir`:子进程工作目录,支持相对路径(相对主 `workdir` 解析)。
- `stdio.start_timeout_sec` / `call_timeout_sec` / `restart_backoff_sec`:可选秒级超时与重试参数。
- `env`:传给 MCP 子进程的环境变量列表。
- 每项必须配置 `value` 或 `value_env` 其中之一。
- 推荐使用 `value_env` 引用系统环境变量,避免在 YAML 中写明文敏感信息。

## 启动行为

- 启动阶段会注册所有 `enabled: true` 的 server。
- 注册后会执行一次 `tools/list` 初始化工具快照。
- 若启用的 server 注册失败,启动会报错并中止(fail-fast)。

## 功能测试建议

1. 启动应用后让 Agent 列出工具:
- `请先列出你当前可用工具的完整名称。`
2. 检查是否存在 `mcp.docs.<tool>`。
3. 发起一次明确调用:
- `请调用 mcp.docs.search,参数 {\"query\":\"hello\"},并返回工具结果。`

若返回 `tool not found`,优先检查:
- `enabled` 是否为 `true`;
- `stdio.command` 是否可执行;
- `env.value_env` 对应环境变量是否存在;
- MCP server 是否支持 `tools/list`。
Loading
Loading