Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5f87dad
fix(security): validate Host header to block DNS rebinding (#14)
aaronjmars May 27, 2026
037e1a8
fix: keep sidebar threads visible in shim mode (#13)
tharuxpert May 27, 2026
885f4ca
Add /picker web UI for browser-based model switching (#15)
OnlyTerp May 27, 2026
2aebd48
feat: support compact and native tool fallbacks (#17)
OnlyTerp May 27, 2026
53608e2
fix: include streaming usage in responses (#18)
OnlyTerp May 27, 2026
52ac178
fix: preserve BYOK visual feedback (#19)
OnlyTerp May 27, 2026
a098b16
fix: normalize byok responses usage (#20)
tharuxpert May 28, 2026
27b6e5e
feat: add Cursor Composer subscription passthrough via cursor-agent CLI
ceelo510 Jun 1, 2026
f6a89f9
feat: add Windows quota launcher
SergiioB Jun 1, 2026
14a05ba
fix: Anthropic auth uses x-api-key only (#24)
eafire15 Jun 1, 2026
855e459
feat: add Auto Router for per-task model selection
Jun 2, 2026
17c4125
test: add Auto Router integration suite (streaming, compaction, agent…
Jun 2, 2026
01a283d
fix(server): treat any /v<N> base path as already-versioned (#30)
Samuel86-star Jun 8, 2026
823600f
fix(router): image-aware fallback_slug to never route image tasks to …
Samuel86-star Jun 8, 2026
08bbfe5
Add OpenCode Go setup on-ramp (#25)
eafire15 Jun 8, 2026
b0da566
Add Anthropic Messages bridge for OpenAI-compatible chat providers (#26)
eafire15 Jun 8, 2026
537f8c7
Integrate open backlog: doctor, CSRF picker, regex patch-app, image d…
Jun 11, 2026
08f12b0
Merge pull request #36 from sybil-solutions/integrate-open-backlog
OnlyTerp Jun 11, 2026
b811626
fix: native tool type mapping for freeform apply_patch and web_search
OnlyTerp Jun 13, 2026
9596597
Merge upstream/main into fork main
Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.pid

# Local Codex inspection artifacts (don't ship)
codedb.snapshot
*.asar
app-asar-work/
*-bsLDOISN.js
Expand Down
81 changes: 81 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,48 @@ and this project does not yet follow semantic versioning (pre-1.0).

### Added

- `codex-shim doctor`, a read-only local diagnostics command covering Python,
dependencies, Codex CLI availability, settings, runtime files, daemon health,
passthrough readiness, proxy loopback bypass, and Codex config wiring with
stable OK/WARN/FAIL/INFO output and summary exit-code handling.
- `docs/subscription-integration.md`, covering ChatGPT/Codex and
Cursor/Composer subscription passthrough setup, troubleshooting, limitations,
and privacy notes.
- Auto Router (`codex_shim/router.py`): an optional `Auto (smart routing)` picker
entry (slug `codex-auto`) that routes each task to the cheapest configured
model that can handle it. A cheap classifier model scores every candidate
`0.0–1.0` from a capability card, the shim picks the cheapest candidate whose
score clears `threshold` (default `0.7`), caches the decision per task, and
falls back safely on any error. Configured via an optional `router` block in
`~/.codex-shim/models.json`; gated in `/health`, `/v1/models`, `/api/models`,
the generated catalog, and `codex-shim list`. Env knobs:
`CODEX_SHIM_DISABLE_ROUTER`, `CODEX_SHIM_ROUTER_TIMEOUT`,
`CODEX_SHIM_ROUTER_MAX_TOKENS`, `CODEX_SHIM_ROUTER_LOG`. Documented in
`docs/AUTO_ROUTER.md` with a runnable offline proof at
`examples/auto_router_demo.py` and 48 offline tests
(`tests/test_router.py`, `tests/test_router_integration.py`) covering
scoring/selection, streaming, compaction, the chat endpoint, the agent
tool-loop cache, OpenAI/Anthropic classifiers, the exact classifier HTTP,
fallbacks, availability gating, and concurrency.
- Cursor/Composer subscription passthrough for slug `composer-2-5`. When
`cursor-agent login` is active, the shim spawns `cursor-agent --print` with
CLI OAuth (no Dashboard API key). The slug is auth-gated in `/health`,
`/v1/models`, and the generated catalog like ChatGPT passthrough.
- `POST /v1/responses/compact` support. ChatGPT passthrough forwards to the
native ChatGPT compact endpoint; BYOK OpenAI/chat and Anthropic routes run a
non-streaming compact summarization request and return a Responses-shaped
compacted window for the next Codex turn.
- BYOK fallback schemas for native Responses-only tools: `computer_use`,
`web_search`, `apply_patch`, and `local_shell` now translate into ordinary
function tools for chat-completions / Anthropic providers instead of being
dropped. Codex MCP function tools continue to pass through unchanged.
- Streaming `response.completed` events now include upstream `usage` when chat
or Anthropic streams provide it, so Codex can track token counts and trigger
auto-compaction.
- BYOK visual feedback passthrough for computer-use loops: Responses
`input_image`, `computer_call_output` screenshots, and visual
`function_call_output` payloads now reach OpenAI chat providers as
`image_url` parts and Anthropic providers as image blocks.
- GitHub Actions CI (`.github/workflows/ci.yml`) running pytest and
`compileall` on Python 3.11 and 3.12.
- `[project.optional-dependencies] dev` in `pyproject.toml` so
Expand All @@ -17,6 +59,20 @@ and this project does not yet follow semantic versioning (pre-1.0).
and what to include in bug reports.
- `.github/ISSUE_TEMPLATE/` with structured bug and feature request templates.
- `CHANGELOG.md` (this file).
- Web-based model picker at `GET /picker` (with `GET /api/models` and
`POST /api/switch`) so the active shim model can be swapped from a browser
without the CLI. Switching rewrites `model = "..."` and the
`[model_providers.codex_shim]` `name = "..."` in `~/.codex/config.toml` so
the Codex Desktop UI shows the selected model name (e.g. "Kimi K2.6")
instead of the generic "Codex Shim" label. Optional auto-restart of Codex
Desktop is cross-platform (`taskkill` + `Codex.exe` on Windows,
`osascript` + `open -a Codex` on macOS). All picker routes are behind the
existing `Host`-header allowlist, so a visited web page still cannot drive
them via DNS rebinding.
- Best-effort dump of the last forwarded chat-completions request body to
`.codex-shim/last_request.json` to make strict-provider tokenization /
schema errors easier to triage. Upstream error bodies are now logged with
the model slug before being forwarded back.

### Changed

Expand All @@ -28,6 +84,31 @@ and this project does not yet follow semantic versioning (pre-1.0).
while still accepting `customModels` and camelCase aliases for existing
exports.

### Fixed

- Protected the state-changing picker `/api/switch` endpoint with a
per-process picker token so third-party pages cannot trigger model switches
or Desktop restarts through the loopback server.
- Image detail normalization in `responses_to_chat`: Codex Desktop's
`detail: "original"` on `input_image` items is mapped to `"high"` for
OpenAI Chat Completions providers; unknown detail values fall back to `"auto"`.
- `codex-shim patch-app` regex needles now match both legacy inline picker
filters in `model-queries-*.js` and newer extracted helpers in
`models-and-reasoning-efforts-*.js`, with APPLIED markers for idempotent
re-runs.
- Anthropic route requests now send only `x-api-key` (plus `anthropic-version`)
for authentication and no longer also attach `Authorization: Bearer <apiKey>`.
Some Anthropic-compatible gateways reject requests that carry both headers.
Providers that genuinely require a bearer token can still supply one via
`extraHeaders`.
- `codex-shim patch-app` now also patches the Codex Desktop sidebar's recent
thread loader so native `openai` chats remain visible while Desktop is routed
through the `codex_shim` provider. Tested on Codex Desktop 26.519.41501 /
`codex-cli 0.133.0-alpha.1` on macOS arm64.
- `patch-app` now updates `ElectronAsarIntegrity` in `Info.plist` after
repacking `app.asar`, and `restore-app` restores or recomputes that metadata
before re-signing the app bundle.

## 2026-05-25 — Auth-gated ChatGPT passthrough + docs hardening

### Added
Expand Down
3 changes: 3 additions & 0 deletions Launch Codex-Shim.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
title Codex-Shim Launcher
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0launch.ps1"
Loading
Loading