feat(gateway): 新增 deleteSession/renameSession/listFiles/listModels 等核心能力#537
Merged
pionxe merged 8 commits into1024XEngineer:mainfrom May 1, 2026
Merged
Conversation
- 扩展 gateway 协议帧处理:新增 deleteSession、renameSession、listFiles、 listModels、setSessionModel、getSessionModel 等 handler - 新增 FileEntry、ModelEntry、SessionModelResult 等契约类型 - 强化安全校验与认证逻辑(本地模式支持、空 token 拦截) - 补齐 gateway 核心模块的单元测试覆盖 - app/bootstrap 补充 SessionStore 字段,支撑 gateway runtime bridge 的会话管理能力 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gateway_runtime_bridge 适配新增的 DeleteSession、RenameSession、 ListFiles、ListModels、SetSessionModel、GetSessionModel 等 RuntimePort 方法 - 桥接层引入 bridgeSessionStore / bridgeSessionLoader 接口,解耦对具体存储实现 - 补齐 gateway_runtime_bridge_test.go 与 root_test.go 中 stubRuntimePort 的新接口实现 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 扩展 gateway-rpc-api.md,补充 deleteSession、renameSession、listFiles、 listModels、setSessionModel、getSessionModel 等接口定义与示例 - 更新 gateway-compatibility.md 兼容性说明 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- rpc_dispatch_test: runtimePortOnlyStub 补充 CreateSession 方法, 适配 RuntimePort 接口新增的方法签名 - gateway_runtime_bridge_test: 修复 3 处 newGatewayRuntimePortBridge 调用, 补充 bridgeSessionStore 参数;为 runtimeStub 补充 DeleteSession / UpdateSessionState Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
- dispatcher_integration_unix_test: urlschemeIntegrationRuntimeStub 补充 DeleteSession、RenameSession、ListFiles、ListModels、SetSessionModel、 GetSessionModel 方法,适配 RuntimePort 接口扩展 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
test(cli): 补齐 gateway_commands 日志级别与工作目录测试 - gateway-compatibility.md Stable Core 补充 deleteSession、renameSession、 listFiles、listModels、setSessionModel、getSessionModel - gateway_commands_test.go 新增 normalizeGatewayLogLevel 与 mustReadInheritedWorkdir 测试 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- bootstrap_test: 新增 6 个新 handler 错误路径测试、8 个 management port handler 错误路径测试、3 个 payload decode 分支测试、认证分支测试、 错误码映射测试 - validate_test: 新增新 action 校验规则测试、InputParts 测试、decode 错误测试、model/mcp 转换测试、frame action 有效性测试 - jsonrpc_test: 新增 12 个新 RPC 方法的 missing/invalid params 错误测试、 可选参数方法测试 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test(gateway): 补齐 gateway_runtime_bridge 错误路径与分支覆盖 - 将 configManager 和 providerSelection 字段改为接口类型 (configManagerPort / providerSelectorPort),使测试可注入 mock - 新增 DeleteSession、RenameSession、ListFiles、ListModels、 SetSessionModel、GetSessionModel 错误路径测试 - 新增 Provider/MCP 管理错误路径测试 - 新增 resolveListFilesRoot、resolveProviderModelForSession、 modelDisplayName 分支测试 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 从 #520 中提取 Gateway 后端核心改动,排除前端 web 文件,便于独立评审与合入。
变更内容
1. Gateway 核心模块 (
internal/gateway/)deleteSession、renameSession、listFiles、listModels、setSessionModel、getSessionModel等 handlerFileEntry、ModelEntry、SessionModelResult等契约类型jsonrpc、rpc_dispatch、bootstrap等核心模块的单元测试覆盖2. CLI Gateway 运行时桥接 (
internal/cli/gateway_*.go)gateway_runtime_bridge适配新增的 RuntimePort 方法bridgeSessionStore/bridgeSessionLoader接口,解耦对具体存储实现的依赖gateway_runtime_bridge_test.go与root_test.go中 stub 的新接口实现3. 文档 (
docs/gateway-*.md)gateway-rpc-api.md,补充新增接口定义与示例gateway-compatibility.md兼容性说明4. 必要依赖 (
internal/app/bootstrap.go)RuntimeBundle补充SessionStore字段,支撑 gateway runtime bridge 的会话管理能力测试计划
go build ./...编译通过go test ./internal/gateway/...通过go test ./internal/cli/...通过额外修复
gateway_runtime_bridge_test.go与rpc_dispatch_test.go中的测试 stub 编译错误(函数签名不匹配)