Commit Graph

980 Commits

Author SHA1 Message Date
geroge
0e01c5a02f
Merge pull request #44 from Askhz/fix/disable-fork-subagent-default
fix: 默认关闭 FORK_SUBAGENT feature flag
2026-05-08 09:35:46 +08:00
geroge
85aaeb9a7a
Merge pull request #43 from y574444354/feat/migrate-review-agents
feat: migrate review agents to unified costrict-review repo
2026-05-08 09:35:24 +08:00
林凯90331
dacbf1f7ab feat: migrate favorite command from opencode to csc
- Add /favorite REPL slash command with list/view/download/load/unload/uninstall

- Implement core favorite logic in src/costrict/favorite/ using createCoStrictFetch

- Extend GlobalConfig with agents and commands fields for config-layer storage

- Adapt skill load/unload to csc's directory-scanning mechanism (~/.claude/skills/)

- Adapt MCP load/unload to csc's mcpServers config via saveGlobalConfig()

- Decouple from opencode-specific deps: jsonc-parser, Config.invalidate, Filesystem.*

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-08 08:20:57 +08:00
claude-code-best
b909af0963 chore: 2.2.1 2026-05-07 23:50:09 +08:00
claude-code-best
995bca4f27 Merge pull request #428 from xiaoFjun-eng/main
修复type
2026-05-07 22:31:12 +08:00
linkai0924
7363519887
Merge pull request #45 from y574444354/feat/report-raw-dump
feat(rawDump): add session data raw-dump reporting module
2026-05-07 22:16:02 +08:00
林凯90331
f3ece2f469 refactor(rawDump): prevent 429 with queue + batch worker
Replace per-turn detached workers with a file-backed queue consumed by
a single long-running batch worker (30s interval, 0-10s jitter).

- queue.ts, batchWorker.ts: file queue with pid-based lock for worker
  singleton; tasks deduped by sessionID:messageID before processing
- worker.ts: retry with backoff (5s, 10s) for 429 and network errors;
  update commit state per upload so partial failures resume cleanly;
  export auth, loadSessionMessages, getSessionDirectory and upload*
  helpers for batchWorker reuse
- git.ts: cap commit log at 50 entries within last 7 days; pause 500ms
  every 10 commits to spread load
- worker.ts: resolve session jsonl via ~/.claude/projects/{normalized}
  with fallbacks, scanning for the file containing the target session
- logger.ts: file + stderr logger gated by CSC_RAW_DUMP_DEBUG, default
  silent
- sessionDataUploader.ts: implement createSessionTurnUploader to pick
  the last assistant message; query.ts fires uploadSessionTurn after
  query_api_streaming_end (non-blocking)

Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-07 21:45:20 +08:00
kingboung
00e37eeccd fix: use new URL() for cwd path in build.ts review generation step
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:41:41 +08:00
林凯90331
28d4f1f4e5 feat(rawDump): add session data raw-dump reporting module
Introduce a framework-decoupled raw-dump module that uploads conversation, summary, and commits data to the CoStrict server in a non-blocking detached worker process.

- Add src/services/rawDump/ with index, types, state, spawn, git, worker, and README

- Implement reportTurn and reportSession entry points with in-memory dedup and env-based disable switch (CSC_DISABLE_RAW_DUMP / COSTRICT_DISABLE_RAW_DUMP)

