feat: sync compat.json max-agent with DefaultCopilotVersion at build time - #49113
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…in sync Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
July 30, 2026 10:20
View session
pelikhan
marked this pull request as ready for review
July 30, 2026 10:21
Contributor
There was a problem hiding this comment.
Pull request overview
Adds build-time synchronization between the default Copilot version and compatibility metadata.
Changes:
- Adds synchronization and check-only script modes.
- Integrates synchronization into Make targets.
- Updates
max-agentto1.0.75.
Show a summary per file
| File | Description |
|---|---|
scripts/sync-compat.sh |
Implements compatibility synchronization. |
Makefile |
Adds build and validation targets. |
.github/aw/compat.json |
Updates the current maximum agent version. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
scripts/sync-compat.sh:47
- Having no open row is a supported quarantine/rollback state: the schema explicitly allows
open: falseto freeze the catch-all interval. Failing here makes everymake buildunusable during that state. Treat an empty selection as an intentional no-op while still rejecting an open row with nomax-agent.
if [ -z "$CURRENT_MAX_AGENT" ] || [ "$CURRENT_MAX_AGENT" = "null" ]; then
echo "Error: could not find latest interval (\"open\": true) in $COMPAT_FILE" >&2
exit 1
fi
- Files reviewed: 3/3 changed files
- Comments generated: 4
- Review effort level: Medium
| done | ||
|
|
||
| # Extract DefaultCopilotVersion from Go constants file | ||
| COPILOT_VERSION=$(grep -oP '^\s*const DefaultCopilotVersion\s+Version\s*=\s*"\K[^"]+' "$CONSTANTS_FILE") |
| fi | ||
|
|
||
| # Read the current max-agent of the latest interval (entry with "open": true) | ||
| CURRENT_MAX_AGENT=$(jq -r '."agent-compat-v1".copilot[] | select(.open == true) | ."max-agent"' "$COMPAT_FILE") |
| # Build the binary, run make deps before this | ||
| .PHONY: build | ||
| build: sync-action-pins sync-action-scripts | ||
| build: sync-action-pins sync-action-scripts sync-compat |
Comment on lines
+54
to
+57
| if [ "$CHECK_ONLY" = "1" ]; then | ||
| echo "Error: compat.json is out of sync: max-agent=$CURRENT_MAX_AGENT, DefaultCopilotVersion=$COPILOT_VERSION" >&2 | ||
| echo "Run 'make sync-compat' to update." >&2 | ||
| exit 1 |
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.
compat.json's latest intervalmax-agentwas manually maintained and drifted fromDefaultCopilotVersioninversion_constants.go. This adds a script that keeps them in sync automatically.Changes
scripts/sync-compat.sh— readsDefaultCopilotVersionfrompkg/constants/version_constants.go, finds the latest interval ("open": true) in.github/aw/compat.json, and updates itsmax-agentto match. Idempotent; accepts--checkfor CI gate use.Makefile:sync-compat— runs the script; wired as abuilddependency so it fires on every buildcheck-stale-compat— exits non-zero ifmax-agentis out of sync (intended for CI).github/aw/compat.json—max-agentupdated1.0.56→1.0.75to match currentDefaultCopilotVersion