scalemax 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -153,11 +153,11 @@ ScaleMax configures the official Codex custom-provider interface in `~/.codex/co
153
153
 
154
154
  ### Claude Code
155
155
 
156
- ScaleMax updates `~/.claude/settings.json` with `ANTHROPIC_BASE_URL=https://api.scalemax.pro`, gateway model discovery, and a cached `apiKeyHelper` that reads a private `~/.claude/scalemax.key` file. The raw key is not stored in the settings JSON. Because Claude Code's gateway discovery only accepts IDs beginning with `claude` or `anthropic`, a catalog that includes Fable also receives a managed `ANTHROPIC_CUSTOM_MODEL_OPTION=fable-5` entry (with a friendly name and description), making `/model fable-5` selectable; any prior custom picker values are restored when ScaleMax configuration is removed. The Anthropic base URL intentionally has no `/v1` suffix because Claude Code adds `/v1/messages` itself. The CLI preserves unrelated settings, selects a live main model from the authenticated catalog (preferring `claude-opus-5`), pins authenticated Haiku for lightweight background work when available, and sets `CLAUDE_CODE_DISABLE_THINKING=1` because third-party Anthropic-compatible providers do not support Claude Code's proprietary extended-thinking control envelope. The ScaleMax gateway separately locks supported Claude-family requests to provider-side `low` effort, including Fable's translated route; clients cannot raise that setting. Haiku 4.5 omits the unsupported effort field. It verifies a one-token Messages request and, if verification fails, removes only the ScaleMax-managed changes. Claude Code picker aliases such as `claude-opus-5[1m]` are normalized by the gateway.
156
+ ScaleMax updates `~/.claude/settings.json` with `ANTHROPIC_BASE_URL=https://api.scalemax.pro`, gateway model discovery, and a cached `apiKeyHelper` that reads a private `~/.claude/scalemax.key` file. The raw key is not stored in the settings JSON. Because Claude Code's gateway discovery only accepts IDs beginning with `claude` or `anthropic`, a catalog that includes Fable also receives a managed `ANTHROPIC_CUSTOM_MODEL_OPTION=fable-5` entry (with a friendly name and description), making `/model fable-5` selectable; any prior custom picker values are restored when ScaleMax configuration is removed. The Anthropic base URL intentionally has no `/v1` suffix because Claude Code adds `/v1/messages` itself. The CLI preserves unrelated settings, selects a live main model from the authenticated catalog (preferring `claude-opus-5`), pins authenticated Haiku for lightweight background work when available, and sets `CLAUDE_CODE_DISABLE_THINKING=1` because third-party Anthropic-compatible providers do not support Claude Code's proprietary extended-thinking control envelope. The ScaleMax gateway separately locks native Claude requests to provider-side `low` effort. Fable uses its verified translated controls and supports `low`, `medium`, `high`, and `max`, with `low` as the default. Haiku 4.5 omits the unsupported effort field. It verifies a one-token Messages request and, if verification fails, removes only the ScaleMax-managed changes. Claude Code picker aliases such as `claude-opus-5[1m]` are normalized by the gateway.
157
157
 
158
158
  ### OpenCode
159
159
 
160
- ScaleMax merges a named `scalemax` provider into `~/.config/opencode/opencode.json` (or the platform-equivalent config directory). It uses `https://api.scalemax.pro/v1`, reads its credential from the private `~/.config/opencode/scalemax.key` file through OpenCode's `{file:...}` substitution, keeps unrelated providers and the user's non-ScaleMax default model, and exposes only authenticated Codex/OpenAI-family models. A fresh ScaleMax setup uses an authenticated GPT mini model as `small_model` when available. Each generated model has an explicit output limit of at most 4096 tokens so OpenCode does not send an unsupported default limit.
160
+ ScaleMax merges a named `scalemax` provider into `~/.config/opencode/opencode.json` (or the platform-equivalent config directory). It uses `https://api.scalemax.pro/v1`, reads its credential from the private `~/.config/opencode/scalemax.key` file through OpenCode's `{file:...}` substitution, keeps unrelated providers and the user's non-ScaleMax default model, and exposes only authenticated Codex/OpenAI-family models. A fresh ScaleMax setup uses an authenticated GPT mini model as `small_model` when available. Each generated model has an explicit output limit of at most 4096 tokens so OpenCode does not send an unsupported default limit. Its `tool_call` flag is taken from the authenticated ScaleMax model catalog; run `scalemax update` after a catalog or client update so agent tools stay aligned with the current route.
161
161
 
