fix: use last step output instead of longest in MCP response extraction#560
fix: use last step output instead of longest in MCP response extraction#560
Conversation
extractResponseText() was picking the longest text across all workflow steps, which could return routing/intent classification output instead of the final generate-response output. Changed to pick the last step's text, matching the natural execution order. This fixes a bug where MCP clients would receive intent classifications (e.g. "engineering-task, skills: api-gateway") instead of the actual AI response when the routing step produced longer output than the final response. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Overview: Fix MCP Response Extraction LogicSummaryThis PR fixes a bug in Root CauseThe code comment stated "keeping the last (deepest) one" but the implementation used Changes Made
|
Security Issues (4)
Security Issues (4)
Performance Issues (1)
Powered by Visor from Probelabs Last updated: 2026-03-21T19:15:01.145Z | Triggered by: pr_opened | Commit: 3ec29bd 💡 TIP: You can chat with Visor using |
Summary
extractResponseText()inMcpServerRunnerwas picking the longest text output across all workflow stepsRoot cause
The comment said "keeping the last (deepest) one" but the code did
text.length > bestText.length— picking longest, not last. Fixed both thereviewSummary.historyandexecutionStatistics.groupedResultsextraction paths.Test plan
🤖 Generated with Claude Code