Skip to content

feat: sync compat.json max-agent with DefaultCopilotVersion at build time - #49113

Merged
pelikhan merged 3 commits into
mainfrom
copilot/sync-compat-json-cli-version
Jul 30, 2026
Merged

feat: sync compat.json max-agent with DefaultCopilotVersion at build time#49113
pelikhan merged 3 commits into
mainfrom
copilot/sync-compat-json-cli-version

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

compat.json's latest interval max-agent was manually maintained and drifted from DefaultCopilotVersion in version_constants.go. This adds a script that keeps them in sync automatically.

Changes

  • scripts/sync-compat.sh — reads DefaultCopilotVersion from pkg/constants/version_constants.go, finds the latest interval ("open": true) in .github/aw/compat.json, and updates its max-agent to match. Idempotent; accepts --check for CI gate use.
  • Makefile:
    • sync-compat — runs the script; wired as a build dependency so it fires on every build
    • check-stale-compat — exits non-zero if max-agent is out of sync (intended for CI)
  • .github/aw/compat.jsonmax-agent updated 1.0.561.0.75 to match current DefaultCopilotVersion

Copilot AI and others added 2 commits July 30, 2026 10:10
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…in sync

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 30, 2026 10:21
Copilot AI review requested due to automatic review settings July 30, 2026 10:21
@pelikhan
pelikhan merged commit e885e87 into main Jul 30, 2026
28 of 29 checks passed
@pelikhan
pelikhan deleted the copilot/sync-compat-json-cli-version branch July 30, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-agent to 1.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: false to freeze the catch-all interval. Failing here makes every make build unusable during that state. Treat an empty selection as an intentional no-op while still rejecting an open row with no max-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

Comment thread scripts/sync-compat.sh
done

# Extract DefaultCopilotVersion from Go constants file
COPILOT_VERSION=$(grep -oP '^\s*const DefaultCopilotVersion\s+Version\s*=\s*"\K[^"]+' "$CONSTANTS_FILE")
Comment thread scripts/sync-compat.sh
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")
Comment thread Makefile
# 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 thread scripts/sync-compat.sh
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
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

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.

3 participants