Merged
Conversation
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Fix Puppeteer deprecated API and improve model scraping accuracy with normalized model names
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.
This pull request introduces an automated workflow to keep the Copilot Token Tracker extension's model data up-to-date with GitHub Copilot's officially supported models. It adds scripts and GitHub Actions to scrape Copilot's documentation, compare the results with local configuration files, and alert maintainers when updates are needed. Additionally, it improves documentation and code maintainability by loading model data from JSON files and displaying estimated costs in the extension UI.
The most important changes are:
Automation for model updates:
.github/workflows/check-models.yml) that scrapes the official Copilot documentation for supported models, compares them to localtokenEstimators.jsonandmodelPricing.json, and opens a GitHub issue if any models are missing. This ensures the extension's model data stays current without manual checking..github/scripts/scrape-models.sh) using Puppeteer to extract model names from the documentation, outputting results as JSON and plain text for the workflow to consume..github/workflows/tag-on-issue.yml) to automatically tag a user or team when a new issue is created, improving notification and response times for required updates.Data and documentation improvements:
src/tokenEstimators.json,src/modelPricing.json) and updated the code to load these at runtime, replacing hardcoded values. [1] [2]src/README.mdwith instructions for updating the JSON data files, including structure, update procedures, and pricing source details. [1] [2]Extension UI and code enhancements:
jsdomfor future-proofing or possible HTML parsing needs.These changes collectively automate the maintenance of supported model data, improve transparency around updates, and enhance the user experience by showing cost estimates based on up-to-date pricing information.