You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/08/20 12:10:08 UTC
(maka) 03/03: test(core): assert the OpenCode Free offering stays anonymously reachable
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch chore/models-dev-refresh-catalog-snapshot
in repository https://gitbox.apache.org/repos/asf/maka.git
commit 4fdd60113758e5ef106e7cdf12372d9d1a02a831
Author: AstroHan <le...@outlook.com>
AuthorDate: Thu Aug 20 20:09:43 2026 +0800
test(core): assert the OpenCode Free offering stays anonymously reachable
The free set now follows the models.dev snapshot, so what can break it is an
upstream change rather than an edit to a list someone reads while changing it.
Pin the properties that make the offering safe to hand an anonymous user: every
offered id is published at a zero rate, is tool-capable, is not deprecated, and
every default-enabled id is still offered.
Verified by re-pinning a deprecated id into the offering, which fails on
"north-mini-code-free must not be deprecated upstream".
Generated-by: Claude Code
---
.../__tests__/provider-catalog-contract.test.ts | 32 +++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/packages/core/src/__tests__/provider-catalog-contract.test.ts b/packages/core/src/__tests__/provider-catalog-contract.test.ts
index 38b6dd35e..ac4f0cf32 100644
--- a/packages/core/src/__tests__/provider-catalog-contract.test.ts
+++ b/packages/core/src/__tests__/provider-catalog-contract.test.ts
@@ -5,7 +5,15 @@ import {
validateConnectionBaseUrl,
validateSlug,
} from '../llm-connections.js';
-import { CATALOG_PROVIDER_TYPES, PROVIDER_REGISTRY } from '../provider-registry.js';
+import {
+ GENERATED_MODELS_DEV_METADATA,
+ GENERATED_MODELS_DEV_ZERO_COST_MODEL_IDS,
+} from '../model-metadata.generated.js';
+import {
+ CATALOG_PROVIDER_TYPES,
+ OPENCODE_FREE_DEFAULT_ENABLED_MODELS,
+ PROVIDER_REGISTRY,
+} from '../provider-registry.js';
describe('provider connection slug derivation contract', () => {
it('continues through dense collisions until it finds an unused slug', () => {
@@ -51,4 +59,26 @@ describe('provider catalog contract — structural invariants over CATALOG_PROVI
);
}
});
+
+ // opencode-free is anonymous: a user reaches these models without an account
+ // or a payment method, so anything offered here must actually be free to
+ // call, and the ids Maka enables by default must stay reachable. The set is
+ // derived from the snapshot, so upstream is what can break this, not an edit.
+ it('offers OpenCode Free only zero-rate, active, tool-capable models, including every default-enabled id', () => {
+ const offered = PROVIDER_REGISTRY['opencode-free'].fallbackModels;
+
+ assert.ok(offered.length > 0, 'opencode-free must offer at least one model');
+ for (const id of offered) {
+ assert.ok(
+ GENERATED_MODELS_DEV_ZERO_COST_MODEL_IDS.opencode.includes(id),
+ `${id} is offered anonymously but the opencode snapshot publishes a rate for it`,
+ );
+ const model = GENERATED_MODELS_DEV_METADATA.opencode[id];
+ assert.equal(model?.capabilities?.functionCalling, true, `${id} must be tool-capable`);
+ assert.notEqual(model?.lifecycle, 'deprecated', `${id} must not be deprecated upstream`);
+ }
+ for (const id of OPENCODE_FREE_DEFAULT_ENABLED_MODELS) {
+ assert.ok(offered.includes(id), `default-enabled ${id} must still be offered`);
+ }
+ });
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org