Skip to content

feat: add Claude Code integration and unified agent settings - #37

Merged
LRainner merged 2 commits into
masterfrom
codex/claude-code-integration
Aug 4, 2026
Merged

feat: add Claude Code integration and unified agent settings#37
LRainner merged 2 commits into
masterfrom
codex/claude-code-integration

Conversation

@LRainner

@LRainner LRainner commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Claude Code as a first-class Agent Cat integration with live task state, permission, tool, failure, subagent, compact, stop, and session events.
  • Refactor Hook installation, transport, verification, and event handling around explicit agent identities so additional agents can reuse the same infrastructure.
  • Consolidate the settings navigation into 通用 / 智能体 / 关于, with horizontal agent selection, locally bundled brand icons, and per-agent connection controls.
  • Move the animation tester into the general pet settings and update the English and Chinese documentation.

Claude Code integration

  • Install and remove Agent Cat command Hooks while preserving unrelated Claude Code settings and Hooks.
  • Support CLAUDE_CONFIG_DIR, falling back to the standard home-directory configuration.
  • Keep verification state and Hook fingerprints isolated by agent.
  • Include PostToolUseFailure and StopFailure in shared status handling.
  • Bundle Codex and Claude Code icons locally with their attribution and license metadata.

Review fixes

  • Keep the live-status window visible when Claude Code is the only enabled status source, including after moving the pet window.
  • Detect disableAllHooks and expose it as globallyDisabled.
  • Include the Claude global-disable state in the Claude-only verification fingerprint without changing existing Codex fingerprints.
  • Prevent a globally disabled Claude integration from appearing connected, disable its master switch, and show actionable UI guidance.

Validation

  • cargo fmt --check --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml — 56 passed
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • npm test — 65 passed
  • npm run build
  • npm run test:e2e — 9 passed
  • git diff --check

Summary by CodeRabbit

  • 新功能

    • 新增 Claude Code 集成,支持连接管理、Hook 安装与卸载、状态查询及事件测试。
    • 设置页新增“智能体”分类,可分别配置 Codex 与 Claude Code。
    • 支持实时状态、任务摘要、工具失败与任务失败提示,并显示全局 Hook 禁用状态。
    • 新增失败反馈动画及相关隐私说明。
  • 文档

    • 更新中英文项目简介、集成说明、隐私政策及图标许可信息。
  • 测试

    • 扩展设置、Hook、状态展示和会话事件相关测试覆盖。

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

项目新增 Claude Code 集成。Codex 与 Claude Code 现在共享智能体适配器、Hook 服务和设置界面,同时保留独立配置、事件、验证状态和操作流程。新增失败事件处理、回合生命周期处理、测试、文档和图标说明。

Changes

Claude Code 集成

