Commit Graph

1203 Commits

Author SHA1 Message Date
geroge
7178eac204
Merge pull request #116 from IronRookieCoder/fix/tasks-tool-arguments-repair
Fix/tasks tool arguments repair
2026-05-16 10:59:25 +08:00
geroge
d042115b6a
Merge pull request #115 from IronRookieCoder/fix-exit-terminal-state
Fix exit terminal state
2026-05-16 10:59:03 +08:00
geroge
b49678aaf0
Merge pull request #118 from IronRookieCoder/fix/agents-build-empty-list
Fix/agents build empty list
2026-05-16 10:58:08 +08:00
IronRookieCoder
aaeb662bee fix(agents): reload empty agent definitions in menu
## Bug 详情
生产构建后执行交互式 /agents 时,菜单可能从 AppState 读到空的 agentDefinitions,导致显示 No agents found;同一环境下 bun run dev 可以正常显示 agents。

## 根因
生产 bundle 中底层 agent loader 和内置 agents 均可用,但 /agents 动态菜单只消费启动时注入的 AppState.agentDefinitions。构建产物复现时该状态可能为空,菜单没有现场刷新兜底。

## 修复方案
在 AgentsMenu 打开时检测 allAgents 和 activeAgents 是否同时为空;为空时基于当前 cwd 调用 getAgentDefinitionsWithOverrides 重新加载并写回 AppState,正常已有 agents 的路径直接跳过。

## 变更要点
- 为 AgentsMenu 增加空 agentDefinitions 的 fallback reload
- 使用取消标记避免组件卸载后继续写状态
- 保持现有编辑、删除和正常 dev 路径不变

## 自测
- bun run build
- ./dist/cli-bun.js agents 可列出 27 active agents
- bun run typecheck 仍存在仓库既有类型错误,未新增 AgentsMenu 相关错误
2026-05-16 10:48:31 +08:00
IronRookieCoder
fd55d42048
Merge branch 'y574444354:main' into main 2026-05-16 09:08:18 +08:00
linkai0924
091d3a07d1
Merge pull request #117 from y574444354/fix/hub-command
fix(favorite): ensure /hub enabled skills appear in command list immediately
2026-05-15 22:49:22 +08:00
林凯90331
5bfaeb21bd fix(favorite): ensure /hub enabled skills appear in command list immediately
Replace incomplete clearSkillCaches() with clearCommandsCache() so the

loadAllCommands memoize layer is also busted when a cloud favorite skill is

enabled or disabled via /hub.

Add skillChangeDetector.notify() to trigger an immediate REPL command list

refresh instead of waiting for the file watcher to detect the change.

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 22:46:03 +08:00
IronRookieCoder
1b8e022522 fix(openai): recover missing streamed tool calls
## Bug 详情
OpenAI 兼容流在部分工具调用场景下会出现累计参数片段、复用 tool_calls index 或结束原因为 tool_calls 但缺少 tool_use 块,导致后续 TaskUpdate 等工具调用丢失或参数解析失败。

## 根因
OpenAI stream adapter 直接透传参数片段,无法区分累计快照和增量片段;同一 tool_calls index 被后端复用时也没有重开 tool_use 块。Task 工具参数 JSON 解析失败后统一退回空对象,query 主循环也没有对 stop_reason=tool_use 但无 tool_use 块的响应做恢复。

## 修复方案
在 OpenAI stream adapter 中去重累计参数并处理工具身份变化;仅对 Task 工具做窄范围参数修复,避免将无效 TaskUpdate 修复成 no-op;query 主循环发现缺失 tool_use 块时追加一次元消息让模型补发工具调用。

## 变更要点
- 修复 OpenAI 工具流参数快照去重和 tool_calls index 复用处理
- 增加 TaskCreate/TaskGet/TaskList/TaskUpdate 的解析失败窄范围容错
- 阻止无效 TaskUpdate status 或仅 taskId 输入被修复成空更新
- 增加缺失 tool_use 块的一次性 query recovery transition
- 补充 stream adapter、Task 参数修复和 query recovery 回归测试

## 自测
- bun test packages/@ant/model-provider/src/shared/__tests__/openaiStreamAdapter.test.ts src/utils/__tests__/messages.test.ts src/__tests__/queryMissingToolUseRecovery.test.ts
- bun run typecheck 当前仍失败,错误位于既有未改动文件。
2026-05-15 21:19:04 +08:00
IronRookieCoder
4aa15ac52a fix(terminal): clear Ink UI on REPL shutdown
## Bug 详情
使用 /exit 退出交互式 REPL 后,终端可能保留提示输入、命令补全或其他 Ink 临时 UI,导致 shell prompt 与旧 UI 重叠,出现光标和显示异常。

## 根因
shutdown 路径会恢复 raw mode、bracketed paste、focus reporting 等终端模式,但普通主屏幕 REPL 不会清理 Ink 当前占用的可见区域。进程退出前 React 也不一定能完成 /exit 输入清空后的重新渲染。

