linkai0924
81b8abc9e3
Merge pull request #84 from IronRookieCoder/fix/issue-34-agent-team-idle
...
fix(agent-team): handle idle teammate coordination failures
2026-05-15 17:01:46 +08:00
geroge
37fe62a5de
Merge pull request #91 from IronRookieCoder/fix/issue-49-show-memory-pid
...
feat(config): add showMemoryPid setting to toggle footer memory/PID display
2026-05-15 14:34:04 +08:00
geroge
ba9c2e1538
Merge pull request #89 from IronRookieCoder/fix/issue-46-47
...
fix(windows): prevent terminal startup failures
2026-05-15 14:33:28 +08:00
geroge
8e52334f0a
Merge pull request #83 from IronRookieCoder/fix/issue-37-bash-autobg
...
fix(bash): wake foreground task after auto-backgrounding
2026-05-15 14:32:20 +08:00
DoSun
ecb0df50d3
fix: add type guards and null checks for UUID handling in snip functionality
...
- Add UUID type import and type guard in force-snip command
- Add null/undefined checks in snipCompact, snipProjection, and sessionStorage
- Improve optional chaining in SnipTool for safer property access
- Prevent potential runtime errors from invalid UUID values
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 14:26:33 +08:00
林凯90331
6b5b801dae
fix(ink): treat newline as return and suppress favorite fetch error in TUI
...
Some terminals on CentOS emit \n or \r\n instead of \r for the Enter key.
Map both sequences to 'return' in parseKeypress so key.return is set correctly.
Replace console.warn with logForDebugging in favorite.ts to prevent
network errors from polluting the TUI output.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 11:06:18 +08:00
林凯90331
beb268eca0
fix(ink): handle enter key on centos
...
Some terminals on CentOS emit 'enter' instead of 'return' for the Enter key.
Treat both names as the Return key to ensure consistent input behavior across platforms.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:17:22 +08:00
IronRookieCoder
b528d378db
feat(config): add showMemoryPid setting to toggle footer memory/PID display
...
## 实现要点
新增全局配置项 showMemoryPid,允许用户通过 /config 面板关闭底部状态栏的内存值和 PID 显示(默认开启,行为不变)。
## 变更要点
- src/utils/config.ts:新增 showMemoryPid?: boolean 类型声明 + GLOBAL_CONFIG_KEYS 注册
- src/components/PromptInput/PromptInputFooterLeftSide.tsx:新增 isMemoryPidEnabled() 函数,RSS/PID 渲染受配置控制
- src/components/Settings/Config.tsx:/config UI 面板注册配置项,含 logEvent 埋点
- packages/builtin-tools/src/tools/ConfigTool/supportedSettings.ts:SUPPORTED_SETTINGS 注册
2026-05-14 17:41:13 +08:00
IronRookieCoder
223b694965
fix(windows): prevent terminal startup failures
...
## Bug 详情
- issues.md #46:Windows MSYS2/UCRT64 下执行 csc,欢迎信息输出后在 stdin raw mode/终端输入初始化阶段崩溃,出现 native std::bad_weak_ptr 和后续 Bun mutex corrupt。
- issues.md #47:cmd.exe 可启动,但 PowerShell 运行 csc 会走 npm 生成的 csc.ps1;截图显示 node.exe 报错 "Input must be provided either through stdin or as a prompt argument when using --print",说明裸 csc 被误判成 print/non-interactive 模式。
## 根因
- MSYS2/Cygwin/mintty 等 Windows 终端对 Node/Bun stdin raw mode 和终端扩展控制序列兼容性不稳定,启动早期强行 setRawMode/查询终端能力会触发崩溃风险。
- npm 的 PowerShell shim 解析优先级高于 csc.cmd,且可能让 stdout TTY 状态不可用;原 main.tsx 只要 stdout 非 TTY 就自动进入 non-interactive/--print 路径,最终在没有 prompt/stdin 时触发 #47 的报错。
## 修复方案
- 为 Ink stdin raw mode 增加 Windows 风险终端检测,在 MSYS2/Cygwin/mintty 或显式禁用开关下跳过 raw mode,使用 cooked input fallback。
- early input 捕获在启动早期复用同类风险判断,避免 REPL 渲染前就触发 raw mode 崩溃。
- postinstall 在 Windows 上清理属于本包的 csc.ps1,让 PowerShell 回落到与 cmd.exe 一致的 csc.cmd 启动路径。
- 新增 non-interactive 判定工具,保留显式 -p/--print、--init-only、--sdk-url 的 headless 行为,但要求 stdin/stdout 都不是交互 TTY 才自动进入 non-interactive,避免 PowerShell shim 下裸 csc 被误判。
## 变更要点
- 新增 packages/@ant/ink/src/core/raw-mode-support.ts 及单元测试,覆盖普通 Windows shell、MSYS2/Cygwin/mintty 和禁用开关
- 调整 Ink App raw mode 生命周期,只在真正启用 raw mode 后写入/清理 bracketed paste、focus reporting、extended key 等终端控制序列
- 调整 component unmount/exit 清理逻辑,按 rawModeEnabledCount/rawModeActive 关闭实际启用的输入监听和 raw mode
- 调整 src/utils/earlyInput.ts,避免不安全 Windows 终端在启动阶段启用 stdin raw mode
- 调整 scripts/postinstall.cjs,立即和延迟清理 npm 生成的 csc.ps1 shim
- 调整 src/main.tsx 使用 shouldUseNonInteractiveSession,并新增对应测试覆盖 PowerShell shim 场景
## 自测
- bun test packages/@ant/ink/src/core/__tests__/raw-mode-support.test.ts src/utils/__tests__/earlyInput.test.ts src/utils/__tests__/nonInteractiveSession.test.ts
- node --check scripts/postinstall.cjs
- bun run src/entrypoints/cli.tsx --version
- bun run lint
- git diff --check
## 已知限制
- bun run typecheck 仍失败,错误来自仓库既有缺失声明/缺失模块和无关类型问题,不来自本次改动。
2026-05-14 17:07:51 +08:00
DoSun
cbc948b044
Merge branch 'feat/server-refactor'
...
# Conflicts:
# build.ts
# src/main.tsx
# src/services/rawDump/worker.ts
2026-05-14 15:21:25 +08:00
IronRookieCoder
28f2e3a6ac
fix(agent-team): handle idle teammate coordination failures
...
## Bug 详情
Agent Team 在 CoStrict 环境下可能出现子代理无法执行、完成后主代理持续 Idle、shutdown 后 TeamDelete 被阻塞,以及 TeamCreate 参数错误时抛出 name.replace 深层异常。
## 根因
- Team teammate 默认模型路径未复用普通 subagent 的 CoStrict 继承逻辑,未配置 teammateDefaultModel 时会回退到 CoStrict 不可用的 claude-opus-4-6。
- in-process teammate 的 AsyncLocalStorage 上下文可能影响 team lead 的 inbox polling 身份判断。
- SendMessage 收到字符串形式的 shutdown_response JSON 时按普通消息转发,未进入 shutdown approval 分支。
- ExecuteExtraTool 调用 deferred tool 前未执行目标工具 validateInput,错误参数会绕过入口校验进入目标工具内部。
## 修复方案
- 将 teammate 模型解析集中到 teammateModel,并在 CoStrict 默认场景继承 leader model。
- 抽出 inbox poller 身份判断,基于 AppState 识别 team lead polling。
- 兼容字符串 JSON 协议响应,将 shutdown_response / plan_approval_response 路由到结构化处理逻辑。
- ExecuteExtraTool 在权限检查和实际执行前调用目标工具 validateInput。
## 变更要点
- 新增 teammate 模型解析和 CoStrict 继承测试。
- 新增 inbox poller identity helper 和 in-process 上下文回归测试。
- 新增 SendMessage 字符串 shutdown_response 回归测试。
- 新增 ExecuteExtraTool 目标工具校验回归测试。
## 自测
- bun test packages/builtin-tools/src/tools/ExecuteTool/__tests__/ExecuteTool.test.ts
- bun test packages/builtin-tools/src/tools/SendMessageTool/__tests__/udsRecipientSanitization.test.ts src/utils/swarm/__tests__/teammateModel.test.ts src/hooks/__tests__/useInboxPoller.test.ts
- bunx biome check 相关变更文件
- 变更文件相关 tsc 过滤检查无输出
2026-05-14 14:50:30 +08:00
IronRookieCoder
95a4430fa2
Revert "fix(bash): wake foreground task after auto-backgrounding"
...
This reverts commit 1a85db7ca8 .
2026-05-14 13:33:00 +08:00
IronRookieCoder
1a85db7ca8
fix(bash): wake foreground task after auto-backgrounding
...
## Bug 详情
用户升级 4.0.16 后,使用过程中 CLI 会话可能一直处于 busy 状态,表现为无法继续输入且没有响应。
## 根因
BashTool 的长命令在已经注册为 foreground task 后被自动后台化时,只设置了 backgroundShellId,但没有唤醒正在等待 progress/result 的 generator。若命令无输出或轮询没有再次触发,主 REPL 会继续等待,输入循环无法释放。
## 修复方案
在 foreground task 自动后台化成功后,立即 resolve 当前 progress 等待器,让 runShellCommand 能观察到 backgroundShellId 并返回后台任务结果。
## 变更要点
- 在 BashTool foreground auto-background 路径补齐 resolveProgress 唤醒逻辑
- 保持已有 spawnBackgroundTask 路径的唤醒行为一致
## 自测
- bun test packages/builtin-tools/src/tools/BashTool/__tests__ 通过
- bun run typecheck 当前仍有仓库既有无关错误,未涉及本次变更
2026-05-14 13:21:58 +08:00
geroge
42107f7d2f
Merge pull request #64 from y574444354/feat/migrate-review-agents
...
【Review】feat: 将 review skill 迁移到 extract-to-disk 架构
2026-05-13 19:38:26 +08:00
geroge
d3d0dd25d2
Merge pull request #80 from IronRookieCoder/fix/issues-31-32
...
fix: 修复任务列表数字ID乱序和内存轮询导致滚动跳动
2026-05-13 19:37:25 +08:00
geroge
d8a19f1473
Merge pull request #79 from IronRookieCoder/personal-ironrookiecoder-fix-issue-42-43
...
fix: merge sub-agent readFileState to prevent cross-agent write confl…
2026-05-13 19:37:09 +08:00
IronRookieCoder
5ee2d6dcc3
fix: 修复任务列表数字ID乱序和内存轮询导致滚动跳动
...
两个修复:
1. 任务列表数字ID乱序(#32):新增 compareTaskIds 比较函数,纯数字ID按
数值大小排序(1, 2, 3, 10 而非 1, 10, 2, 3),非纯数字回退到
localeCompare 自然排序。listTasks 和 taskStateMessage 两处排序入口
均已修复。
2. 终端 RSS 内存轮询引发滚动跳动(#31):useRssDisplay hook 新增 isLoading
参数,仅在加载中启用定时轮询,闲时仅渲染一次内存占用值,避免 Ink 重渲染
干扰用户滚动查看结果。
附:TaskCreateTool.isConcurrencySafe 改为 false,防止并发任务创建的文件
IO 竞态。
Co-Authored-By: CoStrict-DeepSeek-V4-Pro <deepseek-ai@claude-code-best.win>
2026-05-13 16:44:13 +08:00
IronRookieCoder
233971c6ce
fix: merge sub-agent readFileState to prevent cross-agent write conflicts
...
子代理完成后将其 readFileState 合并回主代理缓存,防止主代理写文件时因
缓存过期而误报 FILE_UNEXPECTEDLY_MODIFIED_ERROR。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:36:46 +08:00
DoSun
c2eb6bff90
fix: 清理 main 分支的 stub .js 文件,恢复有 .ts 源文件的命令模块
2026-05-13 10:36:04 +08:00
DoSun
3bfc695cb4
chore: 清理临时 rebase 脚本
2026-05-13 10:29:34 +08:00
IronRookieCoder
b58fd8f782
fix: 修复子代理参数兼容问题
2026-05-12 21:24:12 +08:00
kingboung
4c56bbe268
fix: remove agent-based review code reintroduced from main merge
...
Revert PR #43 agent-based code that was brought in during the main merge:
- Remove generateBuiltinAgents and all agent-related logic from generate script
- Delete src/costrict/review/agent/ directory
- Delete src/commands/security-review.ts (handled by bundled skill)
- Restore PR #64 extension.ts with getClaudeConfigHomeDir approach
- Remove REVIEW_AGENTS from builtInAgents.ts
- Keep review command (needed for MCP entry), but use CommandLocale instead of agent
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 15:32:07 +08:00
y574444354
666d2ba2eb
Merge branch 'main' into merge
2026-05-12 12:25:05 +08:00
y574444354
8b6bdd44d8
Revert "Merge pull request #60 from y574444354/feat/migrate-review-agents"
...
This reverts commit 62398b2dcc , reversing
changes made to ba39b17a7e .
2026-05-12 12:11:37 +08:00
y574444354
d59d1f590a
chore: 合并社区 upstream/main 代码至 v2.4.2
...
合并 claude-code-best/claude-code 社区最新代码,包含:
- 配置文件更新:precheck/lint-staged/overrides 等
- 新 feature flags:EXPERIMENTAL_SEARCH_EXTRA_TOOLS、AUTOFIX_PR
- 工具系统架构更新:Tool Search、ACP 协议支持
- 文档更新:CLAUDE.md 同步架构变更
- 依赖更新:SDK 版本升级、lint-staged 加入
冲突处理策略:以 costrict 版本为主,选择性合并上游功能改进
2026-05-12 11:55:04 +08:00
kingboung
e3ba147dbe
refactor: migrate review system to bundled skill files mechanism
...
Replace custom extension.ts initialization and agent-based routing with
csc's built-in registerBundledSkill({ files }) mechanism. Review and
security-review skills are now registered with embedded files that
get lazily extracted to disk on first invocation. Locale is resolved
at startup via getResolvedLanguage().
- Remove agent generation from generate-review-builtin.ts (skill-only)
- Remove extension.ts, REVIEW_AGENTS registration, strict:* skills
- Add reviewSkills.ts with registerReviewSkills() for unified registration
- Adapt to new costrict-review index.json format (skills-only, new paths)
- Remove src/costrict/command/locales/ (no longer needed)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 20:19:05 +08:00
claude-code-best
8f512c6222
Revert "feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件"
...
This reverts commit 0ce8f7a1cb .
2026-05-10 22:57:30 +08:00
claude-code-best
58b58e649d
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
af0d34ebbe
Merge pull request #446 from claude-code-best/feature/prompt-cut-down
...
feat: 大量系统提示词优化
2026-05-10 15:30:34 +08:00
claude-code-best
52956804ff
feat: 注册所有新命令到命令系统和工具注册表
...
- commands.ts: 注册所有新命令(memory-stores、vault、schedule 等),
移除 require() 动态加载,统一为 ESM import
- tools.ts: 注册 LocalMemoryRecallTool、VaultHttpFetchTool
- 补充命令测试(bridge-kick、commit、commit-push-pr、init-verifiers)
- 补充工具测试(AgentTool、RemoteTrigger、SkillTool、WebFetch、WebSearch)
- 集成测试:autonomy-lifecycle-user-flow 更新
- 探测脚本和功能文档
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:39 +08:00
claude-code-best
3114a82b89
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
4c6560e451
refactor: 精简系统提示词 — 合并沟通风格段落、精简 memory/工具描述、截断 gitStatus
...
- 合并 getOutputEfficiencySection + getSimpleToneAndStyleSection 为精简的 Communication style
- 精简 auto memory 指令:删除 4 种类型的详细说明和示例,仅保留核心 description
- 精简 Agent 工具:删除 forkExamples 和 currentExamples 大段示例
- 精简 Bash 工具:合并 sleep 相关指导
- 精简 EnterPlanMode/ExitPlanMode:删除详细 GOOD/BAD 示例
- gitStatus MAX_STATUS_CHARS 从 2000 降到 1000
- 同步更新 prompt engineering audit 测试断言
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 17:14:41 +08:00
claude-code-best
d27c6ccb47
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
claude-code-best
8565b65d92
feat: 将 Agents/Teams 工具纳入 Tool Search 按需发现
...
将 TeamCreate、TeamDelete、SendMessage 从 CORE_TOOLS 移除,
使其成为 deferred 工具,通过 ToolSearch 按需发现以减少 context token。
swarm 模式下 SendMessage 保持 always loaded,TeamCreate/TeamDelete
在 swarm 未启用时调用返回启用提示。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:45:20 +08:00
claude-code-best
a77d8316c9
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
f04889504e
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
fe480d35a4
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
42f0d35b5d
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
kingboung
4054ae9f4b
feat: migrate review agents and skills to unified costrict-review repo
...
- Add generate-review-builtin.ts script (downloads from zgsm-ai/costrict-review)
- Add review module (index.ts, extension.ts) with locale-aware skill init
- Add CommandLocale module with zh-CN/en templates for /review and /security-review
- Integrate REVIEW_AGENTS into builtInAgents.ts
- Route /review command to CoStrictReviewer agent
- Simplify /security-review to use Skill tool with locale templates
- Remove old generate-skills.ts and inline security-review skill
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 09:40:24 +08:00
claude-code-best
cc4a007cae
fix: 恢复消息流中 diff 高亮渲染功能
...
还原 commit 51b8ad46 删除的 diff highlight 显示:FileEdit/FileWrite 工具
执行成功后重新展示 StructuredDiffList,拒绝时重新展示高亮代码预览或
带上下文的 diff 视图。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 08:28:28 +08:00
claude-code-best
2192120646
feat: 尝试改进 Error 处理以提升内存管理效率
2026-05-05 18:18:13 +08:00
claude-code-best
cfee8c5d56
feat: fork-agent-redesign — 新增 AgentTool fork 参数与 spec 设计文档
...
为 AgentTool 引入 fork 布尔参数,支持子代理从父对话上下文中 fork 出独立分支,
继承完整历史、系统提示和模型配置。重构 inputSchema 条件逻辑以适配 fork 模式。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 23:39:43 +08:00
claude-code-best
459768e7f3
fix: 内存优化 — 预测性 compact 阈值、增量 lookups orphaned 修复、deferred slice 引用优化
...
- P0: REPL.tsx 用 useMemo 包裹 deferred messages slice,避免每次渲染创建新数组引用导致不必要的后台重渲染
- P1: 预测性 compact 阈值改用 effectiveContextWindow - growth,消除与 autocompact buffer 的双重预留;TOOL_RESULT_GROWTH_ESTIMATE 从 20K 降至 15K
- P2: 增量 lookups 增加 lastAssistantMsgId 一致性检查和 orphaned server_tool_use/mcp_tool_use 扫描,防止 UI 永久 loading
- P3: reactiveCompact 类型断言改为直接使用 'compact' 字面量
- docs: CLAUDE.md 统一使用 precheck 替代分散的 typecheck/lint/test 命令
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 20:32:00 +08:00
claude-code-best
7e253151f7
Merge pull request #403 from ymonster/fix/deepseek-empty-reasoning-content
...
fix: 保留 DeepSeek v4 thinking mode 的空 reasoning_content (#399 )
2026-05-02 16:02:06 +08:00
ymonster
35812d8c8d
fix: preserve empty reasoning_content for DeepSeek v4 thinking mode ( #399 )
...
DeepSeek v4 in thinking mode sometimes returns reasoning_content: ""
when the model answers directly without internal reasoning. Two places
were filtering the empty string out, which dropped the thinking block
from the assistant turn entirely. The next request then omitted
reasoning_content for that prior turn, and DeepSeek rejected with
400 "reasoning_content ... must be passed back to the API".
Fix:
- openaiStreamAdapter: open a thinking block whenever reasoning_content
is present (including ""); skip the empty thinking_delta event since
the empty value is already conveyed by the block's initial state.
- openaiConvertMessages: preserve empty thinking blocks as
reasoning_content: "" when serializing assistant messages back to
the OpenAI/DeepSeek format.
Tests:
- New: empty reasoning_content opens a thinking block (adapter).
- Updated: empty thinking blocks now round-trip as reasoning_content: ""
instead of being dropped.
- New: assistant messages with no thinking block still omit
reasoning_content (regression guard for non-thinking models).
2026-05-02 14:58:29 +08:00
claude-code-best
07939b7874
fix: 内存优化 — FileReadTool 100KB 上限、lookups 缓存、microcompact 替换清理
...
- FileReadTool maxResultSizeChars 从 Infinity 改为 100KB,大文件持久化到磁盘
- Messages.tsx 新增 computeMessageStructureKey 缓存,流式 delta 时跳过 8 个 Map/Set 重建
- microcompact 返回 clearedToolUseIds,query.ts 消费后清理 replacements Map 释放原始字符串
- 更新内存分析报告 Round 5 和 file-operations 文档
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 11:21:22 +08:00
claude-code-best
e90f5b16ed
fix: 优化内存峰值与 CPU 性能,降低 100-300MB 内存占用
...
- claude.ts: 流式字符串拼接从 O(n²) += 改为数组累积 join,消除 4 处热点
- Messages.tsx: 合并 3 组独立遍历为单次 pass(thinking/bash 查找、3-filter 链、divider/selectedIdx)
- HighlightedCode.tsx: ColorFile 实例添加模块级 LRU 缓存(50 条),避免重复创建
- screen.ts: StylePool 衍生缓存添加 1000 条上限淘汰,防止无界增长
- CompanionSprite.tsx: TICK_MS 从 500ms 提升至 1000ms,减少 setState 频率
- connection.ts: MCP stderr 缓冲从 64MB 降至 8MB
- stringUtils.ts: MAX_STRING_LENGTH 从 32MB 降至 2MB
- sessionStorage.ts: Transcript 写入队列添加 1000 条上限
- query.ts: spread 改 concat 减少一次数组拷贝
- PromptInputFooterLeftSide.tsx: 显示进程 pid 便于调试
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 00:45:03 +08:00
claude-code-best
bb9cc57ea3
style: 添加 biome-ignore 消除 noUnusedPrivateClassMembers 警告
...
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 22:01:54 +08:00
claude-code-best
a16afdbf78
fix: 修复 tsc 类型错误,通过 CI typecheck 阶段
...
- bridgeClient.ts: 添加缺失的 pairingInProgress 属性声明
- ink.tsx: 移除 5 处不再需要的 @ts-expect-error,保留 1 处 MACRO 比较
- client.ts: 添加缺失的 pendingSessionTarget 属性声明
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 22:00:29 +08:00
claude-code-best
f8480358ca
style: 格式化 packages/@ant/ 下所有文件以通过 biome ci
...
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 21:55:51 +08:00