diff --git a/open-sse/config/appConstants.js b/open-sse/config/appConstants.js index 3a96be56..09f3ecff 100644 --- a/open-sse/config/appConstants.js +++ b/open-sse/config/appConstants.js @@ -146,6 +146,16 @@ export const LOAD_CODE_ASSIST_METADATA = { export const CLAUDE_SYSTEM_PROMPT = "You are Claude Code, Anthropic's official CLI for Claude."; export const ANTIGRAVITY_DEFAULT_SYSTEM = "You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**"; +// Proactive token refresh lead times per provider (ms) +export const REFRESH_LEAD_MS = { + codex: 5 * 24 * 60 * 60 * 1000, // 5 days + claude: 4 * 60 * 60 * 1000, // 4 hours + iflow: 24 * 60 * 60 * 1000, // 24 hours + qwen: 20 * 60 * 1000, // 20 minutes + "kimi-coding": 5 * 60 * 1000, // 5 minutes + antigravity: 5 * 60 * 1000, // 5 minutes +}; + // OAuth endpoints export const OAUTH_ENDPOINTS = { google: { diff --git a/open-sse/config/codexInstructions.js b/open-sse/config/codexInstructions.js index b903ac06..75b691dd 100644 --- a/open-sse/config/codexInstructions.js +++ b/open-sse/config/codexInstructions.js @@ -1,5 +1,4 @@ // Default instructions for Codex models -// Source: CLIProxyAPI internal/misc/codex_instructions/ export const CODEX_DEFAULT_INSTRUCTIONS = `You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer. diff --git a/open-sse/executors/codex.js b/open-sse/executors/codex.js index b8842474..e7033623 100644 --- a/open-sse/executors/codex.js +++ b/open-sse/executors/codex.js @@ -150,7 +150,7 @@ export class CodexExecutor extends BaseExecutor { // Priority: explicit reasoning.effort > reasoning_effort param > model suffix > default (medium) if (!body.reasoning) { - const effort = body.reasoning_effort || modelEffort || 'medium'; + const effort = body.reasoning_effort || modelEffort || 'low'; body.reasoning = { effort, summary: "auto" }; } else if (!body.reasoning.summary) { body.reasoning.summary = "auto"; diff --git a/open-sse/executors/qwen.js b/open-sse/executors/qwen.js index 2cadc414..2c9d48ae 100644 --- a/open-sse/executors/qwen.js +++ b/open-sse/executors/qwen.js @@ -1,7 +1,7 @@ import { platform, arch } from "os"; import { DefaultExecutor } from "./default.js"; -/** portal.qwen.ai — aligned with CLIProxyAPI qwen_executor */ +/** portal.qwen.ai */ const qwenCodeVersion = "0.13.2"; const qwenStainless = { runtimeVersion: "v22.17.0", diff --git a/open-sse/services/projectId.js b/open-sse/services/projectId.js index b7aa3002..f9a24e1a 100644 --- a/open-sse/services/projectId.js +++ b/open-sse/services/projectId.js @@ -1,7 +1,6 @@ /** * Project ID Service - Fetch and cache real Project IDs from Google Cloud Code API * - * Reference: CLIProxyAPI internal/auth/antigravity/auth.go (FetchProjectID + OnboardUser) * * Instead of generating random project IDs (e.g. "useful-spark-a1b2c"), * this service fetches the real Project ID bound to the authenticated user's account. diff --git a/open-sse/services/tokenRefresh.js b/open-sse/services/tokenRefresh.js index 36099868..040b6e00 100644 --- a/open-sse/services/tokenRefresh.js +++ b/open-sse/services/tokenRefresh.js @@ -1,9 +1,14 @@ import { PROVIDERS } from "../config/providers.js"; -import { OAUTH_ENDPOINTS, GITHUB_COPILOT } from "../config/appConstants.js"; +import { OAUTH_ENDPOINTS, GITHUB_COPILOT, REFRESH_LEAD_MS } from "../config/appConstants.js"; -// Token expiry buffer (refresh if expires within 5 minutes) +// Default token expiry buffer (refresh if expires within 5 minutes) export const TOKEN_EXPIRY_BUFFER_MS = 5 * 60 * 1000; +// Get provider-specific refresh lead time, falls back to default buffer +export function getRefreshLeadMs(provider) { + return REFRESH_LEAD_MS[provider] || TOKEN_EXPIRY_BUFFER_MS; +} + /** * Refresh OAuth access token using refresh token */ diff --git a/open-sse/translator/helpers/geminiHelper.js b/open-sse/translator/helpers/geminiHelper.js index 24737e79..623b4ea9 100644 --- a/open-sse/translator/helpers/geminiHelper.js +++ b/open-sse/translator/helpers/geminiHelper.js @@ -1,7 +1,6 @@ // Gemini helper functions for translator // Unsupported JSON Schema constraints that should be removed for Antigravity -// Reference: CLIProxyAPI/internal/util/gemini_schema.go (removeUnsupportedKeywords) export const UNSUPPORTED_SCHEMA_CONSTRAINTS = [ // Basic constraints (not supported by Gemini API) "minLength", "maxLength", "exclusiveMinimum", "exclusiveMaximum", @@ -270,7 +269,6 @@ function flattenTypeArrays(obj) { } // Clean JSON Schema for Antigravity API compatibility - removes unsupported keywords recursively -// Reference: CLIProxyAPI/internal/util/gemini_schema.go export function cleanJSONSchemaForAntigravity(schema) { if (!schema || typeof schema !== "object") return schema; diff --git a/src/app/(dashboard)/dashboard/providers/[id]/page.js b/src/app/(dashboard)/dashboard/providers/[id]/page.js index 616068ef..19b970e4 100644 --- a/src/app/(dashboard)/dashboard/providers/[id]/page.js +++ b/src/app/(dashboard)/dashboard/providers/[id]/page.js @@ -865,7 +865,7 @@ export default function ProviderDetailPage() {

Connections

{/* Thinking config */} - {thinkingConfig && ( + {/* {thinkingConfig && (
Thinking