## 修复方案
在 Ink 实例中增加主屏幕 shutdown 清理方法,根据最后一帧和声明光标位置清除 Ink 占用区域;gracefulShutdown 在非 alternate-screen 场景调用该方法,alternate-screen 继续保留原有退出逻辑。

## 变更要点
- 新增 ERASE_TO_END_SCREEN CSI 常量用于从当前光标位置清到屏幕底部
- 增加 Ink.clearMainScreenForShutdown() 统一计算并清理主屏幕 REPL 区域
- 在 gracefulShutdown 的终端清理阶段区分 alternate-screen 和主屏幕 Ink 实例

## 自测
- 已运行局部 Biome 检查:bunx biome check packages/@ant/ink/src/core/ink.tsx packages/@ant/ink/src/core/termio/csi.ts src/utils/gracefulShutdown.ts
- 已通过 Bun 直接导入验证新增 Ink 方法和 gracefulShutdown 模块可解析
- 全量 typecheck/build 当前被既有无关问题阻断:ctx_viz/LogoV2/doubaoSTT 类型错误,以及 generate-review-builtin 访问 git@github.com:zgsm-ai/costrict-review.git 失败
2026-05-15 19:03:35 +08:00
DoSun
754157fd88
Merge pull request #114 from Askhz/fix/thinking-model-duplicate-response
fix(serve): skip thinking-only message fragments to prevent duplicate response in cs-cloud
2026-05-15 18:12:58 +08:00
Askhz
02899ce69f fix(serve): skip thinking-only message fragments to prevent duplicate response in cs-cloud
normalizeMessages() splits a multi-block AssistantMessage (e.g. [thinking,
text]) into one message per content block. When serve mode emits both the
thinking-only fragment and the text message as separate session.message events,
cs-cloud's adaptMessageEvent creates two assistant messages (one via the
streaming path, one via the non-streaming path), causing the response to appear
twice in the UI.

Fix: skip thinking-only normalized messages in normalizeMessage(), since the
thinking content is already rendered via the stream_event path.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 17:58:53 +08:00
github-actions[bot]
7f9d8ba78a chore(release): bump version to 4.1.0 2026-05-15 09:03:10 +00:00
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
linkai0924
0b271a7847
Merge pull request #86 from IronRookieCoder/fix-snip-tool
fix(builtin-tools): handle undefined message_ids in SnipTool.call()
2026-05-15 17:01:26 +08:00
linkai0924
8f1d3cebd9
Merge pull request #113 from y574444354/opt/mcp-detector
opt/mcp detector
2026-05-15 16:56:06 +08:00
林凯90331
c45544c066 fix(mcp): add availability hint for failed servers in list panel
Show 'failed (may be unavailable)' next to disconnected servers instead of plain 'failed'

Add footer note explaining unavailable servers cannot be used until reconnected

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 16:55:02 +08:00
linkai0924
d98b4d0cde
Merge pull request #112 from y574444354/opt/mcp-detector
fix(favorite): sync load/unload state and improve error visibility
2026-05-15 16:45:49 +08:00
林凯90331
b0f10760fe fix(favorite): sync load/unload state and improve error visibility
Clear listFavoriteItems cache after load/unload to ensure UI reflects latest state on next open

Filter defaultValue by Active status in cloud-enabled menu so unloaded items are not pre-selected

Surface specific error reasons instead of generic failure count in cloud-enabled menu

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 16:44:24 +08:00
linkai0924
d1f5ee72a5
Merge pull request #111 from y574444354/feat/upgrade-fix
fix(update): enhance failure diagnostics and prevent claude symlink deletion
2026-05-15 16:23:55 +08:00
林凯90331
c2d5077cf9 fix(update): enhance failure diagnostics and prevent claude symlink deletion
Add analyzeNpmError() to classify npm install failures (permission, network, missing package, locked file, etc.) and return InstallResult with errorCategory, suggestion, and raw npmStderr.

Display targeted troubleshooting steps with colored cause and fix suggestions when csc update fails.

