Skip to content

fix(subagents): address MCP subagents follow-ups from #3232 review - #3253

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-3241-subagents-mcp-followups
Oct 1, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-3241-subagents-mcp-followups

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Closes #3241

Summary

  1. Duplicate-name warning uses the tool's resolved name. warnAboutDuplicateNames now runs after conversion and keys on ToolSubagent.getImportIdentity(), so a kimi-code.name override (and Kimi's lowercasing) is taken into account. A test covers two nested Kimi agents that clash only through the override. Note: Kimi Code's name schema rejects uppercase, so a Reviewer/reviewer pair cannot reach the warning (the conversion already fails); the override case is the reachable one.
  2. supportsNestedPaths test checks both directions. Targets flagged with supportsNestedPaths must equal the targets whose filePattern starts with **/.
  3. Security note. docs/reference/mcp-server.md now warns that MCP subagent put/delete follow a symlinked .rulesync even outside the project. No runtime warning was added: the MCP module logger is constructed with silent: true, so a warning would never surface.
  4. Quieter list. An intentionally skipped symlinked entry below .rulesync/subagents/ is logged at debug level instead of error (which ConsoleLogger prints even when silent). Real read failures still log at error.
  5. TOCTOU (documented, not changed). putSubagent on main already re-checks the path after each ensureDir and right before writing, so the remaining window is only between the final check and writeFileContent (and check → removeFile in delete). Closing it fully needs O_NOFOLLOW-style opens in the shared writeFileContent/removeFile helpers in src/utils/file.ts, which is a codebase-wide, POSIX-specific change outside the scope of this small follow-up.

Test plan

  • pnpm cicheck

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj

Key the nested duplicate-name warning on the name each tool resolves (Kimi Code override and lowercasing), check supportsNestedPaths in both directions, log intended symlink skips in MCP list at debug level, and document that MCP subagent writes follow a symlinked .rulesync outside the project.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
Only the intended symlink and outside-root skips are logged at debug level, and the docs warning now mentions directory creation and reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
@dyoshikawa
dyoshikawa merged commit e8f2f0b into main Oct 1, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-3241-subagents-mcp-followups branch October 1, 2026 14:45
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.

Subagents MCP tools: follow-ups from #3232 review

1 participant