Skip to content

merge: sync upstream claude-code-best/claude-code (dad3ad2)#25

Merged
y574444354 merged 47 commits intomainfrom
sync/upstream-main
Apr 14, 2026
Merged

merge: sync upstream claude-code-best/claude-code (dad3ad2)#25
y574444354 merged 47 commits intomainfrom
sync/upstream-main

Conversation

@y574444354
Copy link
Copy Markdown
Owner

@y574444354 y574444354 commented Apr 14, 2026

Summary

同步上游主仓库 claude-code-best/claude-code 最新代码到 fork 仓库,整合 44 个上游提交(eeb0f27..dad3ad2),解决 11 个冲突文件。

上游新功能

功能 PR/提交
工具层及 mcp 大重构 claude-code-best#252
远程群控 claude-code-best#243
Langfuse 监控支持 claude-code-best#242
MCP-Chrome 接入版本 e770f1e
模型 1M 上下文切换 ffd1c36
Langfuse 工具调用嵌套结构 05cabbb
userId 传递 fce40fe
Ultraplan Feature claude-code-best#232
Brave WebSearchTool 7114404
全部类型问题解决 6a70056

上游 Bug 修复

  • fix: 修复 Bun.hash 不存在问题
  • fix: 修复缓存
  • fix: 修复 interrupt 日志不上传
  • fix: 修复 chrome 链接版本
  • fix: 使用简化版本的 chrome 桥接器
  • fix: 修复 node 环境没有 bun 的问题
  • fix: 修复穷鬼模式的写入问题
  • fix: 修复对穷鬼模式的 auto dream 和 session memory 越过
  • fix: 修复初次登陆的校验问题
  • fix(openai): fix stop_reason null, zero usage fields and max_tokens forwarding
  • fix: 修复截图 MIME 类型硬编码导致 API 拒绝的问题
  • fix: 修复需要鉴权的问题

冲突解决策略

文件 决策
CLAUDE.md 保留 CoStrict Type Safety Guidelines
README.md 保留 CoStrict 品牌 + 安装命令,删除上游功能表(我们有自己的)
package.json 保留 @costrict/csc-beta / 4.0.4 + csc/csc-bun/claude-code-best bin
builtInAgents.ts 合并:上游 src/ 路径别名 + CoStrict agents import
ultraplan.tsx 合并:CoStrict 品牌描述 + 上游 getDialogConfig().usageBlurb
ModelPicker.tsx 合并:上游 1M context 功能 + CoStrict 品牌
Onboarding.tsx 删除上游注释代码(已无意义)
UltraplanLaunchDialog.tsx 合并:上游 getDialogConfig + CoStrict 品牌链接
cli.tsx 合并:保留 DISABLE_NONESSENTIAL_TRAFFIC + 上游 FORCE_INTERACTIVE TTY 修复
preflightChecks.tsx 保留 CoStrict 品牌链接 + 简化错误提示
contributors.svg 采用上游版本(二进制文件)

变更规模

  • 825 files changed
  • 25,523 insertions(+)
  • 11,711 deletions(-)

Test plan

  • bun install 依赖安装正常
  • bun run dev 启动正常,版本号显示 4.0.4 (CoStrict)
  • /login 登录流程正常
  • ModelPicker 1M context 切换功能可用
  • /ultraplan 对话框显示正常
  • bun test 测试通过
  • bun run build 构建成功

claude-code-best and others added 30 commits April 10, 2026 12:11
…orwarding

- Fix stop_reason always null in assembled AssistantMessage by applying
  the value captured from message_delta event
- Reset partialMessage to null after message_stop to prevent duplicate
  AssistantMessage emission causing doubled content in next API request
- Forward computed maxTokens into buildOpenAIRequestBody as max_tokens
  so OpenAI-compatible endpoints receive the intended output cap
- Extract assembleFinalAssistantOutputs helper to deduplicate message
  assembly logic between message_stop handler and post-loop fallback
- Fix test helper to use events parameter instead of hidden global
- Add regression test for max_tokens request forwarding

Signed-off-by: guunergooner <tongchao0923@gmail.com>
基于源码验证和官方文档对照,修正三份 Agent 文档的内容准确性:

coordinator-and-swarm.mdx:
- 对齐官方术语:Leader→Team Lead, teammate→Teammate, 引入 Mailbox 消息系统
- 修正 Swarm 门控为 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1(原文"默认启用"不准确)
- 拓扑描述改为"星型+P2P混合"(官方有 Team Lead 角色,非纯网状)
- 新增架构组件表、Mailbox 消息系统、Hook 事件(TeammateIdle/TaskCreated/TaskCompleted)、限制说明
- 新增持久化存储路径(~/.claude/teams/, ~/.claude/tasks/)
- 移除虚构的"高水位标记"(claimTask 仅使用文件锁)
- 修正 Scratchpad 描述(Workers 获得,非 Coordinator 拥有)
- 修复引号不匹配

