Skip to content

Add platform-specific quota implementations and improve error handling#17

Open
Your-Voldemort wants to merge 4 commits intovbgate:mainfrom
Your-Voldemort:fix-copilot-tier
Open

Add platform-specific quota implementations and improve error handling#17
Your-Voldemort wants to merge 4 commits intovbgate:mainfrom
Your-Voldemort:fix-copilot-tier

Conversation

@Your-Voldemort
Copy link

Enhance the quota setup instructions by adding a missing tier field and improve error handling in the quota configuration and token exchange functions. Implement timeout handling for platform queries to ensure independent execution of each query. Additionally, introduce documentation for platform-specific implementations.

Copilot AI review requested due to automatic review settings February 26, 2026 15:02
Copy link

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

This PR enhances the quota querying plugin with improved robustness and user experience. It introduces platform-independent timeout handling to ensure one slow API doesn't block others, adds better error logging for debugging, and fixes missing documentation for the GitHub Copilot quota configuration. Additionally, it introduces comprehensive AGENTS.md documentation files to guide future development.

Changes:

  • Refactored platform query execution with independent timeouts using Promise.allSettled instead of Promise.all
  • Added missing tier field to GitHub Copilot quota setup instructions in both Chinese and English
  • Enhanced error logging in JWT parsing and token exchange functions without changing API contracts

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plugin/mystatus.ts Introduces structured platform query configuration with independent timeout handling via queryWithTimeout wrapper and Promise.allSettled
plugin/lib/openai.ts Adds error logging to JWT parsing function for better debugging
plugin/lib/i18n.ts Updates quota setup instructions to include required tier field with valid values explanation
plugin/lib/copilot.ts Adds error logging to quota config reading and token exchange functions
plugin/lib/AGENTS.md New documentation file describing platform implementation patterns and conventions
AGENTS.md New project-level documentation providing codebase overview and conventions
.gitignore Adds entries for AI coding assistant directories and lock files

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


- Progress bars in output (█ characters)
- JWT token parsing for email extraction
- Parallel Promise.all for all platform queries
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Line 62 states "Parallel Promise.all for all platform queries", but the implementation now uses Promise.allSettled instead of Promise.all (see mystatus.ts line 129). This is an important architectural change that ensures one failing platform doesn't block others.

The documentation should be updated to:
"- Parallel Promise.allSettled with independent timeouts for platform queries"

This accurately reflects the new implementation and the important guarantee it provides about platform independence.

Suggested change
- Parallel Promise.all for all platform queries
- Parallel Promise.allSettled with independent timeouts for platform queries

Copilot uses AI. Check for mistakes.
}
}

// 3. Export from mystatus.ts and add to Promise.all
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The documentation comment references adding new platforms to "Promise.all", but the actual implementation in mystatus.ts now uses Promise.allSettled with a structured platforms array (lines 95-126).

The comment should be updated to reflect the current pattern, for example:
"3. Add to platforms array in mystatus.ts with timeout configuration"

This ensures that future developers adding new platforms follow the current architectural pattern rather than an outdated one.

Suggested change
// 3. Export from mystatus.ts and add to Promise.all
// 3. Export from mystatus.ts and add to the platforms array with timeout configuration

Copilot uses AI. Check for mistakes.
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.

2 participants