Conversation
There was a problem hiding this comment.
Greptile Summary
This PR fixes a critical bug in the copilot workflow system where skipping tools wasn't properly notifying the agent, causing workflows to hang indefinitely. The changes standardize the data structure for tool rejections across the system and add comprehensive debugging capabilities.
The core fix addresses two main issues: First, it ensures that when users skip copilot tools (particularly server tools), the agent receives proper completion notifications via the /api/copilot/tools/complete endpoint. This prevents the agent from waiting indefinitely for tool responses. Second, it standardizes the rejection data structure from { confirmationMessage } to { status: 'rejected', message } across multiple components (base-tool.ts, inline-tool-call.tsx, and tool-confirmation.tsx).
Additionally, the PR adds extensive diagnostic logging specifically for the set_environment_variables method throughout the copilot system. These logs use '[SEV]' prefixes and track the complete execution flow from client-side execution through API completion. The PR also includes a Next.js configuration update to allow Google Drive images (lh3.googleusercontent.com) and removes concurrent execution from auth token tests to improve test stability.
These changes integrate with the existing copilot architecture by ensuring proper communication between the frontend copilot interface and the backend agent system, maintaining the workflow execution pipeline's reliability.
Confidence score: 3/5
- This PR addresses a real bug but introduces potential issues with duplicate notifications and extensive debugging code that should be temporary
- Score reflects concerns about the duplicate notification approach in
tool-confirmation.tsxand unregistered handler issues inclient-utils.ts - Pay close attention to
lib/copilot/tools/tool-confirmation.tsxandlib/copilot/tools/client-tools/client-utils.tsfor potential runtime issues
8 files reviewed, 3 comments
* Test * Lint * Fix tests * Fixes
Summary
Fixes skip in run workflow
Type of Change
Testing
How has this been tested? What should reviewers focus on?
Checklist