Skip to content

feat: merge shell and process tools into unified process tool - #838

Merged
avoidwork merged 7 commits into
mainfrom
feat/merge-shell-process-tools
Aug 22, 2026
Merged

feat: merge shell and process tools into unified process tool#838
avoidwork merged 7 commits into
mainfrom
feat/merge-shell-process-tools

Conversation

@avoidwork

@avoidwork avoidwork commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Description

Merged the separate shell and process tools into a single unified process tool with action-based routing. Background processes now capture stdout/stderr at spawn time (fixing the previously broken log action that returned placeholder text). The standalone shell.js module has been removed and all functionality consolidated into process.js.

Files Changed

  • src/tools/process.js — Rewritten with unified action routing (start, wait, kill, log, write, pause, resume, list), foreground/background execution, and stdio capture via stdio: ["ignore", "pipe", "pipe"]
  • src/tools/shell.js — Deleted (functionality merged into process.js)
  • src/tools/index.js — Removed shell import, updated TOOL_PERMISSIONS (process now requires filesystem:exec + process:spawn), updated TOOL_CLASSIFICATIONS, removed from ORCHESTRATOR_TOOLS and TOOLS
  • src/agent/deepAgents.js — Replaced all shell references with process in agent classification maps
  • tests/unit/shell.test.js — Rewritten to test the unified process tool (action-based interface, foreground/background, lifecycle actions)
  • tests/unit/tool_index.test.js — Updated assertions to reflect shell removal and new process permission model
  • openspec/ — Archived the merge-shell-process-tools change and updated the unified-process-tool spec

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional change)
  • Performance improvement
  • CI / build / tooling

Testing

  • All existing shell tests migrated and rewritten for the unified process tool interface
  • Tests cover: foreground execution, background execution, command length enforcement, process lifecycle actions (log, wait, kill, write, pause, resume, list), error handling, and permission gating
  • Tool index tests updated to verify shell removal and new process permission requirements

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Add OpenSpec proposal, design, tasks, and spec for consolidating
shell and process tooling into a single unified process tool.
@avoidwork avoidwork self-assigned this Aug 22, 2026
- Merge shell and process tools into single process tool with action parameter
- Fix background process stdio capture (pipe instead of ignore)
- Remove shell tool entirely
- Update tool registration, permissions, classifications
- Update agent tool assignments (deepAgents.js)
- Update tests for unified process tool
@avoidwork

Copy link
Copy Markdown
Owner Author

Audit: Merge shell and process tools → unified process tool

Issue Requirements vs Implementation

# Issue Requirement Status Notes
1 Design unified tool schema with action enum start, list, log, wait, kill, write, pause, resume — matches issue spec
2 Fix stdout/stderr capture for background processes Changed spawn from stdio: ["ignore","ignore","ignore"] to ["ignore","pipe","pipe"] and added stdout/stderr accumulation in trackProcess()
3 Merge tool implementations executeShellImpl() and manageProcessImpl() consolidated into unifiedProcessImpl() with action routing
4 Preserve processTracker Shared processTracker Map retained as the internal state store
5 Update tool registration Removed shell import/export, updated TOOL_PERMISSIONS (process now requires filesystem:exec + process:spawn), updated TOOL_CLASSIFICATIONS
6 Update TOOL_CLASSIFICATIONS Merged classifications: process inherits from both shell (debug, code-review, testing, security-audit, performance, coding) and process (debug, performance, coding)
7 Write unit tests Updated shell.test.js to test unified tool — all 1165 tests pass
8 Write integration test Background process lifecycle tested: start → log → wait → exit
9 Update documentation Updated deepAgents.js agent tool assignments (shell → process), updated index.js comments
10 Verify (test + lint + coverage) 1165 tests pass, lint clean, coverage maintained

Key Changes

Removed:

  • src/tools/shell.js — deleted entirely
  • shell from TOOL_PERMISSIONS, TOOL_CLASSIFICATIONS, ORCHESTRATOR_TOOLS, TOOLS
  • shell from agent tool assignments in deepAgents.js

Modified:

  • src/tools/process.js — unified handler with action-based routing, stdout/stderr capture
  • src/tools/index.js — removed shell references, updated process permissions
  • tests/unit/shell.test.js — tests unified process tool instead of separate shell/process
  • tests/unit/tool_index.test.js — updated expectations (no more shell tool)

Breaking Changes

  • The shell tool no longer exists. Any external callers or agent configurations referencing shell must use process with action: "start" instead.
  • process tool now requires both filesystem:exec and process:spawn permissions (previously only process:spawn).

Test Results

  • Tests: 1165/1165 passing
  • Lint: 0 warnings, 0 errors
  • Coverage: maintained (pre-commit hook passes)

OpenSpec Artifacts

  • Proposal: openspec/changes/merge-shell-process-tools/proposal.md
  • Design: openspec/changes/merge-shell-process-tools/design.md
  • Spec: openspec/changes/merge-shell-process-tools/specs/unified-process-tool/spec.md
  • Tasks: openspec/changes/merge-shell-process-tools/tasks.md

All 10 fix steps from the issue have been implemented. The unified tool correctly captures stdout/stderr from background processes, provides all lifecycle actions, and maintains backward compatibility with the existing processTracker architecture.

@avoidwork
avoidwork enabled auto-merge (squash) August 22, 2026 16:17
@avoidwork
avoidwork merged commit e0a7003 into main Aug 22, 2026
2 checks passed
@avoidwork
avoidwork deleted the feat/merge-shell-process-tools branch August 22, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant