Skip to content

Fix issue-monster Copilot API error by reducing prompt size#667

Merged
lpcox merged 4 commits intomainfrom
copilot/fix-issue-monster-error
Feb 4, 2026
Merged

Fix issue-monster Copilot API error by reducing prompt size#667
lpcox merged 4 commits intomainfrom
copilot/fix-issue-monster-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Fix issue-monster Copilot API error by reducing prompt size ✅

  • Identify the error: Copilot API returning incomplete responses
  • Investigate root cause: Workflow prompt too long (434 lines, 19KB)
  • Optimize workflow instructions (reduced to 328 lines, 13KB)
  • Remove redundant content while preserving all logic
  • Compile and validate successfully
  • Revert lock.yml changes (will be regenerated on next compile)

Problem

The issue-monster workflow was failing with error:

Execution failed: Error: missing finish_reason for choice 0

This error occurs when the GitHub Copilot API receives an overly long or complex prompt.

Solution

Optimized the workflow prompt by 33%:

  • Before: 434 lines, 19,426 bytes
  • After: 328 lines, 13,062 bytes
  • Reduction: 106 lines (24%), 6,364 bytes (33%)

Changes

Only .md file modified:

  • .github/workflows/issue-monster.md - Optimized workflow definition
  • .github/workflows/issue-monster.lock.yml - Reverted (will be regenerated)

Optimizations:

  • Consolidated verbose filtering/scoring explanations
  • Streamlined step-by-step process to bullet points
  • Removed redundant examples
  • Simplified guidelines while maintaining all requirements

Preserved functionality:

  • Sub-issue relationship handling
  • Copilot assignment verification
  • Topic separation and conflict detection
  • Safe-outputs tool integration
Original prompt

Can you try to fix the error with issue monster?

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 4, 2026 18:44
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Reduced workflow prompt size by 33% (from 19KB to 13KB, 434 to 328 lines) to prevent "missing finish_reason for choice 0" error. This error occurs when the Copilot API receives an overly long/complex prompt.

Changes:
- Consolidated redundant explanations and examples
- Streamlined step-by-step instructions
- Removed verbose scoring system details (kept reference)
- Simplified topic separation guidelines
- Maintained all essential logic and requirements

The workflow still performs all the same checks (sub-issue relationships, conflict detection, assignment limits) but with more concise instructions.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error related to issue monster Fix issue-monster Copilot API error by reducing prompt size Feb 4, 2026
Copilot AI requested a review from lpcox February 4, 2026 18:51
@lpcox
Copy link
Collaborator

lpcox commented Feb 4, 2026

@copilot only change the .md files. drop updates to the .lock.yml file since it will be regenerated

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot only change the .md files. drop updates to the .lock.yml file since it will be regenerated

Done! Reverted the .lock.yml changes in commit 307586d. Only the .md file is now modified in this PR.

@lpcox lpcox marked this pull request as ready for review February 4, 2026 18:57
Copilot AI review requested due to automatic review settings February 4, 2026 18:57
@lpcox lpcox merged commit 84f0499 into main Feb 4, 2026
@lpcox lpcox deleted the copilot/fix-issue-monster-error branch February 4, 2026 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR streamlines the Issue Monster Copilot workflow prompt to avoid Copilot API errors caused by overly large, complex prompts, while keeping the issue selection and assignment behavior intact.

Changes:

  • Simplified the Issue Monster agent’s description and workflow from verbose narrative instructions into concise, numbered steps.
  • Consolidated the explanation of pre-filtered, scored issues into a short summary while preserving key constraints (no assignees, excluded/campaign labels, no sub-issues, priority ordering).
  • Compressed the success criteria and operational guidelines into a shorter checklist that still enforces sub-issue handling, topic separation, and correct use of the safeoutputs tools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants