Skip to content

Use AWF /reflect for Copilot model discovery in daily-model-inventory#31834

Merged
pelikhan merged 6 commits into
mainfrom
copilot/use-awf-reflect-endpoint
May 13, 2026
Merged

Use AWF /reflect for Copilot model discovery in daily-model-inventory#31834
pelikhan merged 6 commits into
mainfrom
copilot/use-awf-reflect-endpoint

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

✨ Enhancement

daily-model-inventory was relying on direct Copilot API calls with COPILOT_GITHUB_TOKEN, which was failing with HTTP 400 and creating an unnecessary secret dependency. This change moves Copilot model discovery to the AWF api-proxy /reflect path used by the runtime.

  • What does this improve?

    • Removes brittle direct Copilot model fetch logic from the workflow pre-jobs.
    • Uses live Copilot model data from AWF /reflect for inventory and multiplier analysis.
    • Simplifies workflow setup by removing COPILOT_GITHUB_TOKEN dependency for model discovery.
  • Why is this valuable?

    • Aligns model discovery with the existing AWF proxy auth/routing path.
    • Avoids known failure mode (api.githubcopilot.com/models HTTP 400).
    • Reduces operational surface area (one fewer collection job and artifact dependency).
  • Implementation approach:

    • Removed collect_copilot_models job from .github/workflows/daily-model-inventory.md.
    • Added/updated bash tools to fetch and inspect /reflect once, then query Copilot models from the saved payload.
    • Updated prompt sections:
      • ## Inputs: Copilot source is /reflect instead of pre-step Copilot artifact.
      • Step 1/2: explicitly query/filter Copilot endpoint from /reflect.
      • Step 3: Copilot multiplier comparison now uses Copilot models sourced from /reflect plus docs-derived multiplier data.
    • Added graceful handling for /reflect unavailability so analysis continues for other providers.
mkdir -p /tmp/gh-aw/model-inventory && \
  (curl -fsS http://api-proxy:10000/reflect > /tmp/gh-aw/model-inventory/reflect.json || \
   printf "%s" "{\"endpoints\":[],\"error\":\"reflect endpoint unavailable\"}" > /tmp/gh-aw/model-inventory/reflect.json)

jq ".endpoints[] | select(.provider == \"copilot\") | .models" /tmp/gh-aw/model-inventory/reflect.json

Copilot AI and others added 5 commits May 13, 2026 01:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Use AWF /reflect endpoint for Copilot models in daily model inventory Use AWF /reflect for Copilot model discovery in daily-model-inventory May 13, 2026
Copilot AI requested a review from pelikhan May 13, 2026 01:31
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 01:39
Copilot AI review requested due to automatic review settings May 13, 2026 01:39
@pelikhan pelikhan merged commit ae05c6d into main May 13, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/use-awf-reflect-endpoint branch May 13, 2026 01:39
Copy link
Copy Markdown
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

Moves Copilot model discovery in the daily-model-inventory workflow from direct Copilot API calls (requiring COPILOT_GITHUB_TOKEN) to using the AWF api-proxy /reflect endpoint, aligning discovery with the runtime gateway path.

Changes:

  • Removes the collect_copilot_models pre-job (and its artifact upload) from the workflow.
  • Adds tooling to fetch and query http://api-proxy:10000/reflect for Copilot model IDs.
  • Updates the workflow prompt/instructions to treat Copilot inventory as coming from /reflect and to continue gracefully when /reflect is unavailable.
Show a summary per file
File Description
.github/workflows/daily-model-inventory.md Removes direct Copilot model fetch job and switches Copilot model discovery instructions/tools to use AWF /reflect.

Copilot's findings

Tip

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

Comments suppressed due to low confidence (1)

.github/workflows/daily-model-inventory.md:363

  • Per the documented /reflect response shape, endpoints[].models is a list of model IDs (or null while discovery runs) and does not include vendor/capabilities/billing metadata. The note that Copilot models from /reflect "may include vendor metadata" appears inaccurate and could mislead the analysis steps. Consider rewording to match /reflect (IDs only), and if vendor attribution is required, describe how it will be derived.
Note: Copilot model data must be read from the AWF `/reflect` endpoint. Copilot serves models from
multiple vendors (Anthropic, OpenAI, Google), and those models may include `vendor` metadata.
  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment on lines +301 to +303
- "mkdir -p /tmp/gh-aw/model-inventory && (curl -fsS http://api-proxy:10000/reflect > /tmp/gh-aw/model-inventory/reflect.json || printf \"%s\" \"{\\\"endpoints\\\":[],\\\"error\\\":\\\"reflect endpoint unavailable\\\"}\" > /tmp/gh-aw/model-inventory/reflect.json)"
- "jq . /tmp/gh-aw/model-inventory/reflect.json"
- "jq \".endpoints[] | select(.provider == \\\"copilot\\\") | .models\" /tmp/gh-aw/model-inventory/reflect.json"
Comment on lines +343 to 347
- Copilot live provider metadata: available via `http://api-proxy:10000/reflect` (filter
`.endpoints[] | select(.provider == "copilot")`). If `/reflect` is unavailable, treat Copilot
data as unavailable for this run and continue with the remaining providers.

Each enriched `models.json` entry has the form (fields vary by provider):
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.

[q] Use AWF /reflect endpoint for Copilot models in daily-model-inventory

3 participants