Add Neuralwatt provider#2220
Conversation
|
@clawsweeper re-review The previous review placeholder for 079293f appears stale after its lease expired. PR body now includes the focused Neuralwatt tests, TTY working-directory stability test, and make check verification. Please re-review the current head. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review The current review placeholder for 079293f appears stale after its lease expired. Current head has the Neuralwatt parser/account hardening fixes and PR body includes focused tests plus make check verification. Please re-review current head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The review placeholder for 079293f expired without a verdict. CI is clean and the PR body includes focused Neuralwatt tests plus make check verification. Please re-review current head. |
|
@clawsweeper re-review The review placeholder for 079293f expired again without a verdict. CI is clean and the PR body includes focused Neuralwatt tests plus make check verification. Please re-review current head. |
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 6:44 AM ET / 10:44 UTC. Summary Reproducibility: not applicable. as a current-main bug reproduction: this PR adds a new provider. The three review findings are source-reproducible from the new snapshot shape and existing generic picker, CLI, and status-item fallbacks. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Land one canonical Neuralwatt integration that presents subscription kWh, prepaid USD balance, and optional key allowance accurately across menu cards, menu-bar metrics, and CLI output, with exact-head redacted live proof; then close the competing branch as superseded. Do we have a high-confidence way to reproduce the issue? Not applicable as a current-main bug reproduction: this PR adds a new provider. The three review findings are source-reproducible from the new snapshot shape and existing generic picker, CLI, and status-item fallbacks. Is this the best way to solve the issue? No, not yet. The descriptor-based provider architecture and dual subscription/balance model fit the repository, but the selectable lanes and prepaid-only CLI/menu-bar fallbacks must be completed before this is the narrowest maintainable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 63215da42575. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (12 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The review placeholder for 079293f expired again without a verdict. CI is clean; current head includes the Neuralwatt hardening fixes and PR verification. Please re-review current head. |
1 similar comment
|
@clawsweeper re-review The review placeholder for 079293f expired again without a verdict. CI is clean; current head includes the Neuralwatt hardening fixes and PR verification. Please re-review current head. |
…ider # Conflicts: # README.md # Sources/CodexBar/UsageStore.swift # Sources/CodexBarCore/Generated/CodexParserHash.generated.swift # Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift # docs/configuration.md # docs/index.html # docs/llms.txt # docs/providers.md # docs/site-locales.mjs # docs/social.html
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72e7013215
ℹ️ 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".
| sessionLabel: "Subscription", | ||
| weeklyLabel: "Key allowance", |
There was a problem hiding this comment.
Prevent dead Neuralwatt metric options
Because .neuralwatt is not added to SettingsStore.isBalanceOnlyProvider or otherwise special-cased, PreferencesProvidersPane.menuBarMetricPicker takes the generic branch and uses these labels to expose Primary and Secondary choices. The secondary choice is misleading for Neuralwatt because the key allowance is stored in extraRateWindows, not snapshot.secondary, so selecting it falls back to the subscription window instead; this also contradicts the new coverage test that expects only Automatic. Add a Neuralwatt-specific/balance-only picker path or expose the allowance as a real selectable lane.
Useful? React with 👍 / 👎.
…ider # Conflicts: # README.md # Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift # Sources/CodexBarCore/Config/ProviderConfigEnvironment.swift # Sources/CodexBarCore/Generated/CodexParserHash.generated.swift # Sources/CodexBarCore/Providers/ProviderDescriptor.swift # Sources/CodexBarCore/Providers/Providers.swift # Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift # Tests/CodexBarTests/CLIDiagnoseCommandTests.swift # Tests/CodexBarTests/ProviderSettingsDescriptorTests.swift # docs/configuration.md # docs/index.html # docs/llms.txt # docs/providers.md # docs/site-locales.mjs # docs/social.html # docs/social.png
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ececf11c3
ℹ️ 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".
| secondary: nil, | ||
| tertiary: nil, | ||
| extraRateWindows: extras.isEmpty ? nil : extras, | ||
| providerCost: self.prepaidBalance, |
There was a problem hiding this comment.
Handle prepaid-only CLI balance display
When a Neuralwatt account has no active subscription, this snapshot has primary == nil but still carries the prepaid balance as providerCost with limit: 0. The existing CLI renderer falls back to rendering any no-primary providerCost as Cost: used / limit, so prepaid-only Neuralwatt users will see output like Cost: 4.5 / 0.0 instead of a balance line; add a Neuralwatt-specific CLI balance path or avoid the generic cost fallback for this balance snapshot.
Useful? React with 👍 / 👎.
…ider # Conflicts: # Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89befd19b3
ℹ️ 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".
| primary: subscriptionWindow, | ||
| secondary: nil, | ||
| tertiary: nil, | ||
| extraRateWindows: extras.isEmpty ? nil : extras, | ||
| providerCost: self.prepaidBalance, |
There was a problem hiding this comment.
Surface prepaid-only Neuralwatt balance in the menu bar
When the API returns subscription: null, subscriptionWindow is nil but providerCost still carries the prepaid balance. I checked StatusItemController.menuBarDisplayText and MenuBarMetricWindowResolver: Neuralwatt has no balance special case, and automatic mode falls back to snapshot.primary ?? snapshot.secondary, so prepaid-only users get an icon-only status item despite having a balance. Add a Neuralwatt balance fallback or expose the balance as the selected menu-bar value for this case.
Useful? React with 👍 / 👎.
|
Merged as 82f161b. Verification on exact PR head 7b63ab4:
Reviewed the full provider diff and endpoint/security boundaries. The implementation uses the official HTTPS quota endpoint, keeps endpoint overrides HTTPS-only, validates overrides before credential use, does not log response bodies, and remains disabled by default. It displays subscription kWh and prepaid balance as separate pools and maps Live Neuralwatt account verification was unavailable, so no live provider probe was run. Synthetic/captured payload coverage exercises both quota pools. |
Summary
Verification
swift test --filter NeuralWattUsageFetcherTestsswift test --filter UsageStoreNeuralWattAccountRefreshTestsswift test --filter TTYCommandRunnerEnvTestsmake check