Skip to content

chore: verify middleware boundary enforcement in agent tools (#72)#73

Merged
alexey-pelykh merged 1 commit intomainfrom
verify-middleware-boundary-72
Feb 27, 2026
Merged

chore: verify middleware boundary enforcement in agent tools (#72)#73
alexey-pelykh merged 1 commit intomainfrom
verify-middleware-boundary-72

Conversation

@alexey-pelykh
Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh commented Feb 27, 2026

Summary

Verification gate between individual gutting tasks (#66, #68, #70) and the final pi-embedded engine deletion. Confirms the middleware boundary in src/agents/tools/ is correctly enforced.

Verification Results

1. Zero references to deleted tool files in KEEP/MODIFY code

All searches return clean (excluding pi-embedded-runner/ as specified):

Deleted Module Group Status
Web tools (#66): web-fetch, web-search, web-shared, web-tools CLEAN
Browser/image/TTS tools (#66): browser-tool, image-tool, tts-tool CLEAN
Docker sandbox (#68): sandbox imports CLEAN (matches are string literals about "sandboxed agent session" = access control concept, not Docker sandbox)
Bash/exec tools (#70): bash-tools, exec-approvals, exec-safe-bin, exec-host, pty-dsr, pty-keys CLEAN

2. Only RemoteClaw-specific tools remain (33 files)

Category Count Files
Session tools 11 sessions-spawn-tool, sessions-send-tool, sessions-send-tool.a2a, sessions-send-helpers, sessions-list-tool, sessions-history-tool, sessions-access, sessions-resolution, sessions-announce-target, sessions-helpers, session-status-tool
Channel actions 10 discord-actions (5), slack-actions, telegram-actions, whatsapp-actions, whatsapp-target-auth
Gateway + scheduling 4 gateway-tool, gateway, cron-tool, agents-list-tool
Core messaging 2 message-tool, subagents-tool
Infrastructure 1 common
DEFER 3 nodes-tool, nodes-utils, canvas-tool
Edge cases (resolved below) 2 agent-step, memory-tool

3. No stray tool files

All 33 files accounted for. No unexpected files found.

4. Edge case resolutions

agent-step.ts -> Reclassified to KEEP

  • Pure gateway infrastructure: uses callGateway RPC (chat.history, agent.wait)
  • Zero pi-embedded imports
  • Consumed by KEEP code: sessions-send-tool.a2a.ts, subagent-announce.ts, subagent-followup.ts
  • No refactoring needed

memory-tool.ts -> Confirmed DEFER, no pi-embedded coupling

  • Imports only from config, memory, routing, agents/agent-scope
  • Safe to keep as DEFER

5. Build passes

pnpm build completes with zero errors.

Notable finding (deferred)

system-prompt.ts has ~50 lines of sandbox prompt generation (sandboxInfo parameter, lines ~490-534) that depend on EmbeddedSandboxInfo from pi-embedded-runner/types.ts. Also consumed by auto-reply/commands-system-prompt.ts via resolveSandboxRuntimeStatus. Tightly coupled to pi-embedded engine -- should be cleaned up as part of engine deletion task, not this verification task.

Test plan

  • All grep searches for deleted module references return clean
  • Tool file inventory matches expected KEEP list (33 files)
  • agent-step.ts has zero pi-embedded imports
  • memory-tool.ts has zero pi-embedded imports
  • pnpm build passes with zero errors

Closes #72

🤖 Generated with Claude Code

Verification gate between gutting tasks (#66, #68, #70) and the final
pi-embedded engine deletion. All 5 criteria pass:

1. Zero stray imports from deleted tool modules in KEEP code
2. 33 tool files match expected KEEP/DEFER inventory
3. No stray files found
4. agent-step.ts reclassified to KEEP (pure gateway, no pi-embedded coupling)
5. memory-tool.ts confirmed DEFER (no pi-embedded coupling)
6. pnpm build passes cleanly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) February 27, 2026 21:28
@alexey-pelykh alexey-pelykh merged commit 1921380 into main Feb 27, 2026
2 checks passed
@alexey-pelykh alexey-pelykh deleted the verify-middleware-boundary-72 branch February 27, 2026 21:38
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.

Verify middleware boundary enforcement in agent tools

1 participant