Skip to content

Commit 651367d

Browse files
committed
feat: match CLI 1.32.1 wire defaults and forward reasoning_effort
1 parent ef7e64d commit 651367d

12 files changed

Lines changed: 45 additions & 13 deletions

README.ko.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</p>
99

1010
<p align="center">
11-
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.a-b57920?style=flat-square" alt="Version 1.32.1.a"></a>
11+
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.b-b57920?style=flat-square" alt="Version 1.32.1.b"></a>
1212
<a href="src/model-catalog.ts"><img src="https://img.shields.io/badge/models-58-1f6f78?style=flat-square" alt="58 models"></a>
1313
<a href="package.json"><img src="https://img.shields.io/badge/Node.js-20%2B-9f4d2e?style=flat-square" alt="Node.js 20+"></a>
1414
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-28231f?style=flat-square" alt="MIT License"></a>
@@ -20,7 +20,7 @@
2020

2121
<!-- README-I18N:END -->
2222

23-
CommandCode Bridge는 CommandCode 계정을 위한 신뢰 환경용 HTTP 게이트웨이입니다. 표준 OpenAI-compatible 모델·채팅 endpoint를 제공하고 eligible upstream credential 사이에서 요청을 라우팅하며, CommandCode **1.32.1**에 맞춘 정확한 **58-model** catalog를 게시합니다. Bridge 버전은 항상 현재 CommandCode CLI 버전을 따라가며 그 뒤에 문자 접미사를 붙입니다(예: **1.32.1.a**). 접미사는 bridge 전용 release를 뜻합니다.
23+
CommandCode Bridge는 CommandCode 계정을 위한 신뢰 환경용 HTTP 게이트웨이입니다. 표준 OpenAI-compatible 모델·채팅 endpoint를 제공하고 eligible upstream credential 사이에서 요청을 라우팅하며, CommandCode **1.32.1**에 맞춘 정확한 **58-model** catalog를 게시합니다. Bridge 버전은 항상 현재 CommandCode CLI 버전을 따라가며 그 뒤에 문자 접미사를 붙입니다(예: **1.32.1.b**). 접미사는 bridge 전용 release를 뜻합니다.
2424

2525
[기능](#기능) · [설치](#설치) · [사용법](#사용법) · [동작 방식](#동작-방식) · [저장소 구성](#저장소-구성) · [현재 제한](#현재-제한) · [라이선스](#라이선스)
2626

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</p>
99

1010
<p align="center">
11-
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.a-b57920?style=flat-square" alt="Version 1.32.1.a"></a>
11+
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.b-b57920?style=flat-square" alt="Version 1.32.1.b"></a>
1212
<a href="src/model-catalog.ts"><img src="https://img.shields.io/badge/models-58-1f6f78?style=flat-square" alt="58 models"></a>
1313
<a href="package.json"><img src="https://img.shields.io/badge/Node.js-20%2B-9f4d2e?style=flat-square" alt="Node.js 20+"></a>
1414
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-28231f?style=flat-square" alt="MIT License"></a>
@@ -20,7 +20,7 @@
2020

2121
<!-- README-I18N:END -->
2222

23-
CommandCode Bridge is a trusted-environment HTTP gateway for a CommandCode account. It presents standard OpenAI-compatible model and chat endpoints, routes work across eligible upstream credentials, and publishes an exact **58-model** catalog aligned with CommandCode **1.32.1**. The bridge version always tracks the current CommandCode CLI version with a letter suffix (for example **1.32.1.a**); the suffix marks bridge-only releases.
23+
CommandCode Bridge is a trusted-environment HTTP gateway for a CommandCode account. It presents standard OpenAI-compatible model and chat endpoints, routes work across eligible upstream credentials, and publishes an exact **58-model** catalog aligned with CommandCode **1.32.1**. The bridge version always tracks the current CommandCode CLI version with a letter suffix (for example **1.32.1.b**); the suffix marks bridge-only releases.
2424

2525
[What it does](#what-it-does) · [Install](#install) · [Usage](#usage) · [How it works](#how-it-works) · [Repository layout](#repository-layout) · [Current limitations](#current-limitations) · [License](#license)
2626

README.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</p>
99

1010
<p align="center">
11-
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.a-b57920?style=flat-square" alt="Version 1.32.1.a"></a>
11+
<a href="package.json"><img src="https://img.shields.io/badge/version-1.32.1.b-b57920?style=flat-square" alt="Version 1.32.1.b"></a>
1212
<a href="src/model-catalog.ts"><img src="https://img.shields.io/badge/models-58-1f6f78?style=flat-square" alt="58 models"></a>
1313
<a href="package.json"><img src="https://img.shields.io/badge/Node.js-20%2B-9f4d2e?style=flat-square" alt="Node.js 20+"></a>
1414
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-28231f?style=flat-square" alt="MIT License"></a>
@@ -20,7 +20,7 @@
2020

2121
<!-- README-I18N:END -->
2222

23-
CommandCode Bridge 是面向 CommandCode 账号的可信环境 HTTP 网关。它提供标准 OpenAI-compatible 模型与聊天端点,在符合条件的上游凭据之间路由请求,并发布与 CommandCode **1.32.1** 对齐的准确 **58-model** catalog。Bridge 版本始终跟随当前 CommandCode CLI 版本并在其后附加字母后缀(例如 **1.32.1.a**);后缀表示仅限 Bridge 的发布。
23+
CommandCode Bridge 是面向 CommandCode 账号的可信环境 HTTP 网关。它提供标准 OpenAI-compatible 模型与聊天端点,在符合条件的上游凭据之间路由请求,并发布与 CommandCode **1.32.1** 对齐的准确 **58-model** catalog。Bridge 版本始终跟随当前 CommandCode CLI 版本并在其后附加字母后缀(例如 **1.32.1.b**);后缀表示仅限 Bridge 的发布。
2424

2525
[功能](#功能) · [安装](#安装) · [用法](#用法) · [工作原理](#工作原理) · [仓库布局](#仓库布局) · [当前限制](#当前限制) · [许可证](#许可证)
2626

docs/PROCESS_LOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,21 @@
106106
- Tool-call events whose name arrives as multiplexed XML-ish frames (observed on `stealth/ox-alpha`) are split into separate OpenAI `tool_calls` with deterministic ids, with a `commandcode_multiplexed_tool_call` warn log.
107107
- Live QA against `stealth/ox-alpha` verified: streaming tool calls, forced single tools, parallel tool calls, three-result tool history follow-ups, and abort-then-burst recovery.
108108

109+
## 2026-08-21
110+
111+
- Merged PR `ef7e64d` (author 이재현, branch `pr-2-rebased`): `fix(openai): forward CommandCode cache usage` — OpenAI usage objects now carry `prompt_tokens_details.cached_tokens` from upstream `cachedInputTokens`/`inputTokenDetails.cacheReadTokens`, in both non-stream and stream usage chunks. Merged into local `main` via fast-forward; combined tree passes all gates.
112+
- Released bridge version `1.32.1.b`.
113+
- CLI 1.32.1 bundle drift audit (one-shot field-level diff of `/alpha/generate`): the bridge now defaults `max_tokens` to the CLI wire value `64000` when the client omits it, forwards OpenAI `reasoning_effort` into Alpha params, drops the vestigial `x-co-flag` header the CLI no longer sends, and sends `x-cmd-zdr: 1` when `COMMANDCODE_ZDR` is on (matching the CLI's `buildCommandAuthHeaders`). Verified parity: body envelope (`config`/`memory`/`taste`/`skills`/`permissionMode`/`threadId`), `toWireMessages`/`toWireTools` shapes, and the remaining header set.
114+
109115
## Current status — 2026-08-21
110116

111117
- Branch: `main`, synchronized with `origin/main` when this status audit began.
112-
- Package: `commandcode-bridge` `1.32.1.a`, Node.js `>=20`, with `commandcode-bridge` and `commandcode-router` executables.
118+
- Package: `commandcode-bridge` `1.32.1.b`, Node.js `>=20`, with `commandcode-bridge` and `commandcode-router` executables.
113119
- API surface: authenticated OpenAI-compatible `/v1/models` and `/v1/chat/completions`, health endpoint, and same-origin dashboard configuration.
114120
- Model surface: 58 statically aligned models with live Provider API refresh when available.
115121
- Routing surface: `daily_burn_priority`, `balance_priority`, `round_robin`, and `drain_first`, with per-key model scope, concurrency, cooldown, failover, and retry controls.
116122
- Deployment surface: Docker/Compose, Linux install/uninstall scripts, nginx and systemd release assets, and GitHub/GitLab CI definitions.
117-
- Verification: `npm run typecheck`, `npm run lint`, all 215 Vitest tests in 15 files, and `npm run build` pass on this workstation.
123+
- Verification: `npm run typecheck`, `npm run lint`, all 216 Vitest tests in 15 files, and `npm run build` pass on this workstation.
118124
- Known local exception: `npm run format:check` fails only because the untracked workspace instruction file `AGENTS.md` is not Prettier-formatted. It is not part of the tracked product tree and was left untouched.
119125
- Live upstream smoke was not repeated because it requires a running bridge and an upstream CommandCode account; the last recorded live bridge/tool-loop smoke remains the 2026-05-16 entry.
120126
- Session recovery note: the current Senpi transcript exists at the path in `PI_SESSION_FILE`. Cross-platform local session search found no recoverable project implementation transcript covering the missing period, so the entries above were reconstructed from Git history and verified against the current source and test suite.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commandcode-bridge",
3-
"version": "1.32.1.a",
3+
"version": "1.32.1.b",
44
"description": "OpenAI-compatible HTTP bridge for CommandCode's DeepSeek V4 Pro API path.",
55
"type": "module",
66
"license": "MIT",

src/commandcode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ export class CommandCodeClient implements CommandCodeUpstream {
514514
"x-command-code-version": this.config.cliVersion,
515515
"x-project-slug": slugFromWorkingDir(body.config.workingDir),
516516
"x-taste-learning": "false",
517-
"x-co-flag": "false",
517+
...(this.config.zdr ? { "x-cmd-zdr": "1" } : {}),
518518
...(body.threadId ? { "x-session-id": body.threadId } : {}),
519519
},
520520
body: JSON.stringify(body),

src/converter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ export function buildCommandCodeGenerateBody(
189189
messages: convertMessages(options.request.messages),
190190
tools: convertOpenAITools(options.request.tools, options.request.tool_choice),
191191
system: buildSystemPrompt(options.request),
192+
max_tokens: options.request.max_tokens ?? 64_000,
192193
stream: true,
193194
};
194-
if (options.request.max_tokens !== undefined) params.max_tokens = options.request.max_tokens;
195+
if (options.request.reasoning_effort !== undefined)
196+
params.reasoning_effort = options.request.reasoning_effort;
195197
if (options.request.temperature !== undefined) params.temperature = options.request.temperature;
196198
if (options.request.top_p !== undefined) params.top_p = options.request.top_p;
197199
if (options.request.stop !== undefined) params.stop = options.request.stop;

src/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const chatCompletionRequestSchema = z.object({
8787
messages: z.array(messageSchema).min(1),
8888
stream: z.boolean().optional(),
8989
max_tokens: z.number().int().positive().optional(),
90+
reasoning_effort: z.enum(["minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
9091
temperature: z.number().min(0).max(2).optional(),
9192
top_p: z.number().min(0).max(1).optional(),
9293
stop: z.union([z.string(), z.array(z.string())]).optional(),

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface OpenAIChatCompletionRequest {
4949
messages: OpenAIChatMessage[];
5050
stream?: boolean;
5151
max_tokens?: number;
52+
reasoning_effort?: string;
5253
temperature?: number;
5354
top_p?: number;
5455
stop?: string | string[];
@@ -116,6 +117,7 @@ export interface CommandCodeGenerateBody {
116117
tools: CommandCodeTool[];
117118
system: string;
118119
max_tokens?: number;
120+
reasoning_effort?: string;
119121
temperature?: number;
120122
top_p?: number;
121123
stop?: string | string[];

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const BRIDGE_VERSION = "1.32.1.a";
1+
export const BRIDGE_VERSION = "1.32.1.b";

0 commit comments

Comments
 (0)