Add platform-specific quota implementations and improve error handling#17
Add platform-specific quota implementations and improve error handling#17Your-Voldemort wants to merge 4 commits intovbgate:mainfrom
Conversation
There was a problem hiding this comment.
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.allSettledinstead ofPromise.all - Added missing
tierfield 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 |
There was a problem hiding this comment.
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.
| - Parallel Promise.all for all platform queries | |
| - Parallel Promise.allSettled with independent timeouts for platform queries |
| } | ||
| } | ||
|
|
||
| // 3. Export from mystatus.ts and add to Promise.all |
There was a problem hiding this comment.
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.
| // 3. Export from mystatus.ts and add to Promise.all | |
| // 3. Export from mystatus.ts and add to the platforms array with timeout configuration |
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.