Disable compile watch mode in automated environments - #50385
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
August 4, 2026 20:06
View session
pelikhan
marked this pull request as ready for review
August 4, 2026 20:07
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents indefinite compile watch sessions in automated environments and updates agent guidance accordingly.
Changes:
- Detects Copilot coding agent sessions as automated environments.
- Rejects compile watch mode in CI and agent sessions.
- Adds focused tests and regenerates affected workflow locks.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/compile_watch_environment_test.go |
Tests watch-mode rejection. |
pkg/cli/compile_orchestrator.go |
Adds the runtime guard. |
pkg/cli/ci.go |
Detects Copilot agent sessions. |
pkg/cli/ci_test.go |
Tests updated environment detection. |
.github/workflows/squad-plan.lock.yml |
Updates generated metadata. |
.github/workflows/squad-game-planner.lock.yml |
Updates generated metadata. |
.github/aw/maintainer.md |
Recommends one-shot compilation. |
.github/aw/instructions.md |
Removes agent-facing watch guidance. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Balanced
| } | ||
|
|
||
| if config.Watch && IsRunningInCI() { | ||
| return nil, errors.New("watch mode cannot be used in CI or Copilot coding agent environments") |
| "CI", | ||
| "CONTINUOUS_INTEGRATION", | ||
| "GITHUB_ACTIONS", | ||
| "COPILOT_AGENT_SESSION_ID", |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
gh aw compile --watchcan block indefinitely in CI and Copilot coding agent sessions. Agents should use terminating, one-shot compilation instead.Runtime guard
--watchin CI and coding agent contexts with a clear error.Agent guidance
--watchrecommendations with one-shotgh aw compileinstructions.Coverage