Skip to content

Use CLIProxyAPI v8 native quotas and readable OpenCode Go accounts - #10

Open
darfink wants to merge 1 commit into
massiveits:mainfrom
darfink:feat/native-plugin-quota
Open

darfink wants to merge 1 commit into
massiveits:mainfrom
darfink:feat/native-plugin-quota

Conversation

@darfink

@darfink darfink commented Sep 30, 2026 •

Copy link
Copy Markdown

This PR moves the plugin to CLIProxyAPI v8 and replaces its separate quota page with native quota integration.

Changes

  • Migrate the SDK dependency and imports from v7 to v8.
  • Advertise quota_provider and implement quota.identifier, quota.describe, and quota.fetch.
  • Fetch rolling, weekly, and monthly quotas with the credential selected by CLIProxyAPI.
  • Keep missing readings unknown, reject invalid values, and redact provider errors.
  • Remove the separate quota page and custom management routes.
  • Accept an optional name on API key entries and use readable account labels.
  • Preserve credential IDs, existing filenames, custom labels, and host metadata.
  • Prevent duplicate credential records at cold start.

The plugin version becomes 0.2.0 and requires CLIProxyAPI v8.0.0 or later.
Quota reset remains unsupported.

Scope

Model-specific reasoning metadata and additional Muse Spark/Responses compatibility fixes remain local.
They are not part of this PR. Existing model discovery and protocol behavior from main remain unchanged.

The release notes retain the existing entries. README local build and test commands now use the required debug tag.

Validation

  • go test -tags debug ./... passed offline with mock host clients.
  • go vet ./... passed.
  • The macOS ARM64 C-shared library built with -tags debug -buildmode=c-shared.

No live API calls or local service deployment were part of this verification.

@massiveits massiveits self-assigned this Oct 2, 2026
@massiveits

Copy link
Copy Markdown
Owner

Thanks @darfink. This looks great and I definitely want to merge it.

I'm holding off on merging right now because we need to give users more time to upgrade to v8 before cutting a breaking release, and I'm still on CLIProxyAPI v7 myself.

I'll keep this PR open and merge it once the v8 transition window makes sense.

@darfink

darfink commented Oct 7, 2026

Copy link
Copy Markdown
Author

I pushed another update:

  • Updated against the latest main and cleaned up the commit history.
  • Explicit model reasoning efforts.

OpenCode Go’s catalog omits reasoning-effort metadata. The plugin now advertises verified options per model and route, with conservative defaults for other models. Model discovery remains dynamic, and metadata supplied by OpenCode Go takes priority.

Also fixed Muse Spark’s Codex tool compatibility using CLIProxyAPI’s SDK tool mapping and removed the unsupported search_content_types field. Requested reasoning controls, media, and usage remain intact. Incompatible historical reasoning and compaction items are dropped for Muse Spark and Grok to prevent replay errors.

@massiveits

Copy link
Copy Markdown
Owner

Every PR should focus on one thing, now the PR has fixes and features together, Please read CONTRIBUTING.md

Migrate the SDK imports to v8 and replace the separate quota page with the generic quota provider API.

Preserve credential identity and custom labels, support optional account names, and prevent duplicate records at cold start.

Keep model reasoning metadata and protocol compatibility changes outside this commit. Verify local builds and tests with the debug tag.
@darfink
darfink force-pushed the feat/native-plugin-quota branch from 441a14e to e908905 Compare October 8, 2026 09:25
@darfink

darfink commented Oct 8, 2026

Copy link
Copy Markdown
Author

I've omitted the fixes for the Muse protocol & the adjusted reasoning efforts for available models - it now only contains the original v8/native-quota integration. However, feel free to merge #12 instead if deemed more fitting.

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.

2 participants