-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Background
The Copilot SDK introduced Session Hooks (PR #269 by @friggeri) that allow applications to observe and control tool executions in real time. The hooks API provides:
onPreToolUse- Called before each tool execution with permission to allow/deny or modify argumentsonPostToolUse- Called after tool execution with access to resultsonUserPromptSubmitted- Called when user submits a prompt
This capability is now available in the Node.js SDK and was documented in v0.1.23+ releases.
Proposal
Integrate Session Hooks into Planeteer's execution flow to provide visibility into agent activity:
- Add hooks to
src/services/copilot.ts- ConfigureonPreToolUseandonPostToolUsehandlers when creating sessions - Log tool usage during execution - Track which tools agents call during task execution (e.g., file operations, git commands, bash commands)
- Display tool activity in Execute screen - Show real-time tool execution summary in the execution UI (e.g., "git commit", "npm install", "file edits: 3 files")
- Emit hook events - Expose hook data through an EventEmitter or callback pattern so the Execute screen can subscribe
- Optional: Add tool execution log to plan persistence - Save tool execution history in
.planeteer/(plan-id).jsonfor post-execution review
Benefit
- Transparency - Users see exactly what agents are doing under the hood
- Trust building - Real-time visibility into tool usage increases confidence in agent actions
- Debugging - Tool execution logs help diagnose issues when tasks fail
- Audit trail - Persisted logs provide accountability for agent actions
Acceptance Criteria
-
onPreToolUseandonPostToolUsehooks configured insrc/services/copilot.ts - Tool execution events logged to console or debug output during execution
- Execute screen displays real-time tool usage summary (e.g., "Running: npm test", "Edited: 2 files")
- Tool execution log optionally persisted in plan JSON (at minimum, in-memory during execution)
- Manual testing confirms tool visibility for common operations (git, file edits, bash commands)
AI generated by Weekly Enhancement Suggestions
Reactions are currently unavailable