bizrouter 0.1.0 → 0.1.1

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.
@@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
2
2
  import { ENV_KEY_NAME } from '../config.js';
3
3
  import { c, info, print } from '../ui.js';
4
4
  import { requireApiKey } from './shared.js';
5
- export const VERSION = '0.1.0';
5
+ export const VERSION = '0.1.1';
6
6
  /** `eval "$(bizrouter env)"` exports the saved key for tools configured by `bizrouter setup`. */
7
7
  export function envCommand() {
8
8
  const key = requireApiKey();
@@ -1,3 +1,15 @@
1
+ /** Hermes sends this max_tokens to custom OpenAI-compatible endpoints regardless of the model. */
2
+ export const HERMES_FIXED_MAX_TOKENS = 65536;
3
+ /**
4
+ * Models whose output cap is below Hermes' fixed max_tokens get rejected by the
5
+ * gateway (`max_tokens: 65536 > 64000 …`) and Hermes misreads that as a context
6
+ * overflow, so warn before launching.
7
+ */
8
+ export function hermesOutputCapWarning(model, maxOutputTokens) {
9
+ if (maxOutputTokens === undefined || maxOutputTokens >= HERMES_FIXED_MAX_TOKENS)
10
+ return undefined;
11
+ return `Hermes 는 max_tokens ${HERMES_FIXED_MAX_TOKENS.toLocaleString('en-US')} 을 고정으로 보내는데 ${model} 의 출력 한도는 ${maxOutputTokens.toLocaleString('en-US')} 입니다. 요청이 400 으로 거절되고 Hermes 가 이를 컨텍스트 초과로 오해합니다. 출력 한도가 65,536 이상인 모델(예: anthropic/claude-sonnet-5)을 쓰세요.`;
12
+ }
1
13
  const HERMES_SUBCOMMANDS = new Set(['chat']);
2
14
  /**
3
15
  * Hermes reaches any OpenAI-compatible endpoint through its `custom` provider,
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { buildClaudePlan } from './harness/claude.js';
13
13
  import { buildCodexPlan, codexConfigPinsServiceTier } from './harness/codex.js';
14
14
  import { codexConfigPath } from './commands/setup.js';
15
15
  import { existsSync, readFileSync } from 'node:fs';
16
- import { buildHermesPlan } from './harness/hermes.js';
16
+ import { buildHermesPlan, hermesOutputCapWarning } from './harness/hermes.js';
17
17
  import { buildOpencodePlan } from './harness/opencode.js';
18
18
  import { runPlan } from './spawn.js';
19
19
  import { CliError, fail, info, maskKey, print, warn } from './ui.js';
@@ -93,6 +93,12 @@ async function launch(harness, argv) {
93
93
  plan = buildHermesPlan({ apiKey, apiBase: base, model: model ?? FALLBACK_DEFAULT.hermes, passthrough: args.passthrough });
94
94
  if (args.reasoningEffort)
95
95
  warn('Hermes 는 추론 강도 옵션을 받지 않습니다.');
96
+ {
97
+ const hermesModel = model ?? FALLBACK_DEFAULT.hermes;
98
+ const capWarning = hermesOutputCapWarning(hermesModel, models.find((m) => m.id === hermesModel)?.max_output_tokens);
99
+ if (capWarning)
100
+ warn(capWarning);
101
+ }
96
102
  break;
97
103
  }
98
104
  if (!args.dryRun)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizrouter",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "BizRouter CLI - run Claude Code, Codex, OpenCode, and Hermes through BizRouter with one command",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",