Layer / File(s) Summary
智能体配置与事件契约
src-tauri/src/config.rs, src-tauri/src/hook_installer/*.rs, src/agents/*, src/types.ts
新增 Claude Code 配置、事件类型、适配器和 Hook 规格,并注册到智能体注册表。
按智能体管理 Hook 与事件
src-tauri/src/hook_installer.rs, src-tauri/src/hook_server.rs, src-tauri/src/hook_verification.rs, src-tauri/src/lib.rs
Hook 安装、卸载、命令识别、指纹验证、事件转发、运行状态和 CLI 命令均支持 Codex 与 Claude Code。
智能体设置界面
src/settings.html, src/settings.ts, src/styles.css, e2e/settings.e2e.ts, e2e/readme-screenshots.screenshot.ts
设置页新增智能体导航和 Claude Code 面板。界面支持独立连接、Hook 操作、状态显示、配置选项和全局禁用提示。
失败事件与回合生命周期
src/live-status.ts, src/reaction-controller.ts, src/terminal-event-ledger.ts, src/*test.ts
新增 PostToolUseFailureStopFailure 的状态、失败反应和回合结束处理。无 turnId 的会话在新提示后恢复事件处理。
集成文档与图标说明
README.md, README.zh-CN.md, assets/agent-icons/*
文档说明两种集成、Hook 操作和 transcript 隐私范围。图标文档记录 SVG 来源、许可证和商标声明。

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeCode
  participant hook_server
  participant live_status
  participant settings
  ClaudeCode->>hook_server: 发送智能体事件
  hook_server->>live_status: 转发规范化事件
  live_status->>settings: 更新运行状态
  settings-->>ClaudeCode: 显示连接与事件状态
Loading

Possibly related PRs

  • LRainner/AgentCat#23:扩展 terminal-event-ledgerlive-statusreaction-controller 的会话与回合生命周期处理。
  • LRainner/AgentCat#28:延伸 Hook 验证、安装器、服务、设置页和 E2E 模拟基础设施。
  • LRainner/AgentCat#36:基于智能体适配器和共享集成基础设施新增 Claude Code 支持。
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.66% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了新增 Claude Code 集成和统一智能体设置的主要变更。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (7)
src-tauri/src/hook_installer/claude_code.rs (1)

16-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建议去掉 expect,用显式错误代替。

当前分支在 settings_path 返回 None 时调用 expect。虽然此处 home 一定是 Some,但该不变量依赖 settings_path 的内部实现。若后续修改 settings_path,此处会 panic。可用 ok_or_else 返回错误,保持函数的 Result 契约。

♻️ 建议的重构
 pub(super) fn spec() -> Result<HookSpec, String> {
     let config_dir = std::env::var_os("CLAUDE_CONFIG_DIR");
-    let path = if let Some(path) = settings_path(config_dir.as_deref(), None) {
-        path
-    } else {
-        settings_path(None, Some(&config::home_dir()?)).expect("home path is present")
-    };
+    let path = match settings_path(config_dir.as_deref(), None) {
+        Some(path) => path,
+        None => settings_path(None, Some(&config::home_dir()?))
+            .ok_or_else(|| "无法确定 Claude Code 配置路径".to_string())?,
+    };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/src/hook_installer/claude_code.rs` around lines 16 - 22, Update
spec’s fallback settings_path handling to remove expect("home path is present")
and convert a None result into an explicit Err via ok_or_else, preserving the
function’s Result<HookSpec, String> contract and returning a descriptive error
instead of panicking.
src/settings.ts (3)

391-398: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

建议复用 integrationIds 常量。

这两处重复写出 ["codex", "claude-code"] as const,而 Line 24 已定义 integrationIds。若以后新增智能体,需要修改三处。请改为遍历 integrationIds

♻️ 建议的改动
-  for (const agent of ["codex", "claude-code"] as const) {
+  for (const agent of integrationIds) {
     const definition = integrationDefinitions[agent];
-for (const agent of ["codex", "claude-code"] as const) {
+for (const agent of integrationIds) {
   const definition = integrationDefinitions[agent];

Also applies to: 683-700

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.ts` around lines 391 - 398, Reuse the existing integrationIds
constant in both affected loops instead of repeating the literal ["codex",
"claude-code"] as const. Update the loops around integrationConfig(agent) and
the corresponding block near the alternate occurrence so adding an agent only
requires changing integrationIds.

825-837: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

建议对 refreshHookStatus 增加去抖。

事件监听器对每个到达的智能体事件调用 refreshHookStatus。每次调用发起 hook_statushook_runtime_status 两个 IPC 请求。后端 hook_installer::status 会读取并解析该智能体的 Hook 配置文件。

在活跃任务期间,PreToolUsePostToolUse 事件频繁到达。加上 Line 834 的 5 秒定时刷新,磁盘读取会累积。建议对每个智能体加入短去抖窗口(例如 300ms),合并连续事件。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.ts` around lines 825 - 837, 为 refreshHookStatus 增加按智能体独立的短去抖机制(约
300ms),使 AGENT_EVENT_CHANNEL 监听器和 5 秒 healthTimer 在窗口内的连续刷新请求合并执行;保留事件对 codex 与
claude-code 的现有筛选和最终状态刷新行为,并在 refreshHookStatus 附近复用统一的去抖调度逻辑。

543-550: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

建议用 displayName 替换硬编码的 "Claude Code" 文案。

这些分支对任意 agent 执行,但文案固定写 "Claude Code"。当前后端只对 Claude Code 返回 globallyDisabled: true,所以显示结果正确。该正确性依赖后端实现,属隐式耦合。若以后其他智能体也支持全局禁用,Codex 卡片会显示 Claude Code 文案。

建议改用已有的 displayName 变量,例如 ${displayName} 已全局禁用所有 Hooks。同样适用于 Line 747、779、798 的提示文案。

Also applies to: 565-569

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/settings.ts` around lines 543 - 550, Replace the hard-coded “Claude Code”
text in the hook status messages assigned to linkControl.title and
hookElement.textContent with the existing displayName interpolation, including
the corresponding messages at the other referenced status-message branches.
Preserve the existing global-disable behavior and wording while making each
agent’s UI use its own displayName.
e2e/readme-screenshots.screenshot.ts (1)

42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

建议让 mock 按 agent 参数返回数据。

hook_status mock 忽略 agent 参数,对两个智能体都返回 ~/.codex/hooks.json11/11。Claude Code 的真实期望事件数为 13。

同时 Line 42 把 claudeCode.hooksEnabled 设为 false。结合已安装的 mock 状态,refreshHookStatus 会让 Claude Code 卡片进入"已暂停"分支(见 src/settings.ts Line 570)。请确认 README 截图需要该状态。若需要"已连接",请把 hooksEnabled 设为 true,并按 agent 返回对应路径与事件数。

Also applies to: 80-88

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/readme-screenshots.screenshot.ts` at line 42, Update the hook_status mock
used by the README screenshot to branch on the agent parameter, returning the
Codex hook path and 11/11 counts for Codex and the Claude hook path and 13/13
counts for Claude Code. In the claudeCode configuration, set hooksEnabled to
true if the screenshot should show the connected state; otherwise confirm and
preserve the intended paused state.
src-tauri/src/hook_server.rs (1)

374-382: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

建议缓存验证指纹,减少每事件的磁盘读取。

emit_event 对每个真实事件调用 hook_verification::recordrecord 会调用 verification_fingerprint(agent),该函数读取并解析该 agent 的 Hook 配置文件,随后 record 再读取一次验证状态文件。该工作发生在 Hook 接收线程上。

本次改动使两个 agent 都进入这条路径,事件量随之上升。PreToolUsePostToolUse 频率较高,磁盘读取会累积。建议在指纹已验证后跳过重复读取,或按 agent 缓存指纹并按文件 mtime 失效。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/src/hook_server.rs` around lines 374 - 382, 优化 emit_event 调用的
hook_verification::record 与 verification_fingerprint 流程:按 agent
缓存已验证的指纹,避免每个真实事件重复读取和解析 Hook 配置及验证状态文件;当配置文件 mtime
变化时使缓存失效并重新验证,保持现有验证结果与错误处理行为。
src-tauri/src/hook_verification.rs (1)

41-48: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

建议校验 agent 后再拼接文件名。

pathagent 直接插入文件名。agent 源自 Tauri 命令参数。目前所有调用方(verified_atrecordclear)都先经过 hook_installer::verification_fingerprinthook_installer::install,这两者会对未知 agent 返回错误,因此路径遍历当前不可达。

该保护是隐式的。若以后新增直接调用 path 的入口,含 ../ 或路径分隔符的 agent 会写到配置目录之外。建议在 path 内做一次显式校验。

🛡️ 建议的防御性改动
 fn path(agent: &str) -> Result<std::path::PathBuf, String> {
+    if !matches!(agent, hook_installer::CODEX | hook_installer::CLAUDE_CODE) {
+        return Err(format!("不支持的 Agent:{agent}"));
+    }
     let name = if agent == hook_installer::CODEX {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/src/hook_verification.rs` around lines 41 - 48, 在 path 函数内部显式校验
agent,仅允许受支持且不会包含路径遍历片段或路径分隔符的值;对无效 agent 返回错误后再拼接文件名。保留 hook_installer::CODEX
的特殊文件名及其他合法 agent 的现有命名规则。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/terminal-event-ledger.ts`:
- Around line 47-50: Update the terminalSession.turnEnded branch in the
event-filtering logic to validate payload.timestamp before allowing
startsSession, UserPromptSubmit, or SessionEnd events without a turnId; reject
stale events while preserving the existing handling for current events. Add
regression coverage in terminal-event-ledger.test.ts for late UserPromptSubmit
and SessionStart events, ensuring they cannot clear the ended session and allow
subsequent stale PostToolUse events.

---

Nitpick comments:
In `@e2e/readme-screenshots.screenshot.ts`:
- Line 42: Update the hook_status mock used by the README screenshot to branch
on the agent parameter, returning the Codex hook path and 11/11 counts for Codex
and the Claude hook path and 13/13 counts for Claude Code. In the claudeCode
configuration, set hooksEnabled to true if the screenshot should show the
connected state; otherwise confirm and preserve the intended paused state.

In `@src-tauri/src/hook_installer/claude_code.rs`:
- Around line 16-22: Update spec’s fallback settings_path handling to remove
expect("home path is present") and convert a None result into an explicit Err
via ok_or_else, preserving the function’s Result<HookSpec, String> contract and
returning a descriptive error instead of panicking.

In `@src-tauri/src/hook_server.rs`:
- Around line 374-382: 优化 emit_event 调用的 hook_verification::record 与
verification_fingerprint 流程:按 agent 缓存已验证的指纹,避免每个真实事件重复读取和解析 Hook
配置及验证状态文件;当配置文件 mtime 变化时使缓存失效并重新验证,保持现有验证结果与错误处理行为。

In `@src-tauri/src/hook_verification.rs`:
- Around line 41-48: 在 path 函数内部显式校验 agent,仅允许受支持且不会包含路径遍历片段或路径分隔符的值;对无效 agent
返回错误后再拼接文件名。保留 hook_installer::CODEX 的特殊文件名及其他合法 agent 的现有命名规则。

In `@src/settings.ts`:
- Around line 391-398: Reuse the existing integrationIds constant in both
affected loops instead of repeating the literal ["codex", "claude-code"] as
const. Update the loops around integrationConfig(agent) and the corresponding
block near the alternate occurrence so adding an agent only requires changing
integrationIds.
- Around line 825-837: 为 refreshHookStatus 增加按智能体独立的短去抖机制(约 300ms),使
AGENT_EVENT_CHANNEL 监听器和 5 秒 healthTimer 在窗口内的连续刷新请求合并执行;保留事件对 codex 与
claude-code 的现有筛选和最终状态刷新行为,并在 refreshHookStatus 附近复用统一的去抖调度逻辑。
- Around line 543-550: Replace the hard-coded “Claude Code” text in the hook
status messages assigned to linkControl.title and hookElement.textContent with
the existing displayName interpolation, including the corresponding messages at
the other referenced status-message branches. Preserve the existing
global-disable behavior and wording while making each agent’s UI use its own
displayName.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 017fd08c-c1f2-4ee8-9618-2e8b6de88db4

📥 Commits

Reviewing files that changed from the base of the PR and between 1b62b55 and 356b88c.

⛔ Files ignored due to path filters (2)
  • assets/agent-icons/claude-code.svg is excluded by !**/*.svg
  • assets/agent-icons/codex.svg is excluded by !**/*.svg
📒 Files selected for processing (29)
  • README.md
  • README.zh-CN.md
  • assets/agent-icons/LICENSE.lobe-icons
  • assets/agent-icons/README.md
  • e2e/readme-screenshots.screenshot.ts
  • e2e/settings.e2e.ts
  • src-tauri/src/config.rs
  • src-tauri/src/hook_installer.rs
  • src-tauri/src/hook_installer/claude_code.rs
  • src-tauri/src/hook_installer/codex.rs
  • src-tauri/src/hook_installer/unix.rs
  • src-tauri/src/hook_installer/windows.rs
  • src-tauri/src/hook_server.rs
  • src-tauri/src/hook_verification.rs
  • src-tauri/src/lib.rs
  • src/agents/claude-code.ts
  • src/agents/registry.test.ts
  • src/agents/registry.ts
  • src/agents/types.ts
  • src/live-status.test.ts
  • src/live-status.ts
  • src/reaction-controller.test.ts
  • src/reaction-controller.ts
  • src/settings.html
  • src/settings.ts
  • src/styles.css
  • src/terminal-event-ledger.test.ts
  • src/terminal-event-ledger.ts
  • src/types.ts

Comment thread src/terminal-event-ledger.ts
@LRainner

LRainner commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

@monkeyscan review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/terminal-event-ledger.test.ts (1)

84-87: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

让测试覆盖 recordActivity 的状态转换。

这两个用例只调用 shouldIgnore。它们没有模拟事件入口在结果为 false 时调用 recordActivity。因此,测试没有直接验证迟到事件被错误放行后会清除 turnEnded,以及后续 PostToolUse 是否仍被拒绝。

请按生产顺序处理事件:调用 shouldIgnore,仅在返回 false 时调用 recordActivity,然后断言后续 PostToolUse 仍被忽略。

建议的最小修改
-    expect(ledger.shouldIgnore(claudeEvent("UserPromptSubmit", 1))).toBe(true);
+    const stalePrompt = claudeEvent("UserPromptSubmit", 1);
+    const promptIgnored = ledger.shouldIgnore(stalePrompt);
+    if (!promptIgnored) ledger.recordActivity(stalePrompt);
     expect(ledger.shouldIgnore(claudeEvent("PostToolUse", 2))).toBe(true);
+    expect(promptIgnored).toBe(true);

-    expect(ledger.shouldIgnore(claudeEvent("SessionStart", 1))).toBe(true);
+    const staleSessionStart = claudeEvent("SessionStart", 1);
+    const sessionStartIgnored = ledger.shouldIgnore(staleSessionStart);
+    if (!sessionStartIgnored) ledger.recordActivity(staleSessionStart);
     expect(ledger.shouldIgnore(claudeEvent("PostToolUse", 2))).toBe(true);
+    expect(sessionStartIgnored).toBe(true);

Also applies to: 99-102

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/terminal-event-ledger.test.ts` around lines 84 - 87, Update the test
around ledger.shouldIgnore and recordActivity to process events in production
order: call shouldIgnore for each event and invoke recordActivity only when it
returns false. Assert that the late UserPromptSubmit does not clear the
ended-turn state and that the subsequent PostToolUse remains ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/terminal-event-ledger.test.ts`:
- Around line 84-87: Update the test around ledger.shouldIgnore and
recordActivity to process events in production order: call shouldIgnore for each
event and invoke recordActivity only when it returns false. Assert that the late
UserPromptSubmit does not clear the ended-turn state and that the subsequent
PostToolUse remains ignored.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b3428762-8336-413d-9201-354a2b209ac8

📥 Commits

Reviewing files that changed from the base of the PR and between 356b88c and 305a336.

📒 Files selected for processing (2)
  • src/terminal-event-ledger.test.ts
  • src/terminal-event-ledger.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/terminal-event-ledger.ts

@LRainner
LRainner merged commit f8a15bb into master Aug 4, 2026
8 checks passed
@LRainner
LRainner deleted the codex/claude-code-integration branch August 4, 2026 12:00
@yorkew-east8

Copy link
Copy Markdown

@monkeyscan review 下这个 PR

@monkeyscan

monkeyscan Bot commented Aug 4, 2026

Copy link
Copy Markdown

@yorkew-east8 wrote:
@monkeyscan review 下这个 PR

收到,我正在处理中,完成后会更新结果。

@monkeyscan

monkeyscan Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Title: feat: add Claude Code integration and unified agen...

Commit: 305a336

本次 PR 为 Agent Cat 引入 Claude Code 集成,与现有 Codex 集成并行运行。主要变更包括:

  1. 多 Agent 架构:将 hook_installer、hook_server、hook_verification 从单 Agent(Codex)改造为多 Agent 架构,通过 agent 参数区分不同 Agent 的配置路径和事件集合。
  2. Claude Code Hook 安装:新增 hook_installer/claude_code.rs,支持向 ~/.claude/settings.json 安装 hooks,处理 CLAUDE_CONFIG_DIR 环境变量,并识别 Claude Code 特有的 13 个事件(含 PostToolUseFailureStopFailure)。
  3. Hook Server 改造LATEST_REAL_EVENT 改为 LATEST_REAL_EVENTS HashMap,按 agent 存储最新事件;test_eventsend_hook_payload 均需传入 agent 参数。
  4. 前端设置页重构:设置页从 "codex" 改为 "agents",新增侧边栏导航切换 Codex/Claude Code,UI 组件通过 integrationDefinitions 配置化复用。
  5. 新事件支持:新增 PostToolUseFailureStopFailure 事件类型,前端 live-status.tsreaction-controller.ts 添加对应展示逻辑和动画反应。
  6. Terminal Event Ledger 修复:针对 Claude Code 无 turnId 的场景,新增 turnEnded 状态防止回合结束后收到迟到的旧事件。
  7. 跨平台命令生成:Unix/Windows 的 hook 命令生成函数新增 agent 参数,Windows 下使用单引号包裹 agent 名称。

整体评估:架构设计合理,将 Agent 相关逻辑抽象为 HookSpecAgentAdapter 是正确的方向。测试覆盖较充分,但部分边界条件(如 hook 验证文件路径变更的向后兼容性、多 Agent 并发时的状态隔离)值得深入检查。

@monkeyscan

monkeyscan Bot commented Aug 4, 2026

Copy link
Copy Markdown

@yorkew-east8 wrote:
@monkeyscan review 下这个 PR

已触发 PR Review,完成后会在当前 PR 中发布评审结果。

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.

2 participants