Skip to content

feat: gut bash/exec tools, PTY, and exec-approval infrastructure (#70)#71

Merged
alexey-pelykh merged 1 commit intomainfrom
gut-bash-exec-pty-70
Feb 27, 2026
Merged

feat: gut bash/exec tools, PTY, and exec-approval infrastructure (#70)#71
alexey-pelykh merged 1 commit intomainfrom
gut-bash-exec-pty-70

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #70

Remove the OpenClaw bash/exec tool subsystem, PTY terminal handling, and exec-approval security infrastructure. RemoteClaw's CLI agents handle their own shell execution natively, making this infrastructure dead code.

  • ~95 files deleted (~22k lines): bash tool creation, PTY adapter, exec-approval manager/forwarder/CLI, exec-safety policies, system-run-command resolution, exec-wrapper resolution, channel exec-approval handlers (Discord, gateway, CLI), and related tests
  • ~35 files modified: cleaned up imports, removed dead code branches, stubbed types for backward compatibility in node-host invoke pipeline
  • 1 new file: src/infra/safe-executable-value.ts — extracted general-purpose validation function still used by config
  • Process supervisor: removed PTY spawn branch, now child-only
  • pi-tools: removed exec/process tool creation, kept apply_patch tool

Test plan

  • pnpm build passes
  • pnpm test passes (1444 test files, 12,062 tests, 0 failures)
  • pnpm check passes (format + typecheck + lint, no new type errors)
  • No dangling imports to deleted modules (verified via grep)
  • All deletion targets confirmed gone
  • src/process/exec.ts preserved (general-purpose utility used by 61 files)

🤖 Generated with Claude Code

Remove the OpenClaw bash/exec tool subsystem, PTY terminal handling, and
exec-approval security infrastructure. RemoteClaw's CLI agents handle
their own shell execution natively, making this infrastructure dead code.

Deleted ~95 files (~22k lines) across:
- Bash tool creation (exec, process, approval request flows)
- PTY adapter and key handling
- Exec-approval manager, forwarder, and CLI
- Exec-safety, safe-bin policy, runtime policy, trust
- System-run-command resolution and obfuscation detection
- Exec-wrapper resolution
- Channel exec-approval handlers (Discord, gateway, CLI)
- Related test files

Surviving code changes:
- pi-tools.ts: removed exec/process tool creation, kept apply_patch
- supervisor.ts: removed PTY spawn branch, child-only now
- invoke.ts, invoke-system-run.ts: stubbed gutted exec-approval and
  exec-host types/functions for backward compatibility
- Extracted isSafeExecutableValue to src/infra/safe-executable-value.ts
  (general-purpose validation, still used by config)
- bash-tools.ts: type-only stub for pi-embedded-runner compatibility
- Cleaned up imports in ~30 surviving files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) February 27, 2026 20:52
@alexey-pelykh alexey-pelykh merged commit 45d6734 into main Feb 27, 2026
2 checks passed
@alexey-pelykh alexey-pelykh deleted the gut-bash-exec-pty-70 branch February 27, 2026 21:02
alexey-pelykh added a commit that referenced this pull request Mar 17, 2026
Remove references to gutted fork infrastructure that cherry-picked
upstream commits still referenced: exec-command-resolution,
exec-safe-bin-runtime-policy, exec-safe-bin-trust modules (deleted in
fork #70/#71), ExecApprovalManager/createExecApprovalHandlers (gutted
exec-approval infra), and loadBundledMemoryPluginRegistry (gutted
memory subsystem).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexey-pelykh added a commit that referenced this pull request Mar 17, 2026
Remove references to gutted fork infrastructure that cherry-picked
upstream commits still referenced: exec-command-resolution,
exec-safe-bin-runtime-policy, exec-safe-bin-trust modules (deleted in
fork #70/#71), ExecApprovalManager/createExecApprovalHandlers (gutted
exec-approval infra), and loadBundledMemoryPluginRegistry (gutted
memory subsystem).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexey-pelykh added a commit that referenced this pull request Apr 27, 2026
…2606)

The gateway handlers for `exec.approval.{request,waitDecision,resolve}`
were deleted by PR #2375 (commit 4e84640, 2026-04-16) — themselves
zero-caller stubs at that point, after the original implementation was
gutted by PR #70/#71 (commit 45d6734, 2026-02-27). The protocol-level
declarations (method-scopes, server-methods-list, schemas, validators,
broadcast scope guards) and live RPC callers (TS agents node-tool, CLI
nodes-cli register.invoke, web UI app.ts, macOS GatewayConnection +
ExecApprovalsGatewayPrompter) survived. Net result: an unreachable RPC
surface where every live caller would receive `INVALID_REQUEST: unknown
method: exec.approval.*` from the gateway today.

The audit (`docs/refactor/exec-approval-singular-audit-2606.md`) walks
each of #2606's four acceptance criteria with file:line evidence,
documents the subsystem split (singular `exec.approval.*` request/decision
flow vs plural `exec.approvals.*` policy/storage — the latter is in
active use and out of scope), confirms zero broadcast producers exist for
`exec.approval.{requested,resolved}` events, and verifies that no shared
correlation shape would be worth extracting before deletion.

Documentation finding: `docs/concepts/exec-approvals-architecture.md` was
written 2026-04-26 (10 days after the singular handlers were deleted by
PR #2375) and still asserts "End-to-end functional" for this path. The
audit doc is now the authoritative current-status reference.

This PR is audit-only — restore-vs-full-gut is a follow-up sized after
this lands, per the issue body. Recommendations live at the end of the
audit doc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
alexey-pelykh added a commit that referenced this pull request Apr 27, 2026
…2606) (#2609)

The gateway handlers for `exec.approval.{request,waitDecision,resolve}`
were deleted by PR #2375 (commit 4e84640, 2026-04-16) — themselves
zero-caller stubs at that point, after the original implementation was
gutted by PR #70/#71 (commit 45d6734, 2026-02-27). The protocol-level
declarations (method-scopes, server-methods-list, schemas, validators,
broadcast scope guards) and live RPC callers (TS agents node-tool, CLI
nodes-cli register.invoke, web UI app.ts, macOS GatewayConnection +
ExecApprovalsGatewayPrompter) survived. Net result: an unreachable RPC
surface where every live caller would receive `INVALID_REQUEST: unknown
method: exec.approval.*` from the gateway today.

The audit (`docs/refactor/exec-approval-singular-audit-2606.md`) walks
each of #2606's four acceptance criteria with file:line evidence,
documents the subsystem split (singular `exec.approval.*` request/decision
flow vs plural `exec.approvals.*` policy/storage — the latter is in
active use and out of scope), confirms zero broadcast producers exist for
`exec.approval.{requested,resolved}` events, and verifies that no shared
correlation shape would be worth extracting before deletion.

Documentation finding: `docs/concepts/exec-approvals-architecture.md` was
written 2026-04-26 (10 days after the singular handlers were deleted by
PR #2375) and still asserts "End-to-end functional" for this path. The
audit doc is now the authoritative current-status reference.

This PR is audit-only — restore-vs-full-gut is a follow-up sized after
this lands, per the issue body. Recommendations live at the end of the
audit doc.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

GUT bash/exec tools, PTY, and exec-approval infrastructure

1 participant