merge: integrate upstream/main (v1.2.15) into feature/webui

- Resolved conflict in src/constants.js: kept config-driven approach

- Adopted upstream 10-second cooldown default

- Added MAX_EMPTY_RESPONSE_RETRIES constant from upstream

- Incorporated new test files and GitHub issue templates
This commit is contained in:
Wha1eChai
2026-01-09 18:08:45 +08:00
22 changed files with 1100 additions and 96 deletions

View File

@@ -37,7 +37,7 @@ function getPlatformUserAgent() {
}
// Cloud Code API endpoints (in fallback order)
const ANTIGRAVITY_ENDPOINT_DAILY = 'https://daily-cloudcode-pa.sandbox.googleapis.com';
const ANTIGRAVITY_ENDPOINT_DAILY = 'https://daily-cloudcode-pa.googleapis.com';
const ANTIGRAVITY_ENDPOINT_PROD = 'https://cloudcode-pa.googleapis.com';
// Endpoint fallback order (daily → prod)
@@ -76,8 +76,9 @@ export const ACCOUNT_CONFIG_PATH = config?.accountConfigPath || join(
// Uses platform-specific path detection
export const ANTIGRAVITY_DB_PATH = getAntigravityDbPath();
export const DEFAULT_COOLDOWN_MS = config?.defaultCooldownMs || (60 * 1000); // From config or 1 minute
export const DEFAULT_COOLDOWN_MS = config?.defaultCooldownMs || (10 * 1000); // From config or 10 seconds (upstream default)
export const MAX_RETRIES = config?.maxRetries || 5; // From config or 5
export const MAX_EMPTY_RESPONSE_RETRIES = 2; // Max retries for empty API responses (from upstream)
export const MAX_ACCOUNTS = config?.maxAccounts || 10; // From config or 10
// Rate limit wait thresholds
@@ -146,6 +147,11 @@ export const OAUTH_CONFIG = {
};
export const OAUTH_REDIRECT_URI = `http://localhost:${OAUTH_CONFIG.callbackPort}/oauth-callback`;
// Minimal Antigravity system instruction (from CLIProxyAPI)
// Only includes the essential identity portion to reduce token usage and improve response quality
// Reference: GitHub issue #76, CLIProxyAPI, gcli2api
export const ANTIGRAVITY_SYSTEM_INSTRUCTION = `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**`;
// Model fallback mapping - maps primary model to fallback when quota exhausted
export const MODEL_FALLBACK_MAP = {
'gemini-3-pro-high': 'claude-opus-4-5-thinking',
@@ -168,6 +174,7 @@ export default {
ANTIGRAVITY_DB_PATH,
DEFAULT_COOLDOWN_MS,
MAX_RETRIES,
MAX_EMPTY_RESPONSE_RETRIES,
MAX_ACCOUNTS,
MAX_WAIT_BEFORE_ERROR_MS,
MIN_SIGNATURE_LENGTH,
@@ -178,5 +185,6 @@ export default {
isThinkingModel,
OAUTH_CONFIG,
OAUTH_REDIRECT_URI,
MODEL_FALLBACK_MAP
MODEL_FALLBACK_MAP,
ANTIGRAVITY_SYSTEM_INSTRUCTION
};