162
162
  ### OpenClaw
163
163
 
@@ -33,7 +33,7 @@ export const HELPER_DOC_SECTIONS = [
33
33
  id: 'codex-and-clients',
34
34
  title: 'Supported client update flow',
35
35
  keywords: ['codex', 'cursor', 'claude code', 'opencode', 'openclaw', 'hermes', 'cherry studio', 'update', 'doctor'],
36
- content: `scalemax update detects supported clients and configures them from the stored key. scalemax doctor validates the stored key and performs a minimal ScaleMax request. Supported clients include Codex CLI, Cursor, Claude Code, OpenCode, OpenClaw, Hermes, Cherry Studio, Roo Code, and API Code. Recognized helper-bot setup and verification requests are executed by the CLI controller before any model fallback is used.`
36
+ content: `scalemax update detects supported clients and configures them from the stored key. scalemax doctor validates the stored key and performs a minimal ScaleMax request. Supported clients include Codex CLI, Cursor, Roo Code, Continue, TRAE SOLO, Claude Code, OpenCode, OpenClaw, Hermes, Cherry Studio, n8n, and API Code. The CLI obtains models from the authenticated matching /models endpoint rather than a hard-coded list. Recognized helper-bot setup and verification requests are executed by the CLI controller before any model fallback is used.`
37
37
  },
38
38
  {
39
39
  id: 'claude-github-tools',
@@ -3,7 +3,7 @@ import fs from 'fs-extra';
3
3
  import { atomicWrite, backupFile } from '../utils/fs.js';
4
4
  import { clientConfigPath } from './paths.js';
5
5
  import { writeMergedJsonConfig } from './common.js';
6
- import { fastChatCompletionsModel, modelIds, modelName, openAiBaseUrl, preferredChatCompletionsModel } from './models.js';
6
+ import { fastChatCompletionsModel, modelIds, modelName, modelSupportsTools, openAiBaseUrl, preferredChatCompletionsModel } from './models.js';
7
7
  import { removeClientSecret, rollbackClientSecret, verifyClientSecret, writeClientSecret } from './client-secret.js';
8
8
  const id = 'opencode';
9
9
  const name = 'OpenCode';
@@ -17,6 +17,11 @@ function providerConfig(ctx) {
17
17
  const metadata = (ctx.models || []).find(model => model.id === modelId);
18
18
  return [modelId, {
19
19
  name: modelName(ctx, modelId),
20
+ // OpenCode can otherwise infer an unknown model as text-only in some
21
+ // releases. Trust the authenticated ScaleMax catalog rather than a
22
+ // hard-coded model list: this keeps tool agents enabled for verified
23
+ // GPT/Claude routes and leaves an unverified route conservatively off.
24
+ tool_call: modelSupportsTools(ctx, modelId),
20
25
  limit: {
21
26
  context: metadata?.context_window || (modelId.startsWith('claude-') ? 200000 : 128000),
22
27
  output: modelId === 'claude-opus-5'
@@ -73,6 +78,10 @@ export async function verify(ctx) {
73
78
  const unexpected = configured.filter(model => !expected.includes(model));
74
79
  if (missing.length || unexpected.length)
75
80
  throw new Error(`OpenCode model catalog is not restricted to the ${expected.length} authenticated chat model(s).`);
81
+ const capabilityMismatch = expected.some(modelId => (asRecord(provider.models)[modelId]?.tool_call !== modelSupportsTools(ctx, modelId)));
82
+ if (capabilityMismatch) {
83
+ throw new Error('OpenCode tool-call capabilities are stale. Run `scalemax update` to refresh the authenticated model catalog.');
84
+ }
76
85
  return { id, name, changed: false, path: file, message: `verified ${configured.length} ScaleMax models` };
77
86
  }
78
87
  export async function remove(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scalemax",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Universal ScaleMax installer for AI coding clients",
5
5
  "type": "module",
6
6
  "bin": {