fix: harden process tools and validation#551
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates process tool contracts and execution, cross-platform process listing, path/config validation, test entrypoints, and related documentation and guidance. ChangesCore tooling updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ToolCaller
participant start_process
participant TerminalManager
participant ChildProcess
participant read_process_output
ToolCaller->>start_process: submit command and timeout
start_process->>TerminalManager: execute command
TerminalManager->>ChildProcess: spawn process
ChildProcess-->>TerminalManager: initial output, timeout, or error
TerminalManager-->>start_process: return result
ToolCaller->>read_process_output: request output by PID
read_process_output->>ChildProcess: retrieve additional output
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/test-edit-block-occurrences.js (1)
354-356: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the
runTestimport to the top of the file.The
import { runTest } from './exit-on-failure.js'at line 356 is placed after its usage at line 354. While ESM hoists imports so this works, it's inconsistent with the other test files in this PR (test-repl-interaction.jsline 7,test.jsline 7) which place the import at the top. Move it alongside the other imports for clarity and consistency.🤖 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 `@test/test-edit-block-occurrences.js` around lines 354 - 356, Move the `runTest` import in `test-edit-block-occurrences.js` to the top with the other imports for consistency. Update the module so `runTest` is declared before it is used in the `runTests`/`runTest(runTests)` flow, matching the pattern used in `test-repl-interaction.js` and `test.js`.
🤖 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/tools/process.ts`:
- Around line 55-66: The non-Windows process parsing path in process.ts is
missing the same PID validation used in the Windows branch. Update the
map/filter chain that builds ProcessInfo objects from ps aux output so malformed
lines with an invalid or NaN pid are discarded before returning results,
mirroring the existing Windows logic in the process listing function.
---
Nitpick comments:
In `@test/test-edit-block-occurrences.js`:
- Around line 354-356: Move the `runTest` import in
`test-edit-block-occurrences.js` to the top with the other imports for
consistency. Update the module so `runTest` is declared before it is used in the
`runTests`/`runTest(runTests)` flow, matching the pattern used in
`test-repl-interaction.js` and `test.js`.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0b325227-5814-479a-8c91-d27028e8b2b6
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (25)
FAQ.mdREADME.mdinstall-docker.ps1scripts/validate-tools-sync.jssrc/handlers/terminal-handlers.tssrc/server.tssrc/terminal-manager.tssrc/tools/config.tssrc/tools/edit.tssrc/tools/filesystem.tssrc/tools/improved-process-tools.tssrc/tools/process.tssrc/tools/schemas.tssrc/utils/usageTracker.tstest/exit-on-failure.jstest/test-allowed-directories.jstest/test-blocked-commands.jstest/test-default-shell.jstest/test-directory-creation.jstest/test-edit-block-occurrences.jstest/test-enhanced-repl.jstest/test-home-directory.jstest/test-repl-interaction.jstest/test-schema-regressions.jstest/test.js
Summary
Root causes
Validation
No business logic or release version was changed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests