fix(model-inventory): enrich /reflect null models via models_url fallback#32939
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update model alias inventory for 2026-05-18
fix(model-inventory): enrich /reflect null models via models_url fallback
May 18, 2026
pelikhan
approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the daily model inventory workflow’s handling of Copilot /reflect responses where models: null by adding a best-effort enrichment step that fetches model IDs from each endpoint’s models_url, and updates agent instructions to consume the pre-fetched reflect payload from disk.
Changes:
- Add a
/reflectenrichment loop that fetches model IDs frommodels_urlfor configured endpoints withmodels == null, with warning-level logging on failures. - Update Steps 1–3 instructions to read Copilot reflect data from
/tmp/gh-aw/model-inventory/reflect.jsoninstead of querying the api-proxy directly. - Recompile the workflow lockfile.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/daily-model-inventory.md | Adds models_url fallback enrichment + updates instructions to use the enriched reflect.json artifact. |
| .github/workflows/daily-model-inventory.lock.yml | Regenerates the locked workflow with the updated pre-step script content. |
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:315
if [ -n "$ids" ]treats[]as a successful enrichment, so this can overwritemodels: nullwith an empty array even when the upstream returned no models (or parsing produced an empty list).awf_reflect.cjskeepsmodelsas null when the extracted ID list is empty. Consider checkinglength > 0before updatingreflect.json(otherwise leavemodelsnull and warn) to preserve the “unavailable vs empty” distinction.
if [ -n "$ids" ]; then
jq --arg p "$provider" --argjson m "$ids" \
'(.endpoints[] | select(.provider == $p) | .models) |= $m' \
"$OUT" > "${OUT}.tmp" && mv "${OUT}.tmp" "$OUT"
echo "Enriched $provider with $(printf '%s' "$ids" | jq 'length') model(s)"
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
+306
to
+310
| if raw=$(curl -fsS "$models_url" 2>&1); then | ||
| ids=$(printf '%s' "$raw" | jq -c '[.data[].id] // empty' 2>&1) || { | ||
| echo "Warning: failed to parse models response for $provider: $ids" | ||
| ids="" | ||
| } |
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.
The daily model inventory workflow reported Copilot as unavailable because the
/reflectendpoint returnsmodels: nullfor Copilot when the api-proxy hasn't completed its startup model fetch — there was no fallback to retrieve them.Changes
Pre-step enrichment (
Fetch Copilot reflect inventory)/reflect, iterates over configured endpoints wheremodels == nulland fetches model IDs directly from each endpoint'smodels_url— mirrors theenrichReflectModels()pattern inawf_reflect.cjsas documented in.github/aw/llms.mdAgent instruction consistency
http://api-proxy:10000/reflectdirectly — redundant since the pre-step already fetches and enriches the data. Updated all three to read from the pre-fetched/tmp/gh-aw/model-inventory/reflect.jsonmodels_urlenrichment flow and referencellms.mdLock file recompiled.