Compare commits
9 Commits
v3.10.4
...
946f871762
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,5 +1,23 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v3.10.5 (2026-05-25)
|
||||||
|
|
||||||
|
**Windows GUI + Context Compaction for Antigravity/Gemini OAuth**
|
||||||
|
|
||||||
|
### Windows Native GUI (tkinter)
|
||||||
|
- **Windows GUI** in `windows/` folder — full tkinter port by cobra91
|
||||||
|
- OAuth Secrets editor, Import JSON, Antigravity model list
|
||||||
|
- Shared backend with Linux (same translate-proxy.py)
|
||||||
|
- See README for Windows installation and usage
|
||||||
|
|
||||||
|
**Context Compaction for Antigravity/Gemini OAuth**
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
- **Prevent `input token count exceeds maximum` errors** during long conversations
|
||||||
|
- Added aggressive compaction policies for Antigravity (`cloudcode-pa`) and Gemini CLI (`googleapis`)
|
||||||
|
- Auto-trims old turns when approaching 60% of model context limit (1M tokens for Gemini, 200K for Claude, 128K for GPT-OSS)
|
||||||
|
- Added REST model IDs to context size map (`gemini-3-flash`, `gemini-3.1-pro-low`, `claude-sonnet-4-6`, etc.)
|
||||||
|
|
||||||
## v3.10.4 (2026-05-25)
|
## v3.10.4 (2026-05-25)
|
||||||
|
|
||||||
**Security: OAuth Secrets Editor + Import JSON**
|
**Security: OAuth Secrets Editor + Import JSON**
|
||||||
|
|||||||
80
README.md
80
README.md
@@ -9,7 +9,15 @@
|
|||||||
<a href="https://z.ai/subscribe?ic=ROK78RJKNW">z.ai/subscribe</a>
|
<a href="https://z.ai/subscribe?ic=ROK78RJKNW">z.ai/subscribe</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
---
|
---
|
||||||
|
If you want fork it, use the Github copy, here it is:
|
||||||
|
<a href="https://github.com/roman-ryzenadvanced/Codex-Launcher-Any-AI-Provider">Codex-Any-AI-Provider on Github (Official)</a>
|
||||||
|
---
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h1 align="center">Codex Launcher — Any AI Provider</h1>
|
<h1 align="center">Codex Launcher — Any AI Provider</h1>
|
||||||
|
|
||||||
@@ -18,6 +26,13 @@
|
|||||||
Google Antigravity • Gemini CLI • OpenCode • Z.AI • Anthropic • Command Code • Codebuff • OpenRouter • Crof.ai • NVIDIA NIM • OpenAdapter • Kilo.ai • DeepSeek • and more
|
Google Antigravity • Gemini CLI • OpenCode • Z.AI • Anthropic • Command Code • Codebuff • OpenRouter • Crof.ai • NVIDIA NIM • OpenAdapter • Kilo.ai • DeepSeek • and more
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<sub>
|
||||||
|
Windows version by <a href="https://github.com/cobra91">cobra91</a> •
|
||||||
|
Original Linux development by <a href="https://github.com/roman-ryzenadvanced">roman-ryzenadvanced</a>
|
||||||
|
</sub>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/badge/Python-3.8+-blue?logo=python&logoColor=white" alt="Python 3.8+" />
|
<img src="https://img.shields.io/badge/Python-3.8+-blue?logo=python&logoColor=white" alt="Python 3.8+" />
|
||||||
<img src="https://img.shields.io/badge/GTK-3.0-green?logo=gtk&logoColor=white" alt="GTK 3.0" />
|
<img src="https://img.shields.io/badge/GTK-3.0-green?logo=gtk&logoColor=white" alt="GTK 3.0" />
|
||||||
@@ -546,6 +561,16 @@ Codex Launcher includes special handling for Gemini 3 / Antigravity OAuth:
|
|||||||
- **User instruction enforcement**: The latest user message is guaranteed to be the
|
- **User instruction enforcement**: The latest user message is guaranteed to be the
|
||||||
final content turn sent to Gemini, even after compaction.
|
final content turn sent to Gemini, even after compaction.
|
||||||
- **Smart compaction**: Old tool outputs capped at 3000 chars, recent 6 at 20000 chars.
|
- **Smart compaction**: Old tool outputs capped at 3000 chars, recent 6 at 20000 chars.
|
||||||
|
- **Context compaction**: Aggressive auto-trimming when approaching 60% of model context
|
||||||
|
limit (1M tokens Gemini, 200K Claude, 128K GPT-OSS). Prevents token limit errors.
|
||||||
|
- **Model ID mapping**: Display names (e.g. `Gemini 3.5 Flash (High)`) mapped to REST API
|
||||||
|
slugs (e.g. `gemini-3-flash`). See `docs/ANTIGRAVITY.md` for details.
|
||||||
|
|
||||||
|
### OAuth Secrets
|
||||||
|
|
||||||
|
Google OAuth credentials are stored locally in `~/.config/codex-launcher/oauth-secrets.json`
|
||||||
|
and never committed to the repository. Use the **OAuth Secrets** button in the launcher
|
||||||
|
header to edit or import `client_secret_*.json` files from Google Cloud Console.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -762,15 +787,64 @@ codex --profile my-profile -c model=my-model
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Windows Version
|
||||||
|
|
||||||
|
A native **Windows GUI** (tkinter) is available in the [`windows/`](./windows/) folder, ported from the Linux GTK version.
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<sub>
|
||||||
|
Windows version by <a href="https://github.com/cobra91">cobra91</a> •
|
||||||
|
Original Linux development by <a href="https://github.com/roman-ryzenadvanced">roman-ryzenadvanced</a>
|
||||||
|
</sub>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
### Files
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|---|---|
|
||||||
|
| `windows/codex-launcher-gui.py` | tkinter GUI — manage endpoints, launch Codex CLI/Desktop |
|
||||||
|
| `windows/codex_launcher_lib.py` | Shared library — proxy lifecycle, config, OAuth, diagnostics |
|
||||||
|
|
||||||
|
### How to Run (Windows)
|
||||||
|
|
||||||
|
Python ≥ 3.8 with tkinter is required (comes with the official Python installer).
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# From repo root
|
||||||
|
cd windows
|
||||||
|
python codex-launcher-gui.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The GUI will:
|
||||||
|
1. Auto-create default endpoints on first run
|
||||||
|
2. Show a toolbar with Endpoints, OAuth Secrets, AI Monitor, and more
|
||||||
|
3. Launch Codex CLI/Desktop with your chosen provider
|
||||||
|
|
||||||
|
### OAuth Credentials
|
||||||
|
|
||||||
|
Google OAuth (Antigravity / Gemini CLI) requires a `client_secret_*.json` from [Google Cloud Console](https://console.cloud.google.com/apis/credentials). Use the **OAuth Secrets** button in the GUI to import it — credentials are stored locally in `~/.config/codex-launcher/oauth-secrets.json`, never in the repo.
|
||||||
|
|
||||||
|
### Shared Backend
|
||||||
|
|
||||||
|
The same `translate-proxy.py` powers both Linux and Windows. All fixes apply to both:
|
||||||
|
- Antigravity REST model ID mapping
|
||||||
|
- Context compaction (60% of token limit)
|
||||||
|
- Multi-account rotation
|
||||||
|
- Rate limit handling
|
||||||
|
- AI Monitoring / self-revive watchdog
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Python ≥ 3.8
|
- Python ≥ 3.8
|
||||||
- python3-gi (`sudo apt install python3-gi`)
|
- python3-gi (`sudo apt install python3-gi`) — Linux only
|
||||||
|
- tkinter (`python3-tk`) — Windows / Linux GUI
|
||||||
- Codex CLI ≥ 2.0
|
- Codex CLI ≥ 2.0
|
||||||
- Codex Desktop (optional, for Desktop mode)
|
- Codex Desktop (optional, for Desktop mode)
|
||||||
- bash, curl, lsof
|
- bash, curl, lsof — Linux only
|
||||||
|
|
||||||
**No pip dependencies.** Zero. Pure stdlib + system GTK.
|
**No pip dependencies.** Zero. Pure stdlib.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
codex-launcher_3.10.5_all.deb
Normal file
BIN
codex-launcher_3.10.5_all.deb
Normal file
Binary file not shown.
@@ -3,11 +3,11 @@ set -e
|
|||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
if [ -f "$SCRIPT_DIR/codex-launcher_3.10.4_all.deb" ]; then
|
if [ -f "$SCRIPT_DIR/codex-launcher_3.10.5_all.deb" ]; then
|
||||||
echo "Installing codex-launcher_3.10.4_all.deb ..."
|
echo "Installing codex-launcher_3.10.5_all.deb ..."
|
||||||
sudo dpkg -i "$SCRIPT_DIR/codex-launcher_3.10.4_all.deb"
|
sudo dpkg -i "$SCRIPT_DIR/codex-launcher_3.10.5_all.deb"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Installed v3.10.4 via .deb package."
|
echo "Installed v3.10.5 via .deb package."
|
||||||
echo " translate-proxy.py -> /usr/bin/translate-proxy.py"
|
echo " translate-proxy.py -> /usr/bin/translate-proxy.py"
|
||||||
echo " codex-launcher-gui -> /usr/bin/codex-launcher-gui"
|
echo " codex-launcher-gui -> /usr/bin/codex-launcher-gui"
|
||||||
echo " cleanup-codex-stale -> /usr/bin/cleanup-codex-stale.sh"
|
echo " cleanup-codex-stale -> /usr/bin/cleanup-codex-stale.sh"
|
||||||
|
|||||||
@@ -393,7 +393,25 @@ PROVIDER_PRESETS = {
|
|||||||
},
|
},
|
||||||
"Codebuff (Free DeepSeek/Kimi)": {
|
"Codebuff (Free DeepSeek/Kimi)": {
|
||||||
"backend_type": "codebuff",
|
"backend_type": "codebuff",
|
||||||
"base_url": "https://codebuff.com",
|
"base_url": "https://www.codebuff.com",
|
||||||
|
"oauth_provider": "codebuff",
|
||||||
|
"models": [
|
||||||
|
"deepseek/deepseek-v4-pro", "deepseek/deepseek-v4-flash",
|
||||||
|
"moonshotai/kimi-k2.6", "minimax/minimax-m2.7",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"Freebuff (Free DeepSeek/Kimi)": {
|
||||||
|
"backend_type": "codebuff",
|
||||||
|
"base_url": "https://www.codebuff.com",
|
||||||
|
"oauth_provider": "codebuff",
|
||||||
|
"models": [
|
||||||
|
"deepseek/deepseek-v4-pro", "deepseek/deepseek-v4-flash",
|
||||||
|
"moonshotai/kimi-k2.6", "minimax/minimax-m2.7",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"FreeBuff": {
|
||||||
|
"backend_type": "codebuff",
|
||||||
|
"base_url": "https://www.codebuff.com",
|
||||||
"oauth_provider": "codebuff",
|
"oauth_provider": "codebuff",
|
||||||
"models": [
|
"models": [
|
||||||
"deepseek/deepseek-v4-pro", "deepseek/deepseek-v4-flash",
|
"deepseek/deepseek-v4-pro", "deepseek/deepseek-v4-flash",
|
||||||
@@ -1780,7 +1798,7 @@ class LauncherWin(Gtk.Window):
|
|||||||
# header row
|
# header row
|
||||||
hdr = Gtk.Box(spacing=8)
|
hdr = Gtk.Box(spacing=8)
|
||||||
vbox.pack_start(hdr, False, False, 0)
|
vbox.pack_start(hdr, False, False, 0)
|
||||||
lbl = Gtk.Label(label="<b>Codex Launcher v3.10.4</b>")
|
lbl = Gtk.Label(label="<b>Codex Launcher v3.10.5</b>")
|
||||||
lbl.set_use_markup(True)
|
lbl.set_use_markup(True)
|
||||||
hdr.pack_start(lbl, False, False, 0)
|
hdr.pack_start(lbl, False, False, 0)
|
||||||
changelog_btn = Gtk.Button(label="Changelog")
|
changelog_btn = Gtk.Button(label="Changelog")
|
||||||
@@ -3685,10 +3703,10 @@ class EditEndpointDialog(Gtk.Dialog):
|
|||||||
def _codebuff_auth_thread():
|
def _codebuff_auth_thread():
|
||||||
try:
|
try:
|
||||||
fingerprint_id = str(uuid.uuid4())
|
fingerprint_id = str(uuid.uuid4())
|
||||||
auth_url = "https://codebuff.com/api/auth/cli/code"
|
auth_url = "https://www.codebuff.com/api/auth/cli/code"
|
||||||
body = json.dumps({"fingerprintId": fingerprint_id}).encode()
|
body = json.dumps({"fingerprintId": fingerprint_id}).encode()
|
||||||
req = urllib.request.Request(auth_url, data=body,
|
req = urllib.request.Request(auth_url, data=body,
|
||||||
headers={"Content-Type": "application/json", "User-Agent": "codex-launcher/3.10.4"})
|
headers={"Content-Type": "application/json", "User-Agent": "codex-launcher/3.10.5"})
|
||||||
resp = urllib.request.urlopen(req, timeout=30)
|
resp = urllib.request.urlopen(req, timeout=30)
|
||||||
data = json.loads(resp.read())
|
data = json.loads(resp.read())
|
||||||
login_url = data.get("loginUrl", "") or data.get("login_url", "")
|
login_url = data.get("loginUrl", "") or data.get("login_url", "")
|
||||||
@@ -3707,13 +3725,13 @@ class EditEndpointDialog(Gtk.Dialog):
|
|||||||
|
|
||||||
webbrowser.open(login_url)
|
webbrowser.open(login_url)
|
||||||
|
|
||||||
poll_url = f"https://codebuff.com/api/auth/cli/status?fingerprintId={urllib.parse.quote(fingerprint_id)}&fingerprintHash={urllib.parse.quote(fingerprint_hash)}&expiresAt={expires_at}"
|
poll_url = f"https://www.codebuff.com/api/auth/cli/status?fingerprintId={urllib.parse.quote(fingerprint_id)}&fingerprintHash={urllib.parse.quote(fingerprint_hash)}&expiresAt={expires_at}"
|
||||||
deadline = time.time() + 300
|
deadline = time.time() + 300
|
||||||
while time.time() < deadline:
|
while time.time() < deadline:
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
try:
|
try:
|
||||||
poll_req = urllib.request.Request(poll_url,
|
poll_req = urllib.request.Request(poll_url,
|
||||||
headers={"User-Agent": "codex-launcher/3.10.4"})
|
headers={"User-Agent": "codex-launcher/3.10.5"})
|
||||||
poll_resp = urllib.request.urlopen(poll_req, timeout=10)
|
poll_resp = urllib.request.urlopen(poll_req, timeout=10)
|
||||||
poll_data = json.loads(poll_resp.read())
|
poll_data = json.loads(poll_resp.read())
|
||||||
user = poll_data.get("user")
|
user = poll_data.get("user")
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ _conn_pool = {}
|
|||||||
|
|
||||||
_STREAM_IDLE_TIMEOUT = 300
|
_STREAM_IDLE_TIMEOUT = 300
|
||||||
|
|
||||||
_CODEBUFF_AUTH_URL = "https://codebuff.com"
|
_CODEBUFF_AUTH_URL = "https://www.codebuff.com"
|
||||||
_CODEBUFF_API_URL = "https://www.codebuff.com"
|
_CODEBUFF_API_URL = "https://www.codebuff.com"
|
||||||
_CODEBUFF_AGENT_MAP = {
|
_CODEBUFF_AGENT_MAP = {
|
||||||
"deepseek/deepseek-v4-pro": "base2-free-deepseek",
|
"deepseek/deepseek-v4-pro": "base2-free-deepseek",
|
||||||
@@ -331,11 +331,11 @@ def _codebuff_get_session(token, model):
|
|||||||
return sc["instance_id"]
|
return sc["instance_id"]
|
||||||
try:
|
try:
|
||||||
url = f"{_CODEBUFF_API_URL}/api/v1/freebuff/session"
|
url = f"{_CODEBUFF_API_URL}/api/v1/freebuff/session"
|
||||||
body = json.dumps({"model": model}).encode()
|
body = json.dumps({}).encode()
|
||||||
req = urllib.request.Request(url, data=body, headers={
|
req = urllib.request.Request(url, data=body, headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": f"Bearer {token}",
|
"Authorization": f"Bearer {token}",
|
||||||
"User-Agent": "codex-launcher/3.10.4",
|
"User-Agent": "ai-sdk/openai-compatible/1.0.25/codebuff",
|
||||||
"x-codebuff-model": model,
|
"x-codebuff-model": model,
|
||||||
})
|
})
|
||||||
try:
|
try:
|
||||||
@@ -383,7 +383,7 @@ def _codebuff_start_run(token, agent_id):
|
|||||||
req = urllib.request.Request(url, data=body, headers={
|
req = urllib.request.Request(url, data=body, headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": f"Bearer {token}",
|
"Authorization": f"Bearer {token}",
|
||||||
"User-Agent": "codex-launcher/3.10.4",
|
"User-Agent": "ai-sdk/openai-compatible/1.0.25/codebuff",
|
||||||
})
|
})
|
||||||
try:
|
try:
|
||||||
resp = urllib.request.urlopen(req, timeout=15)
|
resp = urllib.request.urlopen(req, timeout=15)
|
||||||
@@ -416,7 +416,7 @@ def _codebuff_finish_run(token, run_id, status="completed"):
|
|||||||
req = urllib.request.Request(url, data=body, headers={
|
req = urllib.request.Request(url, data=body, headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": f"Bearer {token}",
|
"Authorization": f"Bearer {token}",
|
||||||
"User-Agent": "codex-launcher/3.10.4",
|
"User-Agent": "ai-sdk/openai-compatible/1.0.25/codebuff",
|
||||||
})
|
})
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen(req, timeout=10)
|
urllib.request.urlopen(req, timeout=10)
|
||||||
@@ -1570,6 +1570,10 @@ _PROVIDER_POLICIES = {
|
|||||||
"tool_output_limit": 6000, "max_input_items": 35, "compaction": "balanced"},
|
"tool_output_limit": 6000, "max_input_items": 35, "compaction": "balanced"},
|
||||||
"openadapter": {"reasoning_mode": "off", "max_tokens": 32768, "strip_reasoning": True,
|
"openadapter": {"reasoning_mode": "off", "max_tokens": 32768, "strip_reasoning": True,
|
||||||
"tool_output_limit": 6000, "max_input_items": 30, "compaction": "balanced"},
|
"tool_output_limit": 6000, "max_input_items": 30, "compaction": "balanced"},
|
||||||
|
"cloudcode-pa": {"compaction": "aggressive", "context_size": 1000000,
|
||||||
|
"tool_output_limit": 6000, "max_input_items": 60},
|
||||||
|
"googleapis": {"compaction": "balanced", "context_size": 1000000,
|
||||||
|
"tool_output_limit": 6000, "max_input_items": 80},
|
||||||
}
|
}
|
||||||
|
|
||||||
def provider_policy(target_url=None, backend=None):
|
def provider_policy(target_url=None, backend=None):
|
||||||
@@ -1588,12 +1592,14 @@ _MODEL_CONTEXT = {
|
|||||||
"claude-sonnet": 200000, "claude-haiku": 200000,
|
"claude-sonnet": 200000, "claude-haiku": 200000,
|
||||||
"glm-5.1": 128000, "glm-5": 128000, "glm-4": 128000,
|
"glm-5.1": 128000, "glm-5": 128000, "glm-4": 128000,
|
||||||
"deepseek": 64000, "gemini-2.5-flash": 1000000, "gemini-2.5-pro": 2000000,
|
"deepseek": 64000, "gemini-2.5-flash": 1000000, "gemini-2.5-pro": 2000000,
|
||||||
|
"gemini-3-flash": 1000000, "gemini-3.5-flash-low": 1000000,
|
||||||
|
"gemini-3.1-pro-low": 2000000,
|
||||||
"gemini-3.5-flash": 1000000, "gemini-3.1-pro": 2000000,
|
"gemini-3.5-flash": 1000000, "gemini-3.1-pro": 2000000,
|
||||||
"Gemini 3.5 Flash": 1000000, "Gemini 3.1 Pro": 2000000,
|
"Gemini 3.5 Flash": 1000000, "Gemini 3.1 Pro": 2000000,
|
||||||
"Claude Sonnet 4.6": 200000, "Claude Opus 4.6": 200000,
|
"Claude Sonnet 4.6": 200000, "Claude Opus 4.6": 200000,
|
||||||
"GPT-OSS 120B": 128000,
|
"GPT-OSS 120B": 128000,
|
||||||
"claude-sonnet-4.6-thinking": 200000, "claude-opus-4.6-thinking": 200000,
|
"claude-sonnet-4-6": 200000, "claude-opus-4-6-thinking": 200000,
|
||||||
"gpt-oss-120b": 128000,
|
"gpt-oss-120b-medium": 128000,
|
||||||
"mimo": 32768, "minimax": 32768, "kimi": 128000,
|
"mimo": 32768, "minimax": 32768, "kimi": 128000,
|
||||||
"_default": 32768,
|
"_default": 32768,
|
||||||
}
|
}
|
||||||
@@ -5318,9 +5324,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
metadata = {
|
metadata = {
|
||||||
"run_id": run_id,
|
"run_id": run_id,
|
||||||
"cost_mode": "free",
|
"cost_mode": "free",
|
||||||
|
"client_id": secrets.token_hex(7)[:13],
|
||||||
}
|
}
|
||||||
if instance_id:
|
if instance_id:
|
||||||
metadata["codebuff_instance_id"] = instance_id
|
metadata["freebuff_instance_id"] = instance_id
|
||||||
|
|
||||||
chat_body = {
|
chat_body = {
|
||||||
"model": model,
|
"model": model,
|
||||||
@@ -5342,7 +5349,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": f"Bearer {token}",
|
"Authorization": f"Bearer {token}",
|
||||||
"User-Agent": "codex-launcher/3.10.4",
|
"User-Agent": "ai-sdk/openai-compatible/1.0.25/codebuff",
|
||||||
"x-codebuff-model": model,
|
"x-codebuff-model": model,
|
||||||
}
|
}
|
||||||
if instance_id:
|
if instance_id:
|
||||||
@@ -5490,9 +5497,9 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
instance_id = _codebuff_get_session(token, model)
|
instance_id = _codebuff_get_session(token, model)
|
||||||
messages = _cb_input_to_messages(input_data, instructions)
|
messages = _cb_input_to_messages(input_data, instructions)
|
||||||
_codebuff_hard_disable_reasoning(messages)
|
_codebuff_hard_disable_reasoning(messages)
|
||||||
metadata = {"run_id": run_id, "cost_mode": "free"}
|
metadata = {"run_id": run_id, "cost_mode": "free", "client_id": secrets.token_hex(7)[:13]}
|
||||||
if instance_id:
|
if instance_id:
|
||||||
metadata["codebuff_instance_id"] = instance_id
|
metadata["freebuff_instance_id"] = instance_id
|
||||||
chat_body = {
|
chat_body = {
|
||||||
"model": model, "messages": messages, "stream": stream,
|
"model": model, "messages": messages, "stream": stream,
|
||||||
"max_tokens": max(body.get("max_output_tokens", 0), 64000),
|
"max_tokens": max(body.get("max_output_tokens", 0), 64000),
|
||||||
@@ -5508,7 +5515,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
if body.get("tool_choice"):
|
if body.get("tool_choice"):
|
||||||
chat_body["tool_choice"] = body["tool_choice"]
|
chat_body["tool_choice"] = body["tool_choice"]
|
||||||
target = f"{_CODEBUFF_API_URL}/api/v1/chat/completions"
|
target = f"{_CODEBUFF_API_URL}/api/v1/chat/completions"
|
||||||
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {token}", "User-Agent": "codex-launcher/3.10.4", "x-codebuff-model": model}
|
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {token}", "User-Agent": "ai-sdk/openai-compatible/1.0.25/codebuff", "x-codebuff-model": model}
|
||||||
if instance_id:
|
if instance_id:
|
||||||
headers["x-codebuff-instance-id"] = instance_id
|
headers["x-codebuff-instance-id"] = instance_id
|
||||||
print(f"[codebuff] retry POST {target} model={model} stream={stream} run={run_id} (thinking disabled via DeepSeek native)", file=sys.stderr)
|
print(f"[codebuff] retry POST {target} model={model} stream={stream} run={run_id} (thinking disabled via DeepSeek native)", file=sys.stderr)
|
||||||
|
|||||||
2786
windows/codex-launcher-gui.py
Normal file
2786
windows/codex-launcher-gui.py
Normal file
File diff suppressed because it is too large
Load Diff
2073
windows/codex_launcher_lib.py
Normal file
2073
windows/codex_launcher_lib.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user