- Replace sessionDataUploader stub with uploadSessionTurn that delegates to reportTurn

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-07 17:27:56 +08:00
Askhz
f8a4ae7083 fix: 默认关闭 FORK_SUBAGENT feature flag
开启时会强制所有 Agent 工具调用走异步路径,导致 run_in_background
参数失效,子 agent 始终在后台运行。如需启用请设置 FEATURE_FORK_SUBAGENT=1。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 17:20:59 +08:00
kingboung
083e2a7cfc chore: add gray-matter dependency for frontmatter parsing
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 17:04:08 +08:00
kingboung
49204031fb chore: remove superpowers docs directory
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:52:12 +08:00
claude-code-best
57c7445a15 chore: remove learn directory study notes
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-07 14:34:39 +08:00
claude-code-best
467720f78a feat: 改为使用 ccb 的邮箱 2026-05-07 12:06:40 +08:00
kingboung
a1d3a3db2d chore: untrack generated review builtin files from git index
Files are still present on disk and generated by build:review-builtin.
.gitignore rules prevent them from being re-committed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 11:49:07 +08:00
kingboung
3beeaa545e ci: add review agent generation step to build and CI
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 11:46:05 +08:00
claude-code-best
fd7173437b 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
3672413d40 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
f3c1ad8e98 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
8ca45ef63f 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
970425b360 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
18f1112ce1 feat: 添加 prompt 缓存命中率检测与警告功能
每次 API 请求后自动计算缓存命中率,低于阈值(默认 80%)时在对话流中显示黄色警告消息。
同时更新 /context 命令输出中显示缓存命中率。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 10:49:06 +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
kingboung
abf67ea914 feat: add generate-review-builtin script for unified review resource generation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 09:36:47 +08:00
kingboung
e4025f5d79 chore: add review module stubs and gitignore rules
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 09:34:18 +08:00
claude-code-best
1cfcfcb62e fix: 禁用 opus[1m] 自动迁移,尊重用户手动删除 [1m] 后缀的选择
迁移逻辑过于激进,用户手动删除 [1m]] 后会被自动加回。
现在将 migrateOpusToOpus1m 改为 no-op,保留用户的手动模型选择。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 09:33:56 +08:00
claude-code-best
87c0973bd1 feat: 开启部分被关闭的 feature 2026-05-07 09:14:58 +08:00
kingboung
65c347a151 docs: add design spec for migrating review agents to unified costrict-review repo
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 09:00:43 +08:00
claude-code-best
a977c07900 chore: 2.2.0 2026-05-07 08:29:07 +08:00
claude-code-best
a7ce9fccac feat: 启用 COORDINATOR_MODE feature flag
AgentSummary 30s fork 循环的内存泄露已在 commit 52b61c2c 修复(闭包
引用丢弃 + 上下文重建 + 消息/字符上限),重新启用该 feature。

用户可通过 /coordinator 命令或 CLAUDE_CODE_COORDINATOR_MODE=1 环境变量
激活多 worker 编排模式。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 08:28:28 +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
a75cc14415 Merge pull request #423 from znygugeyx-ctrl/feat/statusline-refresh-interval
feat: 状态栏支持 refreshInterval 定时刷新
2026-05-06 23:53:36 +08:00
zny
0c407e1804 feat: 状态栏支持 refreshInterval 定时刷新
- Zod schema 补齐 refreshInterval 字段
- 通过 scheduleUpdate 复用 300ms debounce,event/settings/time 三路触发单飞
- 新增 docs/features/status-line.mdx 调研文档
2026-05-06 22:50:11 +08:00
claude-code-best
f9343516d3 Merge pull request #419 from suger-m/codex/sub-agents-docs
docs: expand sub-agent architecture guide
2026-05-06 20:30:42 +08:00
claude-code-best
6c7b8698ba Merge pull request #420 from claude-code-best/fix/third-party-api-user-id
fix: third-party API user_id validation error (DeepSeek, etc.)
2026-05-06 20:30:12 +08:00
Simple6K
7ba5f7f6a1 fix: third-party API user_id validation error (DeepSeek, etc.)
When ANTHROPIC_BASE_URL points to a non-Anthropic endpoint (e.g.
DeepSeek), the JSON-formatted user_id containing {, ", : characters
fails validation against ^[a-zA-Z0-9_-]+$. Send only the hex device_id
for third-party providers.
2026-05-06 17:47:31 +08:00
suger-m
7cda486786 docs: expand sub-agent architecture guide 2026-05-06 17:26:49 +08:00
znygugeyx-ctrl
0ef78de0a7 Merge pull request #416 from znygugeyx-ctrl/feat/subagent-fork-render
feat: 参考 claude code 官方实现,改进 sub agent 以及 fork agent 的渲染方式
2026-05-06 09:57:52 +08:00
claude-code-best
04684692cd Merge pull request #417 from shaleloop/sync/mcp-transform-2.1.128
fix: align mcp transform pipeline with Anthropic Claude Code 2.1.128
2026-05-06 09:51:37 +08:00
shaleloop
b22bb0d769 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
cce60af985 chore: 2.1.0 2026-05-05 21:22:20 +08:00
claude-code-best
7f0f877e0b Merge pull request #413 from claude-code-best/performance/20260505/memory-leak-fix
feat: 继续进行内存泄露修复及垃圾代码清理
2026-05-05 21:21:22 +08:00
claude-code-best
2c7cfcf566 fix: 调小 snapshots 的范围 2026-05-05 21:09:02 +08:00
claude-code-best
d139edceda chore: 2.0.5 2026-05-05 20:16:44 +08:00
claude-code-best
0955a02348 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
bb7ea3a283 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
86fa5f81ad 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
bf0965da3e Merge pull request #412 from claude-code-best/feature/20260504/improve
feat: 内存碎片及死代码清理
2026-05-05 19:48:12 +08:00
claude-code-best
afdf72f6d8 feat: ai 的随机修复 2026-05-05 19:36:38 +08:00
claude-code-best
2192120646 feat: 尝试改进 Error 处理以提升内存管理效率 2026-05-05 18:18:13 +08:00