Fix removeInstalledSymlink() to only delete symlinks pointing into our managed ~/.local/share/claude/versions/ directory, preventing accidental removal of user-installed claude binaries from other sources.

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 16:19:13 +08:00
linkai0924
2857e77065
Merge pull request #110 from y574444354/fix/rawdump-0515
fix(raw-dump): reverse commit order to prevent duplicate uploads
2026-05-15 15:39:54 +08:00
林凯90331
47aa3271be fix(raw-dump): reverse commit order to prevent duplicate uploads
Add --reverse to git log in getCommitLog so commits are returned
oldest-first. Previously, git log defaulted to newest-first, causing
the loop in uploadCommits to overwrite state with the oldest commit.
The next run then queried git log <oldest>..HEAD, re-fetching all
already-uploaded commits and triggering infinite duplicate uploads.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:38:08 +08:00
DoSun
4dc157e493
Merge pull request #108 from y574444354/fix/linux-cloud-hang
Fix/linux cloud hang
2026-05-15 14:56:48 +08:00
DoSun
0dc1f67a04 refactor: remove special handling for upgrade command, simplify logic
统一对所有 cloud 子命令先 ensureCsCloud 再执行,移除对 upgrade
的特殊判断,逻辑更清晰简洁。

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 14:53:01 +08:00
DoSun
bf62a5e118 fix: use process.argv to get raw args for cs-cloud to fix Linux hang issue
参考 opencode 实现,从 process.argv 重新获取原始参数,避免 commander 的
参数解析影响 cs-cloud 的正常运行。修复 Linux 上通过 csc cloud start
调用会卡住的问题。

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 14:49:49 +08:00
linkai0924
10ef26b1d4
Merge pull request #107 from y574444354/fix/raw-dump-ua
fix(raw-dump): add user-agent header to worker requests
2026-05-15 14:47:27 +08:00
IronRookieCoder
39106e4f9d
Merge branch 'main' into fix-snip-tool 2026-05-15 14:40:34 +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
林凯90331
3be987891b fix(raw-dump): add user-agent header to worker requests
Set User-Agent to csc/${version} in both auth() and authWithFallback()

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 14:33:33 +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
geroge
0007879cf4
Merge pull request #82 from IronRookieCoder/fix/issue-41
fix(cursor): handle ANSI wrapped line offset recovery
2026-05-15 14:31:48 +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
github-actions[bot]
de83394e8a chore(release): bump version to 4.0.26 2026-05-15 03:47:01 +00:00
linkai0924
7d38f3af4b
Merge pull request #106 from y574444354/fix/semver
fix(deps): move semver from devDependencies to dependencies
2026-05-15 11:44:22 +08:00
林凯90331
c0ff0fb716 fix(deps): move semver from devDependencies to dependencies
semver is required at runtime by the Node.js polyfill in cli-node.js

(globalThis.Bun.semver fallback) and by src/utils/semver.ts fallback.

Moving it to dependencies ensures it is installed during global npm install.

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 11:39:45 +08:00
github-actions[bot]
90f27f36d6 chore(release): bump version to 4.0.25 2026-05-15 03:18:45 +00:00
linkai0924
117a857b25
Merge pull request #105 from y574444354/fix/publish
ci(publish-npm): fix publish workflow
2026-05-15 11:18:01 +08:00
林凯90331
0641c2857f ci(publish-npm): remove --ignore-scripts from publish command
Allow lifecycle scripts to run during npm publish for both actual and dry-run releases.

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 11:17:07 +08:00
linkai0924
b90c8fc828
Merge pull request #104 from y574444354/fix/centos-input
fix(ink): treat newline as return and suppress favorite fetch error in TUI
2026-05-15 11:16:39 +08:00
林凯90331
675ebea846 ci(publish-npm): switch from vite build to default build
Replace bun run build:vite with bun run build in the publish workflow.

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

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 11:14:12 +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
github-actions[bot]
f2585ae08b chore(release): bump version to 4.0.24 2026-05-15 02:40:29 +00:00
DoSun
22c5c7a1bb
Merge pull request #103 from y574444354/fix/serve
Fix/serve
2026-05-15 10:38:57 +08:00
linkai0924
5eea9bac64
Merge pull request #102 from y574444354/feat/binary-archive
fix(workflow): use raw tag name for release and drop v prefix from ar…
2026-05-15 10:36:15 +08:00
林凯90331
5758b7dcef fix(workflow): use raw tag name for release and drop v prefix from artifact
Release now uses the exact tag name (e.g., v4.0.23 or 4.0.23) instead of reconstructing it.

Artifact filenames no longer include a v prefix (e.g., csc-4.0.23-linux-x64.tar.gz).

Existing releases will have new artifacts appended instead of recreated.

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:34:19 +08:00
DoSun
9f5502b4b6 fix: prevent SSE event cross-workspace leakage
- Register session cwd before publishing created event (was async void,
  causing cwd to be undefined during event dispatch)
- Fix EventBus cwd filter: skip events when sessionCwd is undefined
  instead of allowing them through unfiltered

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 10:34:06 +08:00
DoSun
196ff5ba21 feat: add task notification mode and skip review builtin option
- Add TASK_NOTIFICATION_TAG to distinguish task notifications from regular prompts
- Add SKIP_REVIEW_BUILTIN=1 env var to skip review builtin generation
  during dev/build for faster startup

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 10:34:05 +08:00
DoSun
e93a60264c fix: resolve session status and cross-workspace leakage issues
- Fix GET /session/status returning empty object due to missing await
  (c.json() was serializing Promise instead of resolved value)
- Add getEffectiveBusyStatus() to prioritize actual prompting state
- Supplement status responses with persisted sessions from loadedIndex
- Add strict cwd filtering to GET /session list to prevent
  sessions from appearing across multiple workspaces
- Add busy_status field to GET /session/:id response

This closes the issue where /conversations/status returns {} even
though /conversations shows running sessions, and prevents the same
session from appearing in multiple workspace requests.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 10:34:05 +08:00
DoSun
ad7bc194b2
Merge pull request #101 from y574444354/fix/some-task
fix: resolve serve command hanging in Node.js runtime
2026-05-15 10:33:36 +08:00