feat: add Synthetic provider plugin#329
Conversation
Add a new provider plugin for Synthetic (synthetic.new) that displays quota usage from their /v2/quotas API endpoint. Supports both the new v3 rate limit system (rolling 5h request limit and weekly mana bar) and the legacy subscription based quota, showing whichever is relevant to the user's account. Search quota is shown for all users. API key discovery checks multiple sources in order: Pi auth.json, Pi models.json, Factory/Droid settings.json, OpenCode auth.json, and the SYNTHETIC_API_KEY env var. Two new env vars are whitelisted in the Rust host (SYNTHETIC_API_KEY and PI_CODING_AGENT_DIR). Icon sourced from synthetic.new/favicon.svg. Brand color is black to match their branding. Files added: - plugins/synthetic/plugin.json - plugins/synthetic/plugin.js - plugins/synthetic/plugin.test.js (52 tests) - plugins/synthetic/icon.svg - docs/providers/synthetic.md Files modified: - src-tauri/src/plugin_engine/host_api.rs (env var whitelist)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54e15dd895
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new “Synthetic” provider plugin that fetches and displays quota usage from Synthetic’s /v2/quotas endpoint, including support for both the new v3 rate-limit system and the legacy subscription model.
Changes:
- Added
syntheticprovider plugin (manifest, implementation, icon) and comprehensive Vitest coverage. - Added provider documentation for Synthetic (auth discovery, endpoint details, displayed metrics).
- Whitelisted
SYNTHETIC_API_KEYandPI_CODING_AGENT_DIRfor plugin env access in the Tauri host API.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src-tauri/src/plugin_engine/host_api.rs | Extends env-var allowlist to support Synthetic plugin auth/discovery. |
| plugins/synthetic/plugin.json | Declares Synthetic plugin metadata and line definitions (scopes/orders). |
| plugins/synthetic/plugin.js | Implements API key discovery and /v2/quotas probing + line rendering. |
| plugins/synthetic/plugin.test.js | Adds extensive tests covering auth resolution, errors, and v3/legacy outputs. |
| plugins/synthetic/icon.svg | Adds Synthetic icon used in UI. |
| docs/providers/synthetic.md | Documents auth sources, API shape, and displayed lines for Synthetic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ben-vargas if you can resolve the conversation we can continue with merging process, thank you for your contribution! |
|
@validatedev addressed the actionable bot feedback, pushed the fixes ( |
validatedev
left a comment
There was a problem hiding this comment.
Thanks for the fixes, current code looks good to be merged!
Description
Adds a new provider plugin for Synthetic that displays quota usage from their
/v2/quotasAPI endpoint.Synthetic is currently rolling out a new rate limit system (v3) alongside the legacy subscription model. This plugin supports both:
The plugin auto-detects which system the user is on based on whether the API response contains usable v3 quota fields for
rollingFiveHourLimitorweeklyTokenLimit.API key discovery checks multiple sources in order:
auth.jsonmodels.jsonsettings.json(matchescustomModelsentries withsynthetic.newin the baseUrl)auth.jsonSYNTHETIC_API_KEYenv varRelated Issue
N/A — no existing issue for this provider.
Type of Change
Testing
bun run buildand it succeededbun run testand all tests pass (991 tests, 59 files, including 52 new tests for this plugin)bun tauri devScreenshots
Overview — Synthetic in the main plugin list
Detail view — 5h Rate Limit, Mana Bar, and Search
Settings — Synthetic as a toggleable plugin
API response — raw /v2/quotas output matching the displayed values
Synthetic billing page — their own dashboard for comparison
Files
Added:
plugins/synthetic/plugin.json— manifest with 6 line declarationsplugins/synthetic/plugin.js— probe implementation with multi-source auth discoveryplugins/synthetic/plugin.test.js— 52 tests covering auth, errors, all line types, v3/legacy detectionplugins/synthetic/icon.svg— sourced from synthetic.new/favicon.svgdocs/providers/synthetic.md— provider documentationModified:
src-tauri/src/plugin_engine/host_api.rs— addedSYNTHETIC_API_KEYandPI_CODING_AGENT_DIRto env var whitelistChecklist
mainbranch