Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d4a5218
docs(devlog): Grok Build 3.32.24 / CLI 2.0.6 integration and quota ro…
lidge-jun Dec 1, 2026
16a4c46
test(quota): keep Mistral and Kimi budget fixtures valid across reset…
luvs01 Dec 3, 2026
84015d6
docs: show how to use a failover combo for shadow calls (#9234)
ShianMike Dec 3, 2026
086cd54
test(advisor): release consultation after observing two heartbeats (#…
luvs01 Dec 3, 2026
385389b
test(providers): bound and reap the nested Mihomo fixture (#9286)
luvs01 Dec 3, 2026
5a19c9a
test(routing): isolate lifecycle locks in Home route subprocesses (#9…
luvs01 Dec 3, 2026
3deffcc
fix(responses): keep hosted shell history in translated requests (#9257)
lcxhh521 Dec 3, 2026
73bca7d
fix(integrations): support new Antigravity gateway config path (#9219)
ParsifalC Dec 3, 2026
2cc4037
fix(windows): report Korean Task Scheduler access denial on fresh ins…
luvs01 Dec 3, 2026
f56ea22
fix(responses): keep a replayed web_search_call id when store is fals…
LilMGenius Dec 3, 2026
efeef7b
fix(responses): lower shell_call_output media parts to assistant text…
lidge-jun Dec 3, 2026
b2fdc46
test(storage): finish server teardown before switching fixture homes …
luvs01 Dec 3, 2026
76c49e6
Preserve retained Gemini turns on failed writes and across branches (…
luvs01 Dec 3, 2026
b0619be
Account for retained text in the Grok stream translator budget (#9268)
luvs01 Dec 3, 2026
7379923
Explain unverified Codex journal baselines in ocx doctor (#9264)
luvs01 Dec 3, 2026
6cf8cea
fix(build): embed standalone workers without rewriting the checkout (…
luvs01 Dec 3, 2026
18728da
fix(history): refuse legacy relabels when rollout evidence is incompl…
luvs01 Dec 3, 2026
72ab420
fix(update): show verified Windows stop refusals in dashboard jobs (#…
luvs01 Dec 3, 2026
1126bdc
fix(cli): refuse stale combo edits and renames (#9254)
ShianMike Dec 3, 2026
3187ecf
fix(codex-cli-update): recognize the Windows standalone Codex install…
atinseau Dec 3, 2026
fb34a24
fix(gui,cli): strip every /api/config decoration before a provider ed…
atinseau Dec 3, 2026
cc05e1d
fix(anthropic): record upstream served model in request logs (#9229)
inforanger Dec 3, 2026
e8846de
docs(es): restore Spanish localization parity on dev (#9322)
lidge-jun Dec 3, 2026
0f2b101
fix(subagents): resolve bare combo aliases in entryParts and subagent…
lidge-jun Dec 3, 2026
18d27c1
fix(responses): synthesize a result for a dangling shell call (carry …
lidge-jun Dec 3, 2026
e87efd4
feat(gui,docs): surface Antigravity gateway clients in Route (#9210)
scy7796 Dec 3, 2026
f7e92b2
fix(openai-chat): read Responses-style usage aliases from Chat gatewa…
lidge-jun Dec 3, 2026
1113cad
fix(opencode): write the loopback placeholder apiKey from serving-con…
lidge-jun Dec 3, 2026
85b9c58
fix(link): prove macOS tunnel ownership from the kernel TCP table (#9…
lidge-jun Dec 3, 2026
b61a86e
fix(kiro): count bonus credits and retry a burst 429 on the same acco…
lidge-jun Dec 3, 2026
0895d78
fix: keep retrying an authoritative pre-output refusal however slow t…
lidge-jun Dec 3, 2026
e7ca2f0
fix(oauth): keep spent siblings out of account rotation (#9304) (#9313)
lidge-jun Dec 3, 2026
4452720
feat(desktop): keep Codex Desktop Send open while another provider ha…
atinseau Dec 3, 2026
b09f88c
feat(chatgpt): spendCredits lifts the credit-variant limit gates in t…
lidge-jun Dec 3, 2026
3c3ee29
feat(shadow-call): let helper calls follow the conversation provider …
lidge-jun Dec 3, 2026
a8ea077
Allow additional instructions for routed compaction summaries (#9205)
scy7796 Dec 3, 2026
b6fd05c
fix(windows): complete standard-user scheduler installs without VBScr…
luvs01 Dec 3, 2026
981765c
fix(deps): override cross-spawn and ws to resolve audit advisories (#…
lidge-jun Dec 3, 2026
e4d4c07
fix(start): stop refusing startup forever when a recorded PID is reus…
lidge-jun Dec 4, 2026
bbe473f
fix: release lock and pidfile owners only on positive evidence the ho…
lidge-jun Dec 4, 2026
8dc2dea
fix(service): pace a refused service start instead of restarting it e…
lidge-jun Dec 4, 2026
968f683
fix: name service locks, the mutation lease, the update marker and mo…
lidge-jun Dec 4, 2026
b4d30f5
fix(update): recognise a Debian package install and name its update c…
lidge-jun Dec 4, 2026
0d8cde2
docs: remove ocx.pid and runtime-port.json once for a record from 2.1…
lidge-jun Dec 4, 2026
0c15309
docs(es): translate the one-time record cleanup for a refused start (…
lidge-jun Dec 4, 2026
d2e20dc
fix: keep holders whose probe fails for an unknown reason; name crede…
lidge-jun Dec 4, 2026
b2d1761
fix(status): name a standing startup refusal in ocx status and ocx do…
lidge-jun Dec 4, 2026
acf40a2
test(update): register identity reads and the dpkg-query lookup in th…
lidge-jun Dec 4, 2026
49a0231
fix(service): retry a lock directory rename Windows refuses for a mom…
lidge-jun Dec 4, 2026
0dfc2a4
Merge stable OpenCodex v2.100.14
bcdonadio Dec 4, 2026
d7e9043
Keep update under merge guard limits
bcdonadio Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Connect the tool you already use:
| Claude Code | With the `claude` CLI installed, run `ocx claude`. It starts the proxy if needed and launches Claude Code through it. |
| Claude Desktop | Run `ocx claude desktop`. On a new install it sets up the gateway profile for the whole app; an existing first-party setup is kept, and `ocx claude desktop apply --gateway` switches explicitly. See the [Claude Code guide](https://opencodex.me/guides/claude-code/). Fully quit and reopen Claude Desktop after a switch. |
| Grok Build | On a local listener with Grok integration enabled, `ocx start` registers the models when `~/.grok` exists; pick an `ocx-*` model in Grok Build. Remote setups: see the [Grok Build guide](https://opencodex.me/guides/grok-build/). After adding providers, restart the proxy (or run `ocx ensure` when Codex autostart is enabled) to refresh the list. |
| Google Antigravity (desktop) | On the dashboard, open **Route → Antigravity** (also linked from **Route → Clients**), or run `ocx connect antigravity` on the machine where it is installed. |
| agy (CLI) | Use **Route → Antigravity** or run `ocx connect agy` on the machine where it is installed. Reload the indicated shell profile before running `agy`. |
| Tools with a managed integration | Use the dashboard **Route** page, or `ocx integration client enable --client <id>`. |
| Any other tool | Set a custom OpenAI-compatible base URL of `http://localhost:10100/v1`, or an Anthropic base URL of `http://localhost:10100`. |

Expand Down
11 changes: 8 additions & 3 deletions bin/ocx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import {
} from "../src/update/npm-cache-preflight.mjs";
import { handoffWindowsTrayForUpdate, planWindowsTrayUpdate } from "../src/update/tray-update-plan.mjs";
import { bootRestoreProbe, launcherUsableAfterNpmUpdate, transactionalNpmUpdate as transactionalNpmUpdateSync, transactionalNpmUpdateAsync } from "../src/update/transactional-install.mjs";
import { manualUpdateFailureGuidance, npmUpdateFailureGuidance } from "../src/update/update-failure-guidance.mjs";
import { dashboardStopMarker, manualUpdateFailureGuidance, npmUpdateFailureGuidance, takeDashboardStopToken } from "../src/update/update-failure-guidance.mjs";
import {
captureCodexCliTransportEnv,
CODEX_CLI_TRANSPORT_ENV_KEYS,
Expand All @@ -84,6 +84,7 @@ import {
} from "../src/update/supervised-recovery.mjs";

const PKG = "@bitkyc08/opencodex";
const dashboardStopToken = takeDashboardStopToken(process.argv, process.platform);
const UPDATE_RECOVERY_READY_MS = 30_000;
const UPDATE_RECOVERY_POLL_MS = 100;
const UPDATE_RECOVERY_SLEEP = new Int32Array(new SharedArrayBuffer(4));
Expand Down Expand Up @@ -933,8 +934,10 @@ async function runPackageManagerSelfUpdate(manager, child) {
stopAttempted = true;
console.log("⏹ Stopping the running proxy before updating...");
if (!homePolicy.authorizeMutation(serviceWasInstalled ? "service" : "runtime")) { releaseUpdateLease(); process.exit(1); }
const stopRes = guardedSpawnSync(homePolicy.authorizeMutation, serviceWasInstalled ? "service" : "runtime", process.execPath, [launcher, "stop"], {
stdio: "inherit", windowsHide: true, env: mutationChildEnvironment(),
const stopArgs = dashboardStopToken ? [launcher, "stop", "--json"] : [launcher, "stop"];
const stopRes = guardedSpawnSync(homePolicy.authorizeMutation, serviceWasInstalled ? "service" : "runtime", process.execPath, stopArgs, {
stdio: dashboardStopToken ? ["inherit", "pipe", "inherit"] : "inherit", encoding: "utf8",
windowsHide: true, env: mutationChildEnvironment(),
});
const stillHasRuntimeState =
existsSync(join(configDir(), "ocx.pid")) || existsSync(join(configDir(), "runtime-port.json"));
Expand Down Expand Up @@ -965,6 +968,8 @@ async function runPackageManagerSelfUpdate(manager, child) {
? `opencodex: could not confirm the proxy on ${bakeHostname}:${bakePort} is stopped; aborting the update. Run 'ocx stop' and retry.`
: "opencodex: could not stop the running proxy; aborting the update. Run 'ocx stop' and retry.");
releaseUpdateLease();
const marker = decision.reason === "stop-failed" && dashboardStopMarker(dashboardStopToken, stopRes);
if (marker) console.log("\n" + marker); // Node writes synchronously to the Windows dashboard's pipe.
process.exit(1);
}
if (historyOnlyStop || historyRestoreIncomplete()) {
Expand Down
3 changes: 2 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opencodex-desktop"
version = "2.100.12"
version = "2.100.14"
description = "OpenCodex desktop shell"
authors = ["OpenCodex contributors"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "OpenCodex",
"version": "2.100.12",
"version": "2.100.14",
"identifier": "com.opencodex.desktop",
"build": {
"frontendDist": "../ui",
Expand Down
74 changes: 74 additions & 0 deletions devlog/_plan/261201_grok_build_integration/000_plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Grok Build (`3.32.24` Desktop / `2.0.6` CLI) integration & quota routing notes

Date: 2026-12-01. Branch `docs/261201-grok-build-integration`, base `origin/dev` `740109d34e`.

## Context

Cursor's desktop application and CLI have converged into **Grok Build**:

- **Desktop app (`Grok Build.app` `3.32.24`):** In-place display rebrand over the existing Cursor desktop app identity, keeping existing local data directory compatibility while introducing `grok-build` CLI shims alongside `cursor`.
- **Unified CLI (`grok 2.0.6 [unified]`, public `1.0.97`):** Unified channel serving `grok`, `agent`, `cursor-agent`, and `cursor agent` through a shared unified agent-host runtime.
- **Open-source repository (`xai-org/grok-build`):** Public `main` remains at `1.0.45` (`2026-09-29`), while the shipped `2.0.x [unified]` CLI has moved to the unified agent-host architecture rather than the legacy standalone execution loop.

## Subscription & quota routing behavior

### 1. Account states and quota pools

| Account state | Quota / billing model | Notes |
|---|---|---|
| **Unmerged Cursor subscription** (`Pro`, `Pro+`, `Ultra`, `Express`, `Enterprise`) | Split buckets: **Cursor Models** (Auto, Cursor Grok, Composer) + **Other Models** (named third-party models) | Usage beyond Cursor Models limits spills over to Other Models quota or on-demand spend (`Express` is restricted to Cursor Models). |
| **Unified subscription** (`Plus`, `Premium`, `Super`, `Ultra`) | **Single unified pool** (`total` usage) + prepaid credits + banked usage resets | Replaces the split Cursor Models / Other Models buckets once account unification is completed. |
| **Unmerged Grok / SuperGrok subscription** | Legacy xAI CLI proxy quota + `grok.com` reset credits until unified | Signing in with an unmerged SuperGrok / X Premium+ account on the unified CLI prompts the user either to unify accounts or to keep using the legacy `1.0.x` CLI until unified. |

### 2. Dual-subscription users (unmerged Cursor + Grok)

Before account unification, neither the desktop app nor the unified CLI combines or alternates between two separate subscriptions automatically — only the currently signed-in account is billed:

- **`Grok Build.app`:** Uses Cursor sign-in and deducts exclusively from the **Cursor** subscription pool (showing a merge prompt to settle duplicate Cursor billing).
- **Unified CLI (`grok 2.0.6`):**
- Signing in with Cursor deducts exclusively from the **Cursor** subscription pool.
- Signing in with an unmerged Grok account prompts account unification or switching back to the legacy `1.0.x` CLI to spend the standalone Grok subscription.
- **OpenCodex upstream providers:**
- `cursor` provider (`src/oauth/cursor.ts`, `src/adapters/cursor.ts`) deducts from the **Cursor** subscription pool.
- `xai` provider (`src/providers/xai-transport.ts`, `src/grok/reset-coupons.ts`) routes via `cli-chat-proxy.grok.com/v1` and deducts from the **Grok** subscription pool.

After completing account unification, existing Cursor balances and standalone plans are settled into a single unified account and shared quota pool.

## Coexisting Cursor models and OpenCodex custom models

In both the unified CLI (`2.0.6`) and desktop app (`Grok Build.app` `3.32.24`), the hosted Cursor model catalog and Private Inference (`config.toml` / `private-inference.toml`) are **mutually exclusive by design**:

- Normal mode loads only the hosted Cursor catalog and does not mix in local `[model_providers.*]` entries from `~/.grok/config.toml`.
- Private Inference mode loads only the configured TOML catalog and intentionally fails closed rather than falling back to hosted Cursor models.

### Practical options for showing both model sets together

#### CLI (`grok`)

1. **OpenCodex as single hub (recommended for one unified picker):**
- Authenticate both `cursor` and `xai` (plus any other providers) inside OpenCodex, and expose `cursor/*` models alongside other models in the `[model_providers.opencodex]` block injected into `~/.grok/config.toml` (`src/grok/inject.ts`).
- Works on legacy `1.0.x` CLI directly, and on `2.0.6` when running through the Private Inference TOML config path.
2. **Dual-binary workflow (zero feature loss):**
- Use unified `grok` (`2.0.6`) for native Cursor models and full agent-host features.
- Keep a separate alias for legacy `1.0.x` CLI when routing through OpenCodex `[model_providers.opencodex]`.

#### Desktop app (`Grok Build.app` / `Cursor Private Inference.app`)

1. **Regular `Grok Build.app` + BYOK (`Override OpenAI Base URL` + `Add Custom Model`):**
- Keeping Claude/Gemini BYOK keys off leaves `claude-*` and `gemini-*` on the Cursor subscription while routing custom-added models (and `gpt-*`) through the overridden OpenAI Base URL to OpenCodex.
- **Constraint:** BYOK base URL requests are sent from Cursor's backend rather than from localhost, so `127.0.0.1` will not work; OpenCodex must be reachable over a public HTTPS tunnel (with admission token).
2. **Private Inference (`Cursor Private Inference.app` or `private-inference.toml`) + OpenCodex hub:**
- Supports direct `http://127.0.0.1:10100/v1` loopback without a tunnel.
- When OpenCodex serves `cursor/*`, `xai/*`, and third-party models together, all of them appear in a single picker (Cursor models route through OpenCodex's `cursor` adapter rather than the native cloud agent loop).
3. **Dual-app side-by-side:**
- Run `Grok Build.app` for native Cursor models and `Cursor Private Inference.app` for local loopback OpenCodex models.

## OpenCodex follow-up backlog

| Item | Area | Goal |
|---|---|---|
| 1 | `src/integrations/cursor-detect.ts` & `src/cli/integration-cursor.ts` | Detect `Grok Build.app` alongside `Cursor.app` and `Cursor Private Inference.app` without breaking existing installs. |
| 2 | `src/grok/inject.ts` | Verify whether OpenCodex-managed `cursor/*` models are included cleanly in injected `[model.*]` blocks and document `2.0.6` vs legacy `1.0.x` CLI behavior. |
| 3 | `src/oauth/cursor.ts` | Track key-bound / DPoP auth requirements on the `cursor` OAuth path so token refresh stays resilient if enforced upstream. |
| 4 | `src/grok/reset-coupons.ts` | Track unified account banked-reset parity alongside existing `grok.com` reset-credit queries for users who complete account unification. |
| 5 | Live verification (isolated `GROK_HOME`) | Re-verify `xai` provider (`cli-chat-proxy.grok.com/v1`) quota behavior for unified vs unmerged accounts without touching user credentials. |
Loading
Loading