Cepvor
835dd2d804
fix: 为 sessionStorage existingSessionFiles Map 添加容量上限 ( #1227 )
...
* fix: 修复子代理 token 消耗在主 spinner 中始终显示为 0
Spinner.tsx 的 token 聚合循环仅统计 in_process_teammate 类型任务,
漏掉了 local_agent(后台代理/verification agent)类型。当后台代理
运行时,主界面 spinner 一直显示 "↓ 0 tokens",因为 background agent
的 token 消耗未被纳入 teammateTokens 聚合。
同时在 inProcessRunner.ts 中,进程内队友完成时计算并设置 result
(含 totalTokens/totalToolUseCount/content/usage),使详情弹窗可以
正确展示累计 token 消耗,不再仅依赖 progress.tokenCount 间歇更新。
Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
* fix: 为 cacheWarningStateBySource Map 设置上限防止内存泄漏
Map 以 querySource 为 key 存储每个来源的缓存命中率历史状态,
但 querySource 类型为 `any`,长时间会话中可能产生大量唯一值,
Map 持续增长永不清理。
新增 MAX_SOURCE_ENTRIES = 50 上限,新增条目时若达到上限则
逐出最早插入的条目(Map 按插入顺序迭代)。
同时也新增 _resetCacheWarningStateForTest() 用于测试隔离。
Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
* fix: 为 sessionStorage existingSessionFiles Map 添加容量上限
existingSessionFiles Map 缓存 sessionId → 文件路径映射以避免重复
stat 调用,但在 coordinator/swarm 模式下,每个子代理产生独立
sessionId,长时间运行的 daemon 会话可能累积数千条目。
新增 MAX_CACHED_SESSION_FILES = 200 上限,新增条目时若达到上限则
逐出最早插入的条目。同时在 _resetFlushState() 中清除此缓存以保证
测试隔离。
Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
---------
Co-authored-by: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
2026-05-16 08:09:40 +08:00
claude-code-best
80b46d2221
Merge pull request #1225 from Evsdrg/main
...
fix: 修复子代理 token 显示为 0 + cacheWarningStateBySource Map 内存泄漏
2026-05-14 20:05:26 +08:00
claude-code-best
78d46aa233
fix: 替换 extractMemories 的 require() 为动态 import() 修复 Vite 构建崩溃
...
Vite/Rollup 构建时将 require() 通过 __toCommonJS() 包装 ESM 导出,
导致命名导出被包裹在 { default: namespace } 中,访问
extractMemoriesModule.initExtractMemories 为 undefined 触发 React
error boundary 崩溃。改用标准 ESM 动态 import() 绕过 CJS interop。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-14 17:44:47 +08:00
cepvor
b3d28bcdf1
fix: 为 cacheWarningStateBySource Map 设置上限防止内存泄漏
...
Map 以 querySource 为 key 存储每个来源的缓存命中率历史状态,
但 querySource 类型为 `any`,长时间会话中可能产生大量唯一值,
Map 持续增长永不清理。
新增 MAX_SOURCE_ENTRIES = 50 上限,新增条目时若达到上限则
逐出最早插入的条目(Map 按插入顺序迭代)。
同时也新增 _resetCacheWarningStateForTest() 用于测试隔离。
Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
2026-05-14 16:05:16 +08:00
cepvor
1f80043928
fix: 修复子代理 token 消耗在主 spinner 中始终显示为 0
...
Spinner.tsx 的 token 聚合循环仅统计 in_process_teammate 类型任务,
漏掉了 local_agent(后台代理/verification agent)类型。当后台代理
运行时,主界面 spinner 一直显示 "↓ 0 tokens",因为 background agent
的 token 消耗未被纳入 teammateTokens 聚合。
同时在 inProcessRunner.ts 中,进程内队友完成时计算并设置 result
(含 totalTokens/totalToolUseCount/content/usage),使详情弹窗可以
正确展示累计 token 消耗,不再仅依赖 progress.tokenCount 间歇更新。
Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win >
2026-05-14 15:40:28 +08:00
claude-code-best
aaabf0c168
Revert "feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件"
...
This reverts commit 0ce8f7a1cb .
2026-05-10 22:57:30 +08:00
claude-code-best
43c20a43c2
Revert "fix: 修复非 UTF-8 编码文件读写 round-trip 字节损坏"
...
This reverts commit 17c06690d8 .
2026-05-10 22:57:25 +08:00
claude-code-best
17c06690d8
fix: 修复非 UTF-8 编码文件读写 round-trip 字节损坏
...
GBK 文件编辑后被错误写入为 UTF-8(Buffer.from 不支持 gbk 编码,
encodeString 静默 fallback),latin1/ANSI 文件 0x80-0x9F 范围字节因
TextDecoder('latin1') 与 Buffer.from('latin1') 编解码不对称而被篡改。
修复:latin1 解码改用严格 ISO-8859-1 映射保证与 Buffer.from 对称;
GBK 编码通过 TextDecoder 反向构建查找表实现零依赖编码器。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-10 22:08:52 +08:00
claude-code-best
0ce8f7a1cb
feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件
...
新增 encoding.ts 核心模块实现三层编码检测(BOM → UTF-8 fatal → GBK 回退),
改造同步/异步读取路径和写入路径,使 FileReadTool/FileEditTool/FileWriteTool
能正确处理 GBK 编码文件。包含完整单元测试和 spec 文档。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-10 20:50:12 +08:00
claude-code-best
6e1d3d8f47
fix: 修复 feature 的使用问题
2026-05-10 19:26:57 +08:00
claude-code-best
dc3d3e8839
fix: 移除 auto mode 的 provider 和模型白名单限制
...
移除 firstParty provider 限制和 claude-(opus|sonnet)-4-[67] 模型白名单,
使所有模型和 provider 在 TRANSCRIPT_CLASSIFIER feature 启用时均可使用 auto mode。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-10 17:47:38 +08:00
claude-code-best
998890b469
Merge pull request #446 from claude-code-best/feature/prompt-cut-down
...
feat: 大量系统提示词优化
2026-05-10 15:30:34 +08:00
claude-code-best
82be5ff05b
fix: 代码审查修复 — 安全、性能和正确性
...
- triggersApi: 添加 assertSubscriptionBaseUrl 防止 OAuth token 泄露
- claude.ts: 修复流式响应 O(n^2) 字符串拼接,改用数组累积
- claude.ts: 移除未使用的 import,动态 import 改为静态 import
- StatusLine: BuiltinStatusLine 仅在 statusLineEnabled 时显示,修复双行问题
- local-vault: 修复 --reveal 标志位置解析 bug
- share: 修复 sk-proj-* OpenAI 密钥未脱敏问题
- store.ts: 临时文件改用同目录创建,避免跨文件系统 rename 失败
- store.ts: 添加空字符串 key 校验
- permissionValidation: 端口正则限制为有效 TCP 范围 0-65535
- 测试 mock 补全: schedule/vault/skill-store 测试文件
- 移除过期的 biome-ignore 注释
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-10 09:39:34 +08:00
claude-code-best
efaf4afd9c
feat: 添加 Provider Registry、StatusLine、Cache Stats 和其他增强
...
- providerRegistry: OpenAI 兼容 provider 切换(Cerebras/Groq/DeepSeek/Qwen)
- StatusLine: 增强状态栏(缓存命中率、TTL 倒计时、自定义 shell 命令)
- cacheStats: 缓存命中率和 token 签名追踪
- ultrareviewPreflight: 代码审查预检服务
- SkillsMenu/filterSkills: 技能菜单过滤增强
- MagicDocs/langfuse prompts: 提示词更新
- claude.ts: API 客户端更新
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 23:04:35 +08:00
claude-code-best
fdddb6dbe8
feat: 添加工具类命令(teleport、recap、break-cache、env、tui 等)
...
- /teleport: 从 claude.ai 恢复会话
- /recap: 生成会话摘要
- /break-cache: 提示缓存管理(once/always/off/status)
- /env: 环境信息展示(含密钥脱敏)
- /tui: 无闪烁 TUI 模式管理
- /onboarding: 引导流程
- /perf-issue: 性能问题诊断
- /debug-tool-call: 工具调用调试
- /usage: 用量统计(合并 /cost 和 /stats 别名)
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 23:04:31 +08:00
claude-code-best
4f0aa8615a
feat: 添加本地 Memory/Vault 管理命令
...
- /local-memory: 本地记忆管理(store/entry CRUD、搜索、归档)
- /local-vault: 本地密钥保险库管理(加解密、keychain 集成)
- permissionValidation: vault 权限校验增强
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 23:04:20 +08:00
claude-code-best
5bb0306da6
feat: 添加 LocalMemoryRecallTool 和 VaultHttpFetchTool
...
- LocalMemoryRecallTool: 跨会话本地笔记召回,权限门控,大小限制
- VaultHttpFetchTool: 使用 vault 密钥的认证 HTTP 请求,ACL 规则
- agentToolFilter: 子 agent 工具继承过滤层
- ALL_AGENT_DISALLOWED_TOOLS 白名单更新
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 23:04:12 +08:00
claude-code-best
b8d86e5279
feat: 添加 Local Vault 加密存储服务
...
AES-256-GCM 加密 vault,支持 OS keychain 和加密文件回退,
scrypt KDF 密钥派生,64KB secret 上限。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 23:04:07 +08:00
claude-code-best
84f12f34bd
fix: 提升 CLAUDE.md 指令权重 — 独立 project-instructions + deferred tools 位置调整
...
- prependUserContext: 将 claudeMd 从通用 <system-reminder> 提取为独立的
<project-instructions> 用户消息,不带免责声明,置于消息列表最前面
- queryModel: deferred tools 消息从 prepend 改为 append,避免抢占
project-instructions 的最高权重位置;标签规范化为 <system-reminder>
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 17:50:15 +08:00
claude-code-best
7e2b8e81ca
Merge pull request #442 from claude-code-best/feature/tool_search
...
feat: 支持 SearchExtraTools 能力以替代 Tool Search
2026-05-09 17:23:03 +08:00
claude-code-best
2cf18c4c49
docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗
...
- 新增 docs/design/tool-search-design-guide.md,涵盖架构、搜索算法、执行管道、演进历史
- 禁用 getTurnZeroSearchExtraToolsPrefetch,消除用户输入时的频繁弹窗
- inter-turn 发现机制保持不变
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win >
2026-05-09 16:45:56 +08:00
Bill
b52c10ddb9
fix: 修复CI格式检查失败
2026-05-09 16:21:07 +08:00
claude-code-best
3ac866be98
fix: 修复缓存命中率警告消息不显示 — 改用 system 类型消息绕过 isMeta 过滤
2026-05-09 15:22:34 +08:00
claude-code-best
c14b7eadd2
fix: 修复 Tool Search 缓存失效 — deferred 工具不再动态注入 tools 数组
...
移除 deferred 工具的 "discover then include" 逻辑,让 tools 数组在整个会话中
保持稳定(只有 core tools + ToolSearch + ExecuteExtraTool),避免每次发现新
工具时 tools JSON 变化导致 prompt cache 失效。
同时强化工具优先级引导:core tools 优先直接调用,ToolSearch/ExecuteExtraTool
仅作为发现和调用 deferred 工具的最后手段。当模型搜索已加载的 core tool 时,
ToolSearch 返回明确的拒绝提示。
Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win >
2026-05-09 14:56:22 +08:00
claude-code-best
8c157f0767
refactor: 统一自建 Tool Search — 移除 tool_reference/defer_loading 依赖,全 provider 通用
...
- 重命名 ExecuteTool → ExecuteExtraTool,作为一等工具始终可用
- ToolSearchTool 输出改为纯文本(区分 core/deferred),移除 tool_reference blocks
- 移除 modelSupportsToolReference() 及相关 GrowthBook 配置
- 移除 API 侧 defer_loading 字段和 tool search beta header 注入
- 简化 system prompt(工具使用指南从 ~120 行压缩到 ~10 行)
- extractDiscoveredToolNames 支持文本格式解析(向后兼容旧 session 的 tool_reference)
- 更新 promptEngineeringAudit 测试以匹配简化后的 prompt 结构
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-09 14:19:31 +08:00
claude-code-best
4fc95bd5a7
feat: Remote Control 条件工具注入 — PushNotification/SendUserFile/Brief 仅 bridge 启用时可用
...
- PushNotificationTool、SendUserFileTool 添加 isEnabled() 使用 isBridgeEnabled()
- BriefTool 的 isEnabled() 从 isBriefEnabled() 改为 isBridgeEnabled()
- ExecuteTool 添加 isEnabled() 兜底检查,不可用时返回友好错误
- useReplBridge bridge 首次连接时插入 system 消息通知模型新工具可用
- 移除 toolSearch 中 firstParty base URL 白名单检测,默认启用 tool search
Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win >
2026-05-09 09:45:52 +08:00
claude-code-best
7be08f53bd
feat: 实现 Tool Search 基础设施层(CORE_TOOLS 白名单 + TF-IDF 索引 + ExecuteTool + 搜索增强)
...
- 新增 CORE_TOOLS 白名单常量(31 个核心工具),重构 isDeferredTool 为白名单制判定
- 新建 TF-IDF 工具索引模块(toolIndex.ts),复用 localSearch.ts 算法函数
- 新建 ExecuteTool 跨 API provider 统一工具执行入口
- 增强 ToolSearchTool:TF-IDF 搜索路径、discover: 模式、并行搜索合并、文本模式回退
- 新增 27 个单元测试,precheck 零错误通过(4108 tests pass)
Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win >
2026-05-08 22:29:15 +08:00
Bill
c7cb3d8f93
feat: /login支持codex订阅登录
2026-05-08 20:35:34 +08:00
claude-code-best
7fe448d9e9
feat: 改为使用 ccb 的邮箱
2026-05-07 12:06:40 +08:00
claude-code-best
aa06cea904
fix: 修正 GLM 模型 GitHub 署名邮箱为 zai-org
...
Co-Authored-By: glm-5.1[1m] <zai-org@users.noreply.github.com >
2026-05-07 11:35:40 +08:00
claude-code-best
c43efecbab
feat: 署名邮箱改为 GitHub noreply 格式并新增模型映射
...
Co-Authored-By: glm-5.1[1m] <zhipuai@users.noreply.github.com >
2026-05-07 11:32:48 +08:00
claude-code-best
cb4a6e76cf
feat: 添加自动邮箱映射功能并完善署名系统
...
- 新增 attributionEmail.ts 实现模型名到邮箱的自动映射
- 重构署名逻辑,统一使用 getRealModelName() 和 getAttributionEmail()
- 将产品名从 Claude Code 更新为 Claude Code Best
- 更新 PRODUCT_URL 指向 claude-code-best fork 仓库
Co-Authored-By: glm-4.7 <noreply@zhipuai.cn >
2026-05-07 11:12:40 +08:00
claude-code-best
f7f69b759c
fix: 修复模型别名未解析导致署名显示 "haiku" 而非真实模型名
...
去掉 getUserSpecifiedModelSetting() 分支,统一走 getMainLoopModel()(解析别名)
+ resolveProviderModel()(解析 provider 映射)的完整链路。
Co-Authored-By: opus[1m] <noreply@anthropic.com >
2026-05-07 11:10:01 +08:00
claude-code-best
771e3dbcf0
fix: 修复非 Anthropic provider 署名模型名获取错误
...
getRealModelName() 现在会检查 provider 特定环境变量(OPENAI_MODEL、GEMINI_MODEL、GROK_MODEL),
确保通过这些变量设置模型时署名显示真实名称而非 Anthropic 默认模型名。
Co-Authored-By: opus[1m] <noreply@anthropic.com >
2026-05-07 10:57:14 +08:00
claude-code-best
e3c0699f5b
feat: 添加 prompt 缓存命中率检测与警告功能
...
每次 API 请求后自动计算缓存命中率,低于阈值(默认 80%)时在对话流中显示黄色警告消息。
同时更新 /context 命令输出中显示缓存命中率。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-07 10:49:06 +08:00
zny
2f150d3ecd
feat: 状态栏支持 refreshInterval 定时刷新
...
- Zod schema 补齐 refreshInterval 字段
- 通过 scheduleUpdate 复用 300ms debounce,event/settings/time 三路触发单飞
- 新增 docs/features/status-line.mdx 调研文档
2026-05-06 22:50:11 +08:00
shaleloop
26ddbda849
fix: align mcp transform pipeline with Anthropic Claude Code 2.1.128
...
Add ImageLimits type and plumb optional limits through the chain:
callMCPTool/callMCPToolWithUrlElicitationRetry -> processMCPResult ->
transformMCPResult -> transformResultContent -> maybeResizeAndDownsampleImageBuffer.
When provided, limits override the module-level defaults
(IMAGE_TARGET_RAW_SIZE, IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
API_IMAGE_MAX_BASE64_SIZE) inside maybeResizeAndDownsampleImageBuffer.
When undefined, behavior is unchanged for current callers.
Add _meta preservation in the text-block case of transformResultContent
(only when the caller opts in via includeMeta=true). transformMCPResult
passes includeMeta=true on the tool-result path; the prompt-handler call
site keeps the default false, preserving prior behavior.
Add skipLargeOutput early-return in processMCPResult after the IDE check:
when the caller passes skipLargeOutput=true and the content has no images,
the function returns content directly without large-output handling.
Add unwrap-to-text in processMCPResult for the persisted-content path:
when the large-string format gate is enabled
(MCP_TRUNCATION_PROMPT_OVERRIDE env var, or
tengu_mcp_subagent_prompt Statsig gate), and the content is a single
bare text block (no annotations, no _meta), unwrap to raw text and
switch the format description to 'Plain text'. Default-off; gate-off
behavior is unchanged.
Verified structurally against the 2.1.128 binary: function signatures,
the IDE check, gate logic, _meta-unwrap pattern, and imageLimits
plumbing match this implementation.
2026-05-05 14:53:57 -07:00
claude-code-best
3f1c8468bf
fix: 调小 snapshots 的范围
2026-05-05 21:09:02 +08:00
claude-code-best
0ad6349434
chore: 清理 18 处未使用导入、变量和函数
...
移除未使用的导入(getSubscriptionType、isEnvDefinedFalsy、
getClaudeConfigHomeDir 等)、未使用的常量(ACCENT_COLOR、
NAME_MATCH_BONUS、CLIPBOARD_THRESHOLD)和死函数
(getOpus41Option、pasteViaClipboard),
为未使用参数添加 _ 前缀。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-05 20:15:51 +08:00
claude-code-best
1ac18aec0d
chore: 清理 4 处遗漏的未使用导入和参数
...
移除 autonomyStatus/betas/claudemd/executorCrossPlatform 中
未使用的导入和参数。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-05 20:05:50 +08:00
claude-code-best
fcbc882232
chore: 清理 src 下 113 项未使用导入和死代码
...
删除未使用的文件(BuiltinStatusLine.tsx、4 个重复的 .ts stub)、
移除约 55 个文件中未使用的 React 导入、
清理约 50 处未使用的导入/变量/参数。
净减少 ~296 行代码,precheck 4077 测试全部通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-05 20:05:15 +08:00
claude-code-best
87b96199f9
feat: ai 的随机修复
2026-05-05 19:36:38 +08:00
claude-code-best
18d6656a6a
feat: 尝试改进 Error 处理以提升内存管理效率
2026-05-05 18:18:13 +08:00
claude-code-best
d0915fc880
chore: 清理 src 下 33 项死代码和类型断言
...
删除未使用的文件/目录(mcp/adapter、cli/update.ts 等)、
未使用的重导出文件(design-system/color.ts 等 12 个)、
7 个零引用的导出函数、修复 5 处 as any 为精确类型。
净减少 ~1194 行代码,precheck 4077 测试全部通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-05 16:07:30 +08:00
claude-code-best
f8a289b868
fix: 尝试修复 OTEL 的问题
2026-05-04 23:53:28 +08:00
claude-code-best
45c892fc18
revert: 恢复 HISTORY_SNIP
2026-05-04 23:51:36 +08:00
claude-code-best
b28de717dd
perf: 优化内存与遥测管理,启用 Vite minify
...
- 禁用 HISTORY_SNIP feature flag 并新增 proactiveTruncate 防止无 compact_boundary 时内存无限增长
- 跳过未启用 telemetry 时的 OTel 初始化,防止长会话 PerformanceMeasure 堆积
- OTel 导出遇 401/403 自动关闭 reader,防止 handle 泄漏
- Vite 构建启用 minify
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-04 23:23:25 +08:00
claude-code-best
6becb8b2d4
fix: 修复 tasks.test.ts 类型错误与并发测试失败
...
- jsonStringify mock 参数类型改为 Parameters<typeof JSON.stringify>[1][] 消除 TS2769
- 并发测试改为顺序执行以适配 Bun 下 proper-lockfile 的 advisory lock 行为
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-03 10:24:01 +08:00
claude-code-best
4ca7a4895a
test: 新增 tasks.ts CRUD 测试覆盖(37 个测试)及 code review 进度记录
...
审查任务管理 CRUD 模块:创建/读取/更新/删除、高水位标记、文件锁并发安全、
claimTask 竞态保护、resetTaskList、通知信号、并发创建唯一 ID 验证。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-03 03:29:06 +08:00
claude-code-best
86df024e75
fix: 修复模型的问题
2026-05-02 22:39:57 +08:00