sub-agents.mdx:
- 修正为三路径路由(命名 Agent / Fork / GP 回退),原文仅两种
- 补充 isForkSubagentEnabled() 三前提(feature flag + 非Coordinator + 非非交互式)
- 新增模型解析优先级(4级链 + inherit 运行时解析)
- 新增内置 Agent 表(Explore/Plan/GP/statusline-setup/claude-code-guide)
- 新增 Hook 事件表(frontmatter + settings.json 双级别)
- 补充异步生命周期完整链路(finalizeAgentTool → getWorktreeResult)
- 补充 transcript 存储路径和结果格式细节

worktree-isolation.mdx:
- 区分 createWorktreeForSession vs createAgentWorktree 两种函数
- 修正清理机制为 cleanupWorktreeIfNeeded(非 ExitWorktreeTool 手动操作)
- 补充 usedSparsePaths 字段
…best#232)

* feat: add ultraplan feature for advanced multi-agent planning

Implement ultraplan command with web-based planning interface,
supporting multiple prompt modes and interactive plan approval.

* chore: add semi

* chore: add semi
* docs: 更新类型检查的 CLAUDE.md

* feat: 添加模型 1M 上下文切换

* chore: remove prefetchOfficialMcpUrls call on startup

* docs: 添加 git commit 规范

* feat: 第一次接入 langfuse

* fix: 修复 generation 的计时的错误

* feat: 添加多 agent 的监控

* feat: 添加 /poor 省流模式,toggle 关闭 extract_memories 和 prompt_suggestion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: 修复 lock 文件

* chore: 更新类型依赖

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: restore pipe IPC, LAN pipes, monitor tool, and PR-package features

Core IPC system (UDS_INBOX):
- PipeServer/PipeClient with UDS + TCP dual transport, NDJSON protocol
- PipeRegistry: machineId-based role assignment, file locking
- Master/slave attach, prompt relay, permission forwarding
- Heartbeat lifecycle with parallel isPipeAlive probes
- Commands: /pipes, /attach, /detach, /send, /claim-main, /pipe-status

LAN Pipes (LAN_PIPES):
- UDP multicast beacon (224.0.71.67:7101) for zero-config LAN discovery
- PipeServer TCP listener, PipeClient TCP connect mode
- Heartbeat auto-attaches LAN peers via TCP
- Cross-machine attach allowed regardless of role
- /pipes shows [LAN] peers with role + hostname/IP
- SendMessageTool supports tcp: scheme with user consent

Architecture — extracted hooks from REPL.tsx (~830 lines → ~20 lines):
- usePipeIpc: lifecycle (bootstrap, handlers, heartbeat, cleanup)
- usePipeRelay: slave→master message relay via module singleton
- usePipePermissionForward: permission request/cancel forwarding
- usePipeRouter: selected pipe input routing with role+IP labels
- Shared ndjsonFramer.ts replaces 3 duplicate NDJSON parsers

Key fixes applied during development:
- Multicast binds to correct LAN interface (not WSL/Docker)
- Beacon ref stored as module singleton (not Zustand state mutation)
- Heartbeat preserves LAN peers in discoveredPipes and selectedPipes
- Disconnect handler calls removeSlaveClient (fixes listener leak)
- cleanupStaleEntries probes without lock, writes briefly under lock
- getMachineId uses async execFile (not blocking execSync)
- globalThis.__pipeSendToMaster replaced with setPipeRelay singleton
- M key only toggles route mode when selector panel is expanded
- User prompt displayed in message list on pipe broadcast
- Broadcast notifications show [role] + hostname/IP for LAN peers

Other restored features:
- Monitor tool: /monitor command, MonitorTool, MonitorMcpTask lifecycle
- Daemon supervisor and remoteControlServer command
- Tools: SnipTool, SleepTool, ListPeersTool, SendUserFileTool,
  WebBrowserTool, WorkflowTool, and 10+ stub→implementation rewrites
- Feature flags: UDS_INBOX, LAN_PIPES, MONITOR_TOOL, FORK_SUBAGENT,
  KAIROS, COORDINATOR_MODE, WORKFLOW_SCRIPTS, HISTORY_SNIP

Tests: 2190 pass / 0 fail (15 new: lanBeacon 7, peerAddress 8)

* fix: resolve merge conflicts and fix all tsc/test errors after main merge

- Export ToolResultBlockParam from Tool.ts (14 tool files fixed)
- Migrate ink imports from ../../ink.js to @anthropic/ink (7 files)
- Fix toolUseID → toolUseId typo in monitor.ts and MonitorTool.tsx
- Add fallback values for string|undefined type errors (8 locations)
- Fix AppState type in assistant.ts, add NewInstallWizard stubs
- Fix ParsedRepository.repo → .name in subscribe-pr.ts
- Fix AgentId/string type mismatch in BackgroundTasksDialog.tsx
- Fix PipeRelayFn return type in pipePermissionRelay.ts
- Use PipeMessage type in usePipeRelay.ts
- Fix lanBeacon.test.ts mock type assertions
- Create missing MouseActionEvent class for ink package
- Use ansi: color format instead of bare "green"/"red"
- Resolve theme.permission access via getTheme()

