Commit f1a3d0b
committed
fix(orchestrator): Remove duplicate message alternation in provider layer
**Problem:**
Messages were being merged TWICE - once in AgentOrchestrator.ensureMessageAlternation()
and again in GitHubCopilotProvider.enforceMessageAlternation(). This double-alternation
was over-merging messages and potentially losing context.
**Root Cause:**
Both the orchestrator and provider had their own alternation logic:
1. AgentOrchestrator line 173: ensureMessageAlternation (smart, preserves tools)
2. GitHubCopilotProvider line 1258: enforceMessageAlternation (simple merge)
All messages pass through orchestrator FIRST, then provider, causing duplicate processing.
**Solution:**
- Removed enforceMessageAlternation from GitHubCopilotProvider
- Kept ensureMessageAlternation in AgentOrchestrator (better logic + logging)
- Added comment explaining why provider doesn't do alternation
**Testing:**
✅ GitHub Copilot: Works correctly (no double-merge)
✅ Claude: Works correctly (single alternation only)
✅ Tested with alternation disabled - confirmed alternation NOT the cause of task quality issues
**Note:**
This fix resolves the double-alternation bug. Separate task quality issues with Claude
(incomplete task execution) are unrelated to alternation and require separate investigation.1 parent b6c0973 commit f1a3d0b
2 files changed
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4507 | 4507 | | |
4508 | 4508 | | |
4509 | 4509 | | |
4510 | | - | |
4511 | | - | |
4512 | 4510 | | |
4513 | 4511 | | |
4514 | 4512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
1490 | 1486 | | |
1491 | | - | |
| 1487 | + | |
1492 | 1488 | | |
1493 | 1489 | | |
1494 | 1490 | | |
| |||
0 commit comments