feat: add Nano-GPT provider across app and CLI#76
Conversation
Integrate Nano-GPT as a quota-based provider with daily/monthly reset tracking, local icon assets, and auth parsing support. Add UI/CLI wiring and tests so Nano-GPT usage, balances, and the subscription preset are available end-to-end.
|
Integrating Nano-GPT provider support into the app and CLI with usage tracking, balance checks, and UI updates. Creating This is just a preview, dude. For a detailed, line-by-line code review (including bug detection and security checks), please write a comment like |
|
@opgginc/op-gg-ai-devops review this |
|
|
|
@copilot review this! |
|
@opgginc/op-gg-ai-devops |
❌ AI Code Review CancelledNewer commit detected or workflow was manually cancelled. 📋 View Logs | 🤖 Model: |
Co-authored-by: Daltonganger <r.beuker@ziggo.nl>
…resolution Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
✅ AI Code Review Completed
Review posted with one performance suggestion and CI still running. Dependency install and smoke tests were skipped due to missing lockfiles and macOS/Xcode. Follow up once CI finishes. Reviewed with |
There was a problem hiding this comment.
🤖 OP.GG DevOps AI Code Review
Overview
- Adds Nano-GPT provider support across app/CLI, assets, and API docs.
Findings
- See inline comment about reducing fetch latency by running independent requests in parallel.
CI/CD Status
- In progress: CI, Build and Release, Test.
- Passed: Lint.
Tests
- Dependency install skipped (no JS lockfiles found).
- Smoke tests not run here (macOS/Xcode not available in this environment).
Default Review Language
- Set this in
AGENTS.md. Example:Default review language: English.
The bot will automatically re-review the entire PR when new commits are pushed.
Mention @opgginc/op-gg-ai-devops in a PR comment to trigger another review with focus, e.g.:
- @opgginc/op-gg-ai-devops check Nano-GPT fetch latency changes
- @opgginc/op-gg-ai-devops review Nano-GPT docs for accuracy
- @opgginc/op-gg-ai-devops scan for missing tests in Nano-GPT provider
Co-authored-by: op-gg-ai-devops[bot] <255644809+op-gg-ai-devops[bot]@users.noreply.github.com>
✅ AI Code Review CompletedThe review of the Nano-GPT provider implementation is finished, confirming solid architecture and code quality. Suggestions for improved testability and performance have been added. CI/CD checks for linting passed, while tests are currently in progress. Review Progress
Reviewed with |
There was a problem hiding this comment.
🤖 OP.GG DevOps AI Code Review
Summary
This PR introduces the Nano-GPT provider, fully integrating it into both the App and CLI. The changes include:
- Core Logic:
NanoGptProviderimplementation with concurrent fetching of usage and balance. - Integration: Updates to
ProviderManager,CLIProviderManager, andStatusBarController. - UI: New menu items for daily/monthly quotas and balance display.
- Documentation: Updates to
README.mdand API references.
The implementation aligns well with the project's architecture, using actor-based concurrency and robust JSON decoding for loose types.
CI/CD Status
- Lint: ✅ Passed
- Test / Build: 🔄 In Progress
Suggestions
I have added inline comments regarding:
- Testability: Making the provider testable in CI without real API keys.
- Performance: Reusing
ISO8601DateFormatterinstances.
Please check the inline comments for details.
Note: Please add Default review language: English to AGENTS.md to explicitly set the review language preference.
| } | ||
|
|
||
| func testFetchSuccessCreatesProviderResult() async throws { | ||
| guard TokenManager.shared.getNanoGptAPIKey() != nil else { |
There was a problem hiding this comment.
Tests should ideally run in CI without verifying against a real environment configuration.
Consider refactoring NanoGptProvider to accept an optional API key in its initializer (or inject a mockable TokenManager). This would allow you to pass a dummy key during testing and verify the logic without skipping.
Example refactor idea:
init(tokenManager: TokenManager = .shared, session: URLSession = .shared, apiKey: String? = nil) { ... }| let formatterWithFractional = ISO8601DateFormatter() | ||
| formatterWithFractional.formatOptions = [.withInternetDateTime, .withFractionalSeconds] | ||
|
|
||
| let formatterWithoutFractional = ISO8601DateFormatter() |
There was a problem hiding this comment.
Creating ISO8601DateFormatter is expensive. Since this method may be called frequently, consider making these formatters static properties to reuse instances.
Example:
private static let formatterWithFractional: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
return formatter
}()
private static let formatterWithoutFractional: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime]
return formatter
}()Then use Self.formatterWithFractional inside the function.
Summary
Verification