Result: 0 tsc errors, 2496 tests pass, 0 fail

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: 恢复 /poor 的说明

---------

Co-authored-by: unraid <local@unraid.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…code-best#246)

- Add docs/features/all-features-guide.md — comprehensive guide covering
  all 18 features across 13 PRs (Buddy, Remote Control, Voice, Chrome,
  Computer Use, GrowthBook, Ultraplan, Daemon, Pipe IPC, LAN Pipes,
  Monitor, Workflow, Coordinator, Proactive, History/Snip, Fork, etc.)

- Rewrite docs/features/lan-pipes.md — user-facing guide with step-by-step
  quickstart, firewall config (Windows/macOS/Linux), command reference,
  keyboard shortcuts, routing modes, permission forwarding, FAQ

- Rewrite docs/features/lan-pipes-implementation.md — developer reference
  with updated architecture (hook extraction, ndjsonFramer, module singletons),
  corrected code references, NDJSON protocol spec, attach flow sequence

Co-authored-by: unraid <local@unraid.local>
macOS screencapture 输出 PNG,但代码硬编码 mimeType 为 image/jpeg,
导致 API 报错 "specified using image/jpeg but appears to be image/png"。
改为通过 magic bytes 检测实际图片格式。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
claude-code-best and others added 17 commits April 12, 2026 23:12
* feat: 第一版大重构

* fix: 修复类型问题

* chore: 更新版本到 1.3.2

* Add brave as alternative WebSearchTool

* fix: 修正顺序

* fix: 修复对穷鬼模式的 auto dream 和 session memory 越过

* feat: 穷鬼模式去除 session-summary

* feat: 创建 builtin-tools 包,搬运所有工具实现

将 src/tools/ 下的全部 60 个工具目录迁移至 packages/builtin-tools/src/tools/,
内部导入路径已更新为 src/ alias 模式。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 更新 src/ 中所有工具引用至 builtin-tools 包,删除 src/tools/

- src/tools.ts 及 178 个 src/ 文件的 import 路径从 ./tools/ 改为 builtin-tools/tools/
- 删除 src/tools/ 整个目录(已迁移至 packages/builtin-tools/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: 添加 builtin-tools 路径别名至 tsconfig,更新 bun.lock

- tsconfig.json 新增 builtin-tools/* 和 builtin-tools 路径映射
- 新增 packages/builtin-tools/src 至 include

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 为 builtin-tools、mcp-client、agent-tools 添加 @claude-code-best 作用域前缀

所有包名及 import 路径统一添加 @claude-code-best/ 前缀:
- builtin-tools → @claude-code-best/builtin-tools
- mcp-client → @claude-code-best/mcp-client
- agent-tools → @claude-code-best/agent-tools

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: 修复 node 环境没有 bun 的问题

---------

Co-authored-by: Eric-Guo <eric.guocz@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
同步上游主仓库最新代码,整合以下新功能:
- feat: 工具层及 mcp 大重构 (claude-code-best#252)
- feat: 远程群控 (claude-code-best#243)
- feat: 添加对 langfuse 监控的支持 (claude-code-best#242)
- feat: 完成第一个 mcp-chrome 接入版本
- feat: 添加模型 1M 上下文切换
- feat: langfuse 工具调用显示为嵌套结构
- feat: 加上 userId 的传递
- feat: Add Ultraplan Feature for Advanced Multi-Agent Planning (claude-code-best#232)
- feat: Add brave as alternative WebSearchTool
- fix: 修复 Bun.hash 不存在问题
- fix: 修复缓存
- fix: 修复 interrupt 日志不上传
- fix: 修复 chrome 链接版本
- fix: 使用简化版本的 chrome 桥接器
- fix: 修复 node 环境没有 bun 的问题
- fix: 修复穷鬼模式的写入问题
- fix: 修复对穷鬼模式的 auto dream 和 session memory 越过
- fix: 修复初次登陆的校验问题
- fix(openai): fix stop_reason null, zero usage fields and max_tokens forwarding
- chore: 1.3.3 版本
- docs: 添加浏览器说明支持

冲突解决策略:
- 保留 CoStrict 品牌、4.0.x 版本号、csc bin 命令
- 保留 CoStrict 企业认证体系和 Agent 编排
- 采用上游的 1M context、langfuse、chrome mcp、远程群控等新功能
- 采用上游的 getDialogConfig/promptIdentifier 模式
- 采用上游的 FORCE_INTERACTIVE TTY 修复
- 合并两者:保留 CoStrict 品牌名 + 上游新代码模式
@y574444354 y574444354 merged commit 7d51b87 into main Apr 14, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants