v3.10.5 — Add compaction for Antigravity/Gemini OAuth to prevent token limit errors
This commit is contained in:
@@ -335,7 +335,7 @@ def _codebuff_get_session(token, model):
|
||||
req = urllib.request.Request(url, data=body, headers={
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {token}",
|
||||
"User-Agent": "codex-launcher/3.10.4",
|
||||
"User-Agent": "codex-launcher/3.10.5",
|
||||
"x-codebuff-model": model,
|
||||
})
|
||||
try:
|
||||
@@ -383,7 +383,7 @@ def _codebuff_start_run(token, agent_id):
|
||||
req = urllib.request.Request(url, data=body, headers={
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {token}",
|
||||
"User-Agent": "codex-launcher/3.10.4",
|
||||
"User-Agent": "codex-launcher/3.10.5",
|
||||
})
|
||||
try:
|
||||
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={
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {token}",
|
||||
"User-Agent": "codex-launcher/3.10.4",
|
||||
"User-Agent": "codex-launcher/3.10.5",
|
||||
})
|
||||
try:
|
||||
urllib.request.urlopen(req, timeout=10)
|
||||
@@ -1570,6 +1570,10 @@ _PROVIDER_POLICIES = {
|
||||
"tool_output_limit": 6000, "max_input_items": 35, "compaction": "balanced"},
|
||||
"openadapter": {"reasoning_mode": "off", "max_tokens": 32768, "strip_reasoning": True,
|
||||
"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):
|
||||
@@ -1588,12 +1592,14 @@ _MODEL_CONTEXT = {
|
||||
"claude-sonnet": 200000, "claude-haiku": 200000,
|
||||
"glm-5.1": 128000, "glm-5": 128000, "glm-4": 128000,
|
||||
"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,
|
||||
"Claude Sonnet 4.6": 200000, "Claude Opus 4.6": 200000,
|
||||
"GPT-OSS 120B": 128000,
|
||||
"claude-sonnet-4.6-thinking": 200000, "claude-opus-4.6-thinking": 200000,
|
||||
"gpt-oss-120b": 128000,
|
||||
"claude-sonnet-4-6": 200000, "claude-opus-4-6-thinking": 200000,
|
||||
"gpt-oss-120b-medium": 128000,
|
||||
"mimo": 32768, "minimax": 32768, "kimi": 128000,
|
||||
"_default": 32768,
|
||||
}
|
||||
@@ -5342,7 +5348,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {token}",
|
||||
"User-Agent": "codex-launcher/3.10.4",
|
||||
"User-Agent": "codex-launcher/3.10.5",
|
||||
"x-codebuff-model": model,
|
||||
}
|
||||
if instance_id:
|
||||
@@ -5508,7 +5514,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||
if body.get("tool_choice"):
|
||||
chat_body["tool_choice"] = body["tool_choice"]
|
||||
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": "codex-launcher/3.10.5", "x-codebuff-model": model}
|
||||
if 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)
|
||||
|
||||
Reference in New Issue
Block a user