Skip to content

[JET] Add Alibaba and Xiaomi MiMo Token Plan quota readers - #554

Merged
jaywedgeworth22 merged 3 commits into
mainfrom
jet/token-plan-quota-readers
Nov 25, 2026
Merged

jaywedgeworth22 merged 3 commits into
mainfrom
jet/token-plan-quota-readers

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Adds Alibaba Token Plan and Xiaomi MiMo Token Plan as optional local quota readers. Both are opt-in and appear in Settings → Sources & Fleet.

Alibaba reads quota by running the signed-in Bailian CLI (bl usage token-plan --output json) and parses only reported per*Percentage windows with reset times. Missing quota or malformed windows are treated as unavailable, not full. No browser profile is read.

Xiaomi MiMo reads quota from the matching regional credits endpoint using an individual Token Plan key (tp- format) and region (China / Singapore / Europe) saved in the Mac Keychain via new MiMoQuotaSettings. Saving a new key flushes the prior reading before re-enabling the reader. The parser preserves the reported credit balance and billing-cycle period rather than assuming monthly.

Also wires both readers into LocalQuotaReaderRegistry and MonitorModel, defaults new Token Plan readers to disabled while leaving existing reader defaults unchanged, adds docs/TOKEN-PLAN-SOURCES.md, and renames a local variable in SettingsInfisicalPage.

Tests added in TokenPlanQuotaReaderTests cover Alibaba window parsing and invalid-data handling, MiMo credit and period parsing including exhausted and expired cases, fixed regional hosts, and opt-in defaults. No test run results, deployment, or live account and region verification are reported in the changes, so live behavior remains unverified.

Unresolved risk: automated review reports MainActor state mutated from a non-isolated Task in MiMoQuotaSettings.save() (`MiMoQuotaSettings.swift:63).

@kody-ai

This comment has been minimized.

@kody-ai

kody-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

A newer commit arrived while Kody reviewed this one; Kody decides on the next reviewed commit.

@jaywedgeworth22
jaywedgeworth22 marked this pull request as ready for review November 25, 2026 05:50
@github-actions

Copy link
Copy Markdown
Contributor
Autofix run https://github.com/Simple-With-Us/CodeCaps/actions/runs/45556595708 started for `sentry[bot]`'s tagged request. Owner/sentry request: exempt from the per-bot cap (owner rule 2026-10-20).

@kody-ai

kody-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@jaywedgeworth22
jaywedgeworth22 enabled auto-merge (squash) November 25, 2026 06:13
@jaywedgeworth22
jaywedgeworth22 merged commit e22cfde into main Nov 25, 2026
10 checks passed
jaywedgeworth22 added a commit that referenced this pull request Nov 26, 2026
…efs OPS-1122) (#556)

* Add OpenCode Go reader, declarative endpoint plugins, and UI/perf review fixes (Refs OPS-1122)

- OpenCode Go: documented usage endpoint via the CLI's local auth file
- Endpoint plugins: validated JSON descriptors in the Plugins folder,
  generic bounded reader, SSRF gate, Settings toggles without recompiling
- Alibaba/MiMo/Qwen verified against #554/#555 (already on main), docs updated
- UI: sentenceGap, accent-ink shortcut, logo fallback from reader list,
  PiP keyboard/VoiceOver access, larger tertiary labels, keyboard splitter,
  popup no longer auto-expires for VoiceOver/Reduce Motion, right-click hint
- Perf: snapshot-write chain predecessor deadline surfaces a stuck write
  instead of stalling silently; v2 publisher retries transient 502/503/504

* Avoid reloading plugin descriptors per logo-style row (Refs OPS-1122)

* Declare OpenCode Go reader conformance (Refs OPS-1122)

* Fix banner string syntax (Refs OPS-1122)

* Address Kody findings on endpoint plugins (Refs OPS-1122)

- Restrict bearerEnv to CODECAPS_PLUGIN_-prefixed variables and name the
  missing variable in the plugin issue
- Refuse non-canonical IP literals (hex/octal/bare-integer/leading-zero)
  and scope the loopback port exception to loopback hosts only
- Reject descriptors with both percent paths; dedicated badDisplayName error
- Reject out-of-range percentages instead of clamping them
- Cache plugin loads for Settings rows and reader toggles

* Fix trailing-dot, cache-stamp and absolute-fallback findings (Refs OPS-1122)

* Scan plugins off the cache lock (Refs OPS-1122)

* Single-flight the plugin cache scan (Refs OPS-1122)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant