Skip to content

improve daily-model-inventory: richer endpoint data and token multiplier analysis#30018

Merged
pelikhan merged 1 commit intomainfrom
copilot/improve-daily-models-inventory-workflow
May 3, 2026
Merged

improve daily-model-inventory: richer endpoint data and token multiplier analysis#30018
pelikhan merged 1 commit intomainfrom
copilot/improve-daily-models-inventory-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

The workflow only cached model IDs and had no mechanism to validate or infer the ET multipliers in model_multipliers.json against live API data.

Data collection

Each provider's fetch job now extracts enriched metadata and uploads both models.json (structured) and raw.json (full API response) as artifacts:

Provider New fields captured
OpenAI owned_by, created
Anthropic display_name, created_at, type
Gemini display_name, description, input_token_limit, output_token_limit, supported_generation_methods, version
Copilot name, vendor, version, capabilities (limits + supports flags), billing

Agent prompt (6 steps, was 4)

  • Step 2 — Explore Raw API Fields: agent inspects each provider's raw.json, identifies which fields carry context limits, capability flags, or billing/pricing data, and summarizes what's worth caching going forward.
  • Step 3 — Infer Token Multipliers: agent cross-references live data with model_multipliers.json using provider-specific strategies (Copilot billing.multiplier directly; Gemini inputTokenLimit/outputTokenLimit as a complexity heuristic; OpenAI/Anthropic naming conventions) and produces a gap table: missing entries, stale entries, and inferred-vs-stored discrepancies.

Issue template

Adds Raw API Fields Discovered and Token Multiplier Analysis sections (with sub-tables for missing, stale, and discrepant multipliers) to the generated issue body.

Tools allowlist

Added bash allowlist entries so the agent can query raw.json artifacts and model_multipliers.json.

…alysis

- Capture enriched metadata from each /models endpoint:
  - OpenAI: owned_by, created
  - Anthropic: display_name, created_at, type
  - Gemini: display_name, description, input/output token limits,
    supported_generation_methods, version
  - Copilot: name, vendor, version, capabilities (limits, supports),
    billing (potential multiplier field)
- Upload raw.json artifacts alongside models.json for each provider
- Add bash allowlist entries for agent to explore raw data and
  model_multipliers.json
- Add Step 2 (Explore Raw API Fields) to agent prompt
- Add Step 3 (Infer Token Multipliers) with gap table against
  model_multipliers.json
- Renumber old Steps 2-4 to Steps 4-6
- Expand issue template with Raw API Fields Discovered section and
  Token Multiplier Analysis section (missing, stale, discrepant)
- Recompile lock file

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/acec121c-6c32-4b2d-bcc0-70192781e4a8

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 3, 2026 21:47
Copilot AI review requested due to automatic review settings May 3, 2026 21:47
@pelikhan pelikhan merged commit 5f64607 into main May 3, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/improve-daily-models-inventory-workflow branch May 3, 2026 21:47
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

Enhances the daily model inventory workflow to cache richer per-provider model metadata, preserve raw API responses as artifacts, and expand the agent prompt to analyze/validate token multipliers against live data.

Changes:

  • Enrich provider models.json with additional metadata fields and upload raw.json alongside it for OpenAI/Anthropic/Gemini/Copilot.
  • Expand the agent prompt to explore raw API fields and infer/validate ET token multipliers vs pkg/cli/data/model_multipliers.json.
  • Extend the tool allowlist to enable querying raw.json artifacts and the multiplier table.
Show a summary per file
File Description
.github/workflows/daily-model-inventory.md Updates collection steps to produce enriched model metadata + raw artifacts; expands prompt steps and issue template; extends bash tool allowlist.
.github/workflows/daily-model-inventory.lock.yml Regenerates the locked workflow to reflect the new artifact outputs and expanded tool allowlist.

Copilot's findings

Tip

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

Comments suppressed due to low confidence (3)

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

  • The Copilot fetch uses curl -sf -o "$OUT/raw.json" ... || true; with -f, HTTP errors can prevent raw.json from being written, but the upload step requires it and will fail. Ensure raw.json is always produced (either capture error bodies by dropping -f or write a fallback JSON error response when curl fails).
          HTTP_STATUS=$(curl -sf -o "$OUT/raw.json" -w "%{http_code}" \
            -H "Authorization: Bearer $COPILOT_GITHUB_TOKEN" \
            -H "Copilot-Integration-Id: copilot-chat" \
            https://api.githubcopilot.com/models) || true

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

  • Same curl -sf -o "$OUT/raw.json" ... || true issue here: with -f, raw.json may not be written for non-200 responses, but the artifact upload expects it and will error. Ensure raw.json is always present (capture error bodies by dropping -f or write a fallback JSON error payload on failure) and avoid an empty HTTP_STATUS in the error message.
          HTTP_STATUS=$(curl -sf -o "$OUT/raw.json" -w "%{http_code}" \
            -H "x-api-key: $ANTHROPIC_API_KEY" \
            -H "anthropic-version: 2023-06-01" \
            https://api.anthropic.com/v1/models) || true

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

  • With curl -sf -o "$OUT/raw.json" ... || true, a non-200 response (or network failure) can result in raw.json not being created because -f suppresses output on HTTP errors. The subsequent artifact upload includes raw.json and will fail if it’s missing. Ensure raw.json is always created and consider capturing error bodies by removing -f.
          HTTP_STATUS=$(curl -sf -o "$OUT/raw.json" -w "%{http_code}" \
            "https://generativelanguage.googleapis.com/v1beta/models?key=${GEMINI_API_KEY}") || true
  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment on lines +258 to +264
- "jq '[.data[] | keys] | add | unique' /tmp/gh-aw/model-inventory/artifacts/openai-models/raw.json"
- "jq '[.data[] | keys] | add | unique' /tmp/gh-aw/model-inventory/artifacts/anthropic-models/raw.json"
- "jq '[.models[] | keys] | add | unique' /tmp/gh-aw/model-inventory/artifacts/gemini-models/raw.json"
- "jq '[.data[] | keys] | add | unique' /tmp/gh-aw/model-inventory/artifacts/copilot-models/raw.json"
- "jq '[.data[] | .capabilities | keys] | add | unique' /tmp/gh-aw/model-inventory/artifacts/copilot-models/raw.json"
- "jq '[.data[] | select(.billing != null)] | length' /tmp/gh-aw/model-inventory/artifacts/copilot-models/raw.json"
- "jq '.data[] | {id, billing}' /tmp/gh-aw/model-inventory/artifacts/copilot-models/raw.json"
Comment on lines 1195 to 1197
HTTP_STATUS=$(curl -sf -o "$OUT/raw.json" -w "%{http_code}" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
https://api.openai.com/v1/models) || true
Comment on lines 41 to 43
HTTP_STATUS=$(curl -sf -o "$OUT/raw.json" -w "%{http_code}" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
https://api.openai.com/v1/models) || true
@github-actions github-actions Bot mentioned this pull request May 3, 2026
Copilot AI added a commit that referenced this pull request May 3, 2026
…alysis (#30018)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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