Skip to content

Connection billing, subscription routing, and usage (0.4.0) - #17

Open
BitL8-ByteShort wants to merge 15 commits into
mainfrom
codex/connection-billing-usage
Open

Connection billing, subscription routing, and usage (0.4.0)#17
BitL8-ByteShort wants to merge 15 commits into
mainfrom
codex/connection-billing-usage

Conversation

@BitL8-ByteShort

@BitL8-ByteShort BitL8-ByteShort commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Connecting a subscription-backed model could show “Available” alongside “Unknown — Blocked” because public API pricing was being used as the access gate. Empty SDK-default endpoints and provider-owned authentication transports also caused identity conflicts.

This 0.4.0 change separates configured connection access, billing evidence, public prices, and recorded usage:

  • Configured Paid policy permits eligible loaded connections when public estimates are unavailable. Free policy still requires verified zero-price evidence. Existing Paid users retain legacy verified-price behavior until explicitly adopting configured Paid access.
  • Empty SDK-default URLs are treated as unspecified; custom endpoints cannot inherit another route's prices. Provider-owned authentication fetch is supported without a subscription-to-API fallback. Revoked, missing, or changed explicit bindings stop dispatch.
  • The panel exposes connection billing declarations and provenance, exact role bindings, quota when reported, and historical captured usage grouped by billing kind, binding, and currency. Missing values remain unreported. Refresh and conflicts preserve drafts.
  • Planner and MCP reload connection evidence. New explicit pins, binding edits, and billing declarations require current connection revisions. Historical assistant usage is immutable, queued work and retention are bounded, and host disposal flushes pending accounting with a deadline.
  • Settings schema 4 and managed surface 3 preserve disabled models and requested pins. Plugin upgrades retain the explicit Connect/update and restart boundary. Exact public 0.3.0 Free/Paid migration checks cover private backups and guarded update/recovery; 0.2.1 coverage remains.

Validation for head 33403f4: complete CI run.

  • Full verification passes on Node 22.12.0 and 24.x; 343 tests pass with no skips. Type checking, production build, npm audit, browser tests and CodeQL pass.
  • All four exact-package combinations pass: Linux/macOS × Node 22.12.0/24.x. Each runs OpenCode 1.18.22 and 1.18.28 with 20 scenarios and 57 synthetic loopback requests per host, plus 14 browser scenarios against installed production assets with no failures, skips or flakes.
  • Every combination verifies actual 0.3.0 Free/Paid and 0.2.1 upgrades, private exact backups, guarded update/restart, MCP, token rotation, disconnect and recovery. The 0.2.1 fixture accounts for its own historical normalization and explicitly checks the disabled choice before migration; 0.3.0 additionally preserves absent disabled identities and pins.
  • Damaged plugin/UI artifact checks pass. Public metadata retrieval passes separately with zero inference calls; no real-provider inference was used in acceptance.
  • Independent Astra high review findings were fixed and rechecked. New explicit pins cannot bypass the connection revision/binding fence, and usage failure counters use the backend contract.

One candidate was distributed to every CI acceptance job. Downloaded evidence confirms the same SHA-256 throughout:
668d3b8ab17c35abdaf3e3069e8dba0b177c381257b01408262a0049707c565f.
The locally built candidate matches those bytes. This is candidate acceptance evidence, not a final protected-main release artifact.

Limits: synthetic loopback credentials and transports do not prove any real account's entitlement. Opaque host transports are host-managed; quota and unreported token semantics are not invented. Captured history is partial and is not added to aggregate host costs. No merge or publication has occurred; protected-main review, final-artifact acceptance and public release verification remain separate gates.

Raw '', absent, and null provider URLs are unspecified SDK defaults
instead of invalid identity. Public rates still require an exact
provider/model/endpoint match, so a missing public URL cannot certify
a custom gateway and CLI cost cannot override a route mismatch.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Persist nonsecret connection identities per configured host slot.
Existing Paid settings migrate to verified-pricing so unpriced
routes are not newly authorized without an explicit adoption.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Unknown public prices no longer block a configured paid route after
the user adopts configured-connections. Free and migrated verified-
pricing Paid keep the previous verified-price gate.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
OpenCode subscription auth loaders attach an opaque fetch. Allow it
on provider options when Paid policy is active and the exact model
binding matches. Task and model route overrides stay rejected.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Report tokens separately from OpenCode-recorded cost, keep missing
values null, and store private HMAC attribution. The panel splits
connection, access, and pricing, and existing Paid users must adopt
configured-connection access. Bump package 0.4.0 and managed surface 3.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Repair keeps the original connection ID/revision and stops before a
provider call if billing binding changes. Browser and package
acceptance now expect settings schema 4 and managed surface 3.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
…etch

Observe connections during catalog refresh, block revoked or missing
pinned connections at eligibility and dispatch, complete HMAC usage
records after successful owned replies, and add a host scenario that
attaches an auth-loader-shaped fetch on Paid routes.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Live observation no longer clears reported-revoked. Host acceptance
requires the auth-loader fetch wrapper to handle the provider request.
Attribution waits for completion instead of a timer, and packaged
acceptance expects 20 host scenarios.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Host acceptance now stores synthetic omctest OAuth and requires the
plugin auth-loader fetch to stamp every provider request. Routing
completion updates workflow state before queued attribution writes.

Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
Signed-off-by: Chris <51251284+BitL8-ByteShort@users.noreply.github.com>
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