Conversation
📝 WalkthroughWalkthroughModified skill runtime instruction generation to use metadata-based skill root references instead of environment variables, restructured agent tool execution to handle Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/main/presenter/toolPresenter/agentTools/agentToolManagerSkillAccess.test.ts (1)
77-116: Consider adding cleanup in afterEach.The test creates temporary directories that aren't cleaned up after each test. While
os.tmpdir()is eventually cleared by the OS, explicit cleanup improves test hygiene and prevents potential issues with test isolation.♻️ Suggested cleanup
beforeEach(async () => { vi.clearAllMocks() workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), 'deepchat-skill-workspace-')) skillsDir = await fs.mkdtemp(path.join(os.tmpdir(), 'deepchat-custom-skills-')) // ... rest of setup }) + + afterEach(async () => { + await fs.rm(workspaceDir, { recursive: true, force: true }).catch(() => {}) + await fs.rm(skillsDir, { recursive: true, force: true }).catch(() => {}) + })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/main/presenter/toolPresenter/agentTools/agentToolManagerSkillAccess.test.ts` around lines 77 - 116, Add an afterEach cleanup to remove the temporary directories created in beforeEach (workspaceDir and skillsDir) to avoid leftover files; implement an async afterEach that checks for non-null workspaceDir and skillsDir and calls fs.rm (or fs.rmSync) with recursive: true and force: true (or equivalent) to delete them, ensuring any errors are handled or ignored, and include this cleanup alongside the existing vi.clearAllMocks to fully restore test state for the tests in agentToolManagerSkillAccess.test.ts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@test/main/presenter/toolPresenter/agentTools/agentToolManagerSkillAccess.test.ts`:
- Around line 77-116: Add an afterEach cleanup to remove the temporary
directories created in beforeEach (workspaceDir and skillsDir) to avoid leftover
files; implement an async afterEach that checks for non-null workspaceDir and
skillsDir and calls fs.rm (or fs.rmSync) with recursive: true and force: true
(or equivalent) to delete them, ensuring any errors are handled or ignored, and
include this cleanup alongside the existing vi.clearAllMocks to fully restore
test state for the tests in agentToolManagerSkillAccess.test.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ba2bd952-7ab7-40d3-ace1-19953539fdf7
📒 Files selected for processing (4)
src/main/presenter/skillPresenter/index.tssrc/main/presenter/toolPresenter/agentTools/agentToolManager.tstest/main/presenter/skillPresenter/skillPresenter.test.tstest/main/presenter/toolPresenter/agentTools/agentToolManagerSkillAccess.test.ts
close #1409
Summary by CodeRabbit
Refactor
Tests