Overwatch Agent
Autonomous AI agent that perceives errors, self-corrects code, and learns from fixes with built-in governance.
Overwatch Agent is an intelligent VS Code extension that monitors your development workflow, automatically detects build failures and errors, and uses AI to propose fixes with human-in-the-loop approval.
✨ Features
🤖 Autonomous Error Detection
- Task Failure Monitoring: Automatically detects when tasks fail (compilation, tests, linting)
- Diagnostic Perception: Reads TypeScript/JavaScript errors from the Problems panel
- Real-time Awareness: Monitors your workspace for issues without manual intervention
🧠 AI-Powered Self-Correction
- LLM Integration: Delegates fix generation to GitHub Copilot via Language Model API
- Syntax Validation: Validates proposed fixes before applying them
- Context-Aware: Understands file content, error messages, and line numbers
🛡️ Built-in Governance
- Diff Viewer: Shows exactly what will change before applying fixes
- Approval UI: Interactive panel with Accept/Reject/Retry options
- Safe by Default: All fixes require approval unless auto-fix is enabled
💾 Memory & Learning
- Fix Caching: Remembers successful fixes for identical errors
- Instant Replay: Reuses cached solutions for faster resolution
- Persistent Storage: Cache survives VS Code restarts
🎛️ Configurable Behavior
- Auto-Fix Mode: Toggle automatic vs. manual approval
- Retry Limits: Control how many attempts the agent makes
- Tone Adjustment: Choose between concise or verbose AI responses
💬 Chat Integration
- @worker Participant: Delegate code generation directly to Copilot
- Natural Interaction: Ask questions and get code without leaving your editor
📋 Requirements
- VS Code: Version 1.106.0 or higher
- GitHub Copilot: Active subscription (uses Language Model API)
- Node.js: For TypeScript/JavaScript projects
🚀 Getting Started
- Install the extension from the VS Code Marketplace
- Enable GitHub Copilot if not already active
- Open a TypeScript/JavaScript project
- Run a task that produces errors (e.g., `npm run build`)
- Watch Overwatch Agent detect the failure and propose a fix!
First-Time Setup
Open Settings (`Cmd+,` on Mac, `Ctrl+,` on Windows/Linux) and search for "overwatch":
- `overwatch.behavior.autoFix`: Enable/disable automatic fix application (default: `false`)
- `overwatch.behavior.maxRetries`: Set retry limit for fix generation (default: `2`)
- `overwatch.behavior.tone`: Choose AI response style: `concise` or `verbose`
📖 Usage Examples
Example 1: Fixing TypeScript Errors
```typescript
// You have a type error:
const name: string = 123; // Error: Type 'number' is not assignable to type 'string'
// 1. Run your build task
// 2. Task fails with TypeScript error
// 3. Overwatch Agent detects failure
// 4. AI analyzes error and proposes: const name: string = "123";
// 5. Review diff in governance UI
// 6. Click "Accept Fix" → Code is corrected automatically
// 7. Task reruns and passes ✅
```
Example 2: Using Chat Participant
```
In VS Code Chat panel:
@worker Create a function that validates email addresses
Copilot responds with:
function validateEmail(email: string): boolean {
const regex = /^[^\s@]+@[^\s@]+.[^\s@]+$/;
return regex.test(email);
}
```
Example 3: Manual Error Perception
- Open a file with errors
- Run command: Overwatch Agent: Perceive Errors (`Cmd+Shift+P`)
- See error summary: "Found 3 issue(s): Line 10: Cannot find name 'foo'..."
⚙️ Extension Settings
This extension contributes the following settings:
| Setting |
Type |
Default |
Description |
| `overwatch.behavior.autoFix` |
boolean |
`false` |
Automatically apply fixes without approval |
| `overwatch.behavior.maxRetries` |
number |
`2` |
Maximum retries for fix generation |
| `overwatch.behavior.tone` |
string |
`"concise"` |
Style of AI prompts: `"concise"` or `"verbose"` |
🎯 Commands
| Command |
Description |
| `Overwatch Agent: Say Hello` |
Test command - inserts greeting in active editor |
| `Overwatch Agent: Perceive Errors` |
Manually scan workspace for diagnostic errors |
| `Overwatch Agent: Trigger Task Failure (Test)` |
Developer test command for triggering self-correction |
🔧 How It Works
Architecture Overview
```
- Task Monitor → Detects task failures
- Error Perception → Reads diagnostics & error messages
- LLM Delegation → Sends context to GitHub Copilot
- Syntax Validation → Verifies proposed fix compiles
- Governance UI → Shows diff + approval panel
- Code Application → Applies accepted changes
- Memory Service → Caches successful fixes
- Task Rerun → Automatically retries failed task
```
🐛 Known Issues
- Language Support: Currently optimized for TypeScript/JavaScript. Other languages may have limited support.
- Large Files: Performance may degrade on files >5000 lines.
- Complex Errors: Multi-file refactoring errors may require manual intervention.
🗺️ Roadmap
- [ ] Support for Python, Go, Rust diagnostics
- [ ] Multi-file fix application
- [ ] Test generation for failed test cases
- [ ] Telemetry and analytics dashboard
- [ ] Custom prompt templates
📝 Release Notes
1.0.0 (Initial Release)
Core Features:
- ✅ Task failure monitoring with automatic detection
- ✅ AI-powered self-correction via Language Model API
- ✅ Governance UI with diff viewer and approval panel
- ✅ Memory service with fix caching
- ✅ Chat participant (`@worker`) for code generation
- ✅ Configurable behavior (auto-fix, retries, tone)
- ✅ TypeScript/JavaScript error perception
- ✅ Syntax validation before applying fixes
🤝 Contributing
Found a bug or have a feature request? Open an issue on GitHub.
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
Built with:
Enjoy autonomous error correction! 🚀