# 🚀 CodeBuddy Code v2.87.0 Release

## ✨ New Features

### Delegate Mode Complete Overhaul

A completely redesigned Delegate Mode that enables the AI assistant to more efficiently coordinate multiple sub-agents to accomplish complex tasks:

- **System Prompt Rewrite**: Full coverage of role definitions, tool rules, notification formats, task workflows, and interaction examples, providing more precise task decomposition and coordination capabilities
- **Team Leader Templatization**: Extracted from hardcoded logic into configurable templates, supporting dynamic member lists and comprehensive coordination guidelines
- **Tool Whitelist Narrowing**: Delegate mode now focuses on five core coordination tools — Agent, TaskStop, SendMessage, AskUserQuestion, and StructuredOutput — for clearer responsibility boundaries

### Subagent Permission Inheritance Configuration

A new three-tier configuration mechanism for flexible control over sub-agent default permission modes:

- CLI parameter: `--subagent-permission-mode`
- Environment variable: `CODEBUDDY_SUBAGENT_PERMISSION_MODE`
- Settings configuration: `permissions.subagentPermissionMode`

### Daemon Mode Enhancements

- **Delegate Mode by Default**: The daemon now automatically uses Delegate Mode on startup, with customization available via `--permission-mode`
- **Parameter Inheritance**: Daemon child processes automatically inherit parent process CLI parameters (model, mcp-config, tools, etc.), eliminating the need for repeated configuration

## 🔧 Improvements

- **Delegate Mode Visual Update**: Color changed from reddish-brown to amber/gold, better reflecting the "dispatcher/coordinator" role
- **Permission Inheritance Architecture Optimization**: Replaced hardcoded logic with an extensible mapping table, making it easier to add new permission modes
- **E2E Test Infrastructure**: Added Record/Replay mode supporting model response recording and playback, along with 13 new E2E test cases covering core tools and multi-turn conversation scenarios

## 🐛 Bug Fixes

- **Compact Sync Deadlock**: Fixed context compaction never executing in sub-agent scenarios, ensuring proper context management for long conversations
