oudecheng
1019dbe8cc
refactor(code-quality): 清理 clippy 存量告警(unwrap/clone/redundant 等)
...
- 移除无用克隆与冗余引用,减少不必要内存分配
- 规范 unwrap/expect 使用,修复可提前失败路径
- 修复 anthropic provider llm_timeout_secs 死代码并补全超时日志
- cargo fmt 统一格式
2026-08-16 23:22:22 +08:00
oudecheng
cda14360af
chore: 建立工程化基线(rustfmt + clippy + CI + eslint + prettier)
...
配置:
- rustfmt.toml: 固化 max_width=100 / 4 空格缩进,cargo fmt 全量格式化
- Cargo.toml: 配置 [lints.rust] 与 [lints.clippy] 渐进式规则
- .github/workflows/ci.yml: Rust(fmt+clippy+test) + 前端(eslint+tsc+test) 双平台 CI
- Makefile: 新增 check/fmt/fix 目标,clippy 对齐 --all-targets --all-features
- web: eslint flat config + prettier 配置 + package.json 脚本与依赖
- src/main.rs: loop→while 修复 clippy::never_loop
对抗性审查发现并修复:
- eslint 缺 caughtErrorsIgnorePattern 导致 catch(_) 误报为 error
- 前端 lint 未接入 CI,现已补上 Lint 步骤
- Makefile 与 CI 的 clippy flags 不一致,已对齐
2026-08-03 23:24:02 +08:00
oudecheng
46a1ca6853
refactor: 修复 3 项 P1 技术债(硬编码 URL / any 类型 / dead_code)
...
P1-1: 硬编码 wechat URL 抽常量统一两处
- config/mod.rs: 定义 pub const WECHAT_DEFAULT_BASE_URL
- cli/init.rs: import 并引用常量,消除字面量重复
- 消除两处不一致风险(default_wechat_base_url 与 init 向导)
P1-2: ConfigPage any 类型定义具体类型(8 处)
- types.ts: 新增 FeishuChannelConfig/WechatChannelConfig/ChannelConfig/
SchedulerJobConfig 类型;jobs?: any[] → SchedulerJobConfig[];
channels: Record<string, any> → Record<string, ChannelConfig>
- api/config.ts: 新增 RestartResponse 类型,data: any → RestartResponse
- ConfigPage.tsx: catch (e: any) ×2 → catch (e: unknown) + 类型守卫;
as any → as SchedulerConfig['misfire_policy'];
Record<string, any> → Partial<ChannelConfig>;(ch: any) → (ch: ChannelConfig)
P1-3: dead_code 18 处逐一审查清理
- 删除 10 处未使用函数/struct(YAGNI 原则):
context_compressor.rs (into_messages, is_tool_round)
agent_loop.rs (EmptySkillProvider struct + impl)
memory_maintenance.rs (run_for_scope)
session.rs (try_start/finish_background_compaction)
session_history.rs (try_start/finish_background_compaction)
tool_registry_factory.rs (shell_session_manager)
task/runtime.rs (effective_allowed_tools)
- 保留 8 处 serde 反序列化字段(删除会破坏 JSON 反序列化):
feishu.rs/openai.rs/anthropic.rs/skills/mod.rs/task/runtime.rs
2026-07-08 14:51:42 +08:00
oudecheng
97c0e46348
feat(tests): 增加工具调用序列清理的单元测试,确保孤立工具结果的正确处理
2026-06-16 16:52:00 +08:00
oudecheng
5273a7b335
feat: 添加记忆数量检查,避免在保留数不足时进行整理
2026-06-02 16:18:16 +08:00
b4ef56803f
feat: 添加内存维护配置,优化记忆整理逻辑和限制
2026-05-23 16:05:11 +08:00
oudecheng
3aeaea5fe4
feat: 增加最大令牌数至4000,优化内存维护服务的错误处理逻辑
2026-05-13 09:51:02 +08:00
9d9fa1dc4b
feat: 添加 memory_maintenance_timeout_secs 配置,优化内存维护超时设置
2026-05-12 22:11:34 +08:00
5a0c018ee7
feat: 更新内存维护逻辑,调整返回类型为Option以处理无结果情况
2026-05-12 21:04:17 +08:00
456a999494
feat: 优化内存维护逻辑,移除未使用的结构体,确保响应内容包含必要标签,并清理提示词加载中的注释和空白
2026-05-11 22:43:22 +08:00
oudecheng
3db0225838
feat: 重构记忆维护逻辑,移除不再使用的字段,添加新的整理和摘要功能
2026-05-11 15:19:46 +08:00
7c48a0f7f9
feat: 简化内存维护逻辑,移除不必要的时间戳参数,优化代码可读性
2026-05-05 19:40:07 +08:00
716d92a618
feat: 引入 AgentRuntimeConfig,重构相关模块以支持运行时配置
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 22:34:22 +08:00
04fc2c0710
feat: 添加记忆维护的错误处理逻辑,优化传输错误的上下文信息
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 18:10:23 +08:00
fa3354db9c
feat: add context_window_tokens to model configuration and update related logic
...
- Introduced context_window_tokens in ModelConfig and LLMProviderConfig structs.
- Updated context window estimation logic in ContextCompressor to use context_window_tokens.
- Modified tests to accommodate new context_window_tokens field.
- Refactored memory maintenance logic into a new memory_maintenance.rs file for better organization.
- Ensured backward compatibility by providing default values where necessary.
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 11:29:06 +08:00