Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fbb33e3ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Collect features from any entitlement that has them enabled | ||
| let hasSoloBuilder = quota["enable_solo_builder"] as? Bool ?? false | ||
| let hasSoloCoder = quota["enable_solo_coder"] as? Bool ?? false | ||
|
|
There was a problem hiding this comment.
Only aggregate Trae feature flags from active entitlements
Feature flags are merged for every entitlement regardless of status. If the API returns inactive/expired entitlements (status=0) that still include flags like enable_solo_builder, the UI will advertise features the user no longer has (they show up in the Trae plan label). This is most visible when a previous plan had features but is no longer active. Consider gating feature aggregation on status == 1 so only active entitlements contribute.
Useful? React with 👍 / 👎.
…utomatic browser cookie import (JWT not stored in cookies)\n- Simplify UI to manual JWT entry only\n- Add clear step-by-step instructions in settings\n- Update documentation to explain manual JWT extraction process\n- Remove settingsPickers (not needed for manual-only mode)\n\nThe JWT is not stored in browser cookies or localStorage - it only\nexists in HTTP headers during API requests. Users must manually copy\nit from browser DevTools Network tab.
Summary
Add Trae AI IDE provider to track usage via JWT-based authentication.
Trae is ByteDance's AI-powered IDE (similar to Cursor). This provider fetches fast request quota usage from the web API and displays it in the menu bar.
Important Note: Manual JWT Entry Only
Unlike other providers, Trae does not store the JWT in browser cookies or localStorage. The JWT only exists in HTTP headers during API requests. Therefore, this implementation uses manual JWT entry only - users copy the JWT from browser DevTools.
Features
How to Use
user_current_entitlement_listAuthorizationheader value (starts withCloud-IDE-JWT)API Details
https://api-sg-central.trae.ai/trae/api/v1/pay/user_current_entitlement_listAuthorization: Cloud-IDE-JWT <token>headerFiles Added/Modified
Core Implementation:
Sources/CodexBarCore/Providers/Trae/TraeProviderDescriptor.swift- Provider metadataSources/CodexBarCore/Providers/Trae/TraeUsageFetcher.swift- HTTP client & JWT authSources/CodexBarCore/Providers/Trae/TraeUsageParser.swift- API response parsingSources/CodexBarCore/Providers/Trae/TraeUsageSnapshot.swift- Data modelUI Integration:
Sources/CodexBar/Providers/Trae/TraeSettingsStore.swift- Settings persistenceSources/CodexBar/Providers/Trae/TraeProviderImplementation.swift- Manual JWT entry UIIntegration Files (20+ files updated with .trae enum cases):
Tests:
Tests/CodexBarTests/TraeUsageParserTests.swift- 10 test casesDocumentation:
docs/trae.md- Provider documentation with JWT extraction instructionsdocs/providers.md- Updated provider listKey Implementation Details
Testing
swift build