Conversation
- Create shared/mcp-pagination.md with MCP response size best practices - Update smoke-claude.md with pagination imports, toolsets config, and max-turns limit - Enhance cli-version-checker.md with JSON parsing guidance for npm commands Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize workflows based on live log analysis
Optimize workflows based on live log analysis: MCP pagination and JSON parsing
Nov 5, 2025
pelikhan
approved these changes
Nov 6, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the smoke-claude workflow with pagination guidance and improved configuration. The changes add comprehensive documentation about MCP response size limits and best practices for handling large GitHub API responses, along with workflow configuration improvements.
Key Changes
- Added MCP pagination guidance documentation to help workflows handle the 25,000 token response limit
- Configured the Claude engine with explicit
max-turns: 15limit - Updated GitHub toolsets from
defaultto specificrepos, pull_requeststoolsets - Added JSON parsing troubleshooting documentation for CLI tools
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/smoke-claude.md |
Updated workflow to use engine object notation with max-turns, added pagination import, and specified GitHub toolsets |
.github/workflows/smoke-claude.lock.yml |
Compiled workflow output reflecting the pagination guidance injection, max-turns configuration, and toolset changes |
.github/workflows/shared/mcp-pagination.md |
New shared documentation providing comprehensive pagination best practices for MCP tool responses |
.github/workflows/cli-version-checker.md |
Added troubleshooting section for JSON parsing issues with npm and other CLI tools |
.github/workflows/cli-version-checker.lock.yml |
Compiled workflow output including the new JSON parsing troubleshooting guidance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Live analysis of 11 workflow runs identified two actionable failure patterns: MCP response size limit exceeded (75k+ tokens from
list_pull_requests) and JSON parsing errors from Unicode symbols in npm output.Changes
Created shared pagination guidance
.github/workflows/shared/mcp-pagination.md: Documents 25k token limit, pagination patterns for GitHub API toolsperPageexamples for PRs, issues, search operationsUpdated smoke-claude workflow
imports: [shared/mcp-pagination.md]toolsets: [repos, pull_requests](was wildcard)max-turns: 15Enhanced cli-version-checker
npm view package --json 2>/dev/null | jq -r '.version'Expected impact
Original prompt
This section details on the original issue you should resolve
<issue_title>[q] Workflow optimizations based on live log analysis</issue_title>
<issue_description># Q Workflow Optimization Report
Issues Found (from live data)
Analysis Overview
Issue #1: MCP Response Size Limits (Claude Engine)
Severity: Medium
Affected Workflows: Smoke Claude
Run IDs Analyzed: 19103049716, 19114358281
Log Evidence:
MCP tool "list_pull_requests" response (75897 tokens) exceeds maximum allowed tokens (25000)MCP tool "pull_request_read" response (31675 tokens) exceeds maximum allowed tokens (25000)Root Cause: Large result sets from GitHub API calls exceed the 25k token limit for MCP tool responses, forcing workflows to use pagination reactively rather than proactively.
Impact: Workflows must retry with pagination parameters, adding extra turns and API calls.
Issue #2: JSON Parsing Errors (Copilot Engine)
Severity: Low-Medium
Affected Workflows: CLI Version Checker, Q
Run IDs Analyzed: 19106334374, 19102935260
Log Evidence:
Unexpected token 'W', "When fetch"... is not valid JSONUnexpected token 'ℹ', "ℹ Timeout "... is not valid JSONUnexpected token '⚠', "⚠ pip pack"... is not valid JSONRoot Cause: Tool outputs (npm, bash commands) include informational messages with Unicode symbols (ℹ, ⚠, ✓) before or after JSON content.
Impact: Parsing failures require additional error handling and retry logic.
Issue #3: Network Unreachable (IPv6)
Severity: Low (Infrastructure)
Affected Workflows: Changeset Generator, Smoke Copilot
Run IDs: 19114358285, 19114358286
Log Evidence:
sending to ICMPv6 packet to [2606:4700::6810:1d22]: (101) Network is unreachableNote: Infrastructure-related, not addressable via workflow configuration.
Changes Made
1. Created Shared MCP Pagination Guidance (.github/workflows/shared/mcp-pagination.md)
Purpose: Provide reusable best practices for avoiding MCP response size errors
Content:
perPageparameter effectivelyBenefits:
2. Updated Smoke Claude (.github/workflows/smoke-claude.md)
Changes:
imports: [shared/mcp-pagination.md]for pagination guidancetoolsets: [repos, pull_requests]instead of wildcardmax-turns: 15to prevent excessive iterationsExpected Improvements:
3. Enhanced CLI Version Checker (.github/workflows/cli-version-checker.md)
Changes:
grep -vto filter informational messagesjqfor reliable JSON extractionnpm view ... 2>/dev/nullExpected Improvements:
Validation
All modified workflows were validated:
Note: .lock.yml files will be generated automatically after merge via standard compilation process.
Expected Impact
Performance Improvements
Reliability Improvements
References
Log Analysis Files
/tmp/gh-aw/aw-mcp/logs/run-*/run_summary.json/tmp/gh-aw/aw-mcp/logs/run-*/detection.logSpecific Runs Investigated
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.