Repository navigation
feat(hooks): WS1 补齐 DirectoryAdded hook + Notification agent_* 类型 - #73
Merged
dahai80 merged 1 commit intoAug 20, 2026
Merged
Conversation
对齐 Claude Code 2.1.196→2.1.234 Tier-1 hook 覆盖 (issue #71): DirectoryAdded (CC 2.1.219): - HookEvent union / HOOK_EVENTS const 加 DirectoryAdded (types.ts/coreTypes.ts/coreSchemas.ts) - DirectoryAddedHookInput + Schema (directory + source: repl_add_dir|cli_add_dir) - DirectoryAddedHookSpecificOutputSchema (watchPaths 注册 FileChanged watcher) - getHookEventMetadata / groupHooksByEventAndMatcher / loadPluginHooks 补 DirectoryAdded 键 - executeDirectoryAddedHooks dispatcher (fire-and-forget, 返回 watchPaths/systemMessages) - /add-dir REPL 触发点: SandboxManager.refreshConfig() 后触发 source=repl_add_dir Notification agent_completed/agent_needs_input (CC 2.1.198): - Notification matcher values 加 agent_completed + agent_needs_input - LocalAgentTask / LocalMainSessionTask 后台任务完成触发 agent_completed/agent_failed - useInboxPoller worker 权限 + 沙箱网络请求触发 agent_needs_input 验证: typecheck 0 错误 / build + build:dev:full 通过 / 453 测试通过 (含 13 新 WS1 单测) diff 纯增量 257+/1-, 零格式 churn (Rule 3 surgical) Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 20, 2026
dahai80
deleted the
feat/hook-coverage-directory-added-notification-agent
branch
August 20, 2026 12:00
dahai80
added a commit
that referenced
this pull request
Aug 20, 2026
CC 2.1.217 对齐: Agent 工具 spawn 前强制三类上限, 阻断失控子代理递归。 - FUSION_MAX_CONCURRENT_SUBAGENTS 默认 20: 运行中 local_agent 数上限 - FUSION_MAX_SUBAGENTS_PER_SESSION 默认 200: 会话累计 spawn 数上限, /clear 重置 - FUSION_MAX_SUBAGENT_SPAWN_DEPTH 默认 3: 嵌套 spawn 深度上限 新增 src/tools/AgentTool/subagentGuardrails.ts 封装三限 (parseCap fail-open: 非数/0/负值回退默认, 非静默阻断)。AgentTool.call() 解析 agent 后、sync/async 分发前插入校验, 超限 throw (与 fork/MCP guard 同路径)。AppState 增 subagentSpawnCount 字段, spawn 时 rootSetAppState 递增, clearConversation 重置。 维度 4 (budget cap --max-budget-tokens) + 维度 5 背景默认 + per-agent-budget-stop 延后单独 item。worktree 隔离 + agent_completed 通知已在 PR #73 落地。 15 单测 (env 解析/默认/无效回退/十进制截断, 计数, 三限拒绝/放行, 深度优先序, 运行时降限)。typecheck 0, 全测 455 pass, build + build:dev:full pass。 Closes #81 Co-authored-by: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 20, 2026
追 CC 2.1.196→2.1.234 Tier-1 特性批量落地 (13 PR): 变更自 v0.4.22: - WS1 DirectoryAdded hook + Notification agent_* 类型 (#73) - WS2 堆叠 slash-skill 调用, 最多 5 前导 (#74) - LSP+filecache 内存泄漏 cap, 对齐 CC 2.1.208 (#76) - skill body-defer 懒加载, item 9 (#78) - SessionStart source "fork" 区分 fork 与 resume (#80) - P2.1 子代理护栏 — 并发/会话/深度三限 (#82) - P1.1 大输出 tool_result tail 预览 (#84) - P4.1 --ax-screen-reader 入口点对齐 — env 别名 + settings key (#86) - item 13 WebSearch per-session 搜索次数上限 (#88) - P4.2 §6 /doctor FUSION_* vs ANTHROPIC_* 环境变量冲突检测 (#90) - P4.2 #1+#3 /doctor MLX 网关连通 + 模型加载探测 (#92) - item 4 MCP 工具自动后台化 FUSION_MCP_AUTO_BACKGROUND_MS (#94) - item 22 审计日志凭证脱敏 (#96) - package.json: version 0.4.22 → 0.4.23 Co-authored-by: Claude Fable 5 <[email protected]>
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
对齐 Claude Code 2.1.196→2.1.234 Tier-1 hook 覆盖。Closes #71。
本 PR 落地 WS1 (issue #71 的第一工作流): DirectoryAdded hook + Notification agent_completed/agent_needs_input 类型。WS2 (stacked slash-skills, issue #72) 单独 PR。
改动
DirectoryAdded (CC 2.1.219)
HookEventunion /HOOK_EVENTSconst 加DirectoryAdded(types.ts/coreTypes.ts/coreSchemas.ts)DirectoryAddedHookInput+ Schema:directory+source: 'repl_add_dir' | 'cli_add_dir'DirectoryAddedHookSpecificOutputSchema:watchPaths注册 FileChanged watcher (与 CwdChanged/FileChanged 一致)getHookEventMetadata/groupHooksByEventAndMatcher/loadPluginHooks补DirectoryAdded键executeDirectoryAddedHooksdispatcher: fire-and-forget, 返回{results, watchPaths, systemMessages}(镜像executeFileChangedHooks)/add-dirREPL 触发点:SandboxManager.refreshConfig()后触发source='repl_add_dir'--add-dir触发点 (main.tsx) 未加 — 发生在 session bootstrap 前, hook 系统未就绪;cli_add_dirsource 类型保留供未来使用Notification agent_completed/agent_needs_input (CC 2.1.198)
values加agent_completed+agent_needs_inputLocalAgentTask/LocalMainSessionTask后台任务完成触发agent_completed/agent_failed(与既有enqueuePendingNotification并行, 不同 matchQuery 不重复触发)useInboxPollerworker 权限请求 + 沙箱网络请求触发agent_needs_input(与既有worker_permission_prompt桌面通知并行)验证
bun run typecheck: 0 错误bun run build+bun run build:dev:full: 通过bun test src/__tests__/ tests/: 453 pass / 0 fail (含 13 新 WS1 单测tests/hooks/directory-added-notification.test.ts)测试
新增
tests/hooks/directory-added-notification.test.ts(13 用例):Co-Authored-By: Claude Fable 5 [email protected]