fix: skip follow-up prompts when useAgentRunner.run() early-terminates#1104
Draft
fix: skip follow-up prompts when useAgentRunner.run() early-terminates#1104
Conversation
- azure-deploy: capability-claim description ('This skill runs azd up...'),
narrowed triggers to already-prepared apps, added scope rule
- azure-prepare: added 'Preparation ONLY' scope boundary, rule 8 for
scope enforcement, handoff marker in Phase 2
- azure-validate: added handoff language to azure-deploy in description
- Tests: updated 2 deploy prompts with anti-routing signals
- Updated snapshots for all 3 skills
CI runs 3x/day across scheduled runs, providing statistical signal over time. Running each prompt 5x per CI job was redundant cost with no added reliability.
Set systemMessage to { mode: 'append' } by default instead of undefined,
ensuring the Copilot CLI built-in system prompt is always included in
integration test sessions.
Appends 'When a relevant skill is available, prefer using it instead of doing the task manually.' to the CLI system prompt via mode: append, nudging the model to invoke skills rather than executing tasks directly.
- azure-prepare: Remove handoff sentence ('After preparation, hand off to
azure-validate then azure-deploy') and 'MUST be invoked FIRST' sentence
that injected azure-deploy/azure-validate as competing keywords.
Add explicit WHEN triggers for Terraform, App Service, Container Apps,
Static Web Apps, and brownfield patterns.
- azure-deploy: Remove 'provision infrastructure' competing trigger,
add DO NOT USE WHEN guidance for create/build patterns.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * fix: replace ⛔ emoji with⚠️ in azure-prepare SKILL.md per authoring guidelines Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com>
… table (#1096) * Initial plan * fix: add azure-cloud-migrate to SKILL.md Step 0 routing table Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com>
…entRunner.run() Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add changes based on feedback for skill routing improvements
fix: skip follow-up prompts when useAgentRunner.run() early-terminates
Mar 3, 2026
This was referenced Mar 6, 2026
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.
When
shouldEarlyTerminatetriggers inuseAgentRunner.run(), the session is aborted — but the follow-up loop ran unconditionally, sending prompts to an aborted session and incurring unnecessary LLM turns/cost.Changes
tests/utils/agent-runner.ts: Track early termination with anearlyTerminatedflag; skip thefollowUploop when set.Covers all test files that combine
shouldEarlyTerminatewithfollowUp(e.g.azure-prepare,azure-validate).💡 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.