Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 20 additions & 23 deletions .opencode/opencode.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"huggingface",
"opencode",
"github-copilot",
"openai-codex",
"openrouter",
"cloudflare-workers-ai",
"open-design",
Expand All @@ -161,8 +160,10 @@
// they are listed here (verified live 2026-11-03 -- with the entries removed
// all five reappeared in the running server within minutes). The entries are
// the only trace of them left; there are no definitions to flip back on.
// openai-codex was evaluated for the same removal and KEPT whole: live
// model_routes still target openai-codex/* directly.
// openai-codex followed on 2026-11-03: its ten route legs were re-seated
// onto openai-plan (the ChatGPT provider route) and the definition was
// deleted with the rest. It is a custom id with no catalog entry, so --
// unlike the five tombstones above -- no entry stays for it here.
// Default was "claude-code/claude-haiku-5-5" until the 2026-10-27 Claude
// pause (see the header note). Workhorse is the fleet's standard tier and
// what agent configs already default to; restoring the Haiku default
Expand Down Expand Up @@ -362,15 +363,10 @@
// "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544.
},
// "openai": model catalog maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544.
"openai-codex": {
"npm": "@ai-sdk/openai-compatible",
"name": "OpenAI Codex CLI (via codex)",
"options": {
"baseURL": "http://127.0.0.1:{env:CODEX_PROXY_PORT:-18744}/v1",
"apiKey": "codex-local"
}
// "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544.
},
// "openai-codex": retired 2026-11-03 -- definition deleted after its
// route legs were re-seated onto openai-plan (see the note at
// disabled_providers). The codex door program (:18744) is untouched;
// its own retirement stays with the #1154 cutover.
// NOTE (2026-10-25): design-code proxy block (one of three identical copies) - commented out per Drew; only the direct Open Design cloud provider ("opendesign") stays active. Preserved, not deleted.
// "open-design": {
// "npm": "@ai-sdk/openai-compatible",
Expand Down Expand Up @@ -1743,7 +1739,8 @@
// opencode#1413 persona-routes PR; the prompt leads any caller
// system text, exactly as the door composed it). Antigravity legs
// sit on antigravity-direct (:18751) per the #1409 repoint
// (code#4626); codex legs on openai-codex (:18744). The door's
// (code#4626); gpt legs on openai-plan (re-seated from the
// codex door, 2026-11-03). The door's
// keyword fallback for unknown gpt/codex-shaped ids has no route
// equivalent and is not carried: unknown ids fail selection
// cleanly, as they did at the door (400) via the façade envelope.
Expand All @@ -1762,7 +1759,7 @@
"name": "GPT-6 Luna (Design Code)",
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"openai-codex/gpt-6-luna",
"openai-plan/gpt-6-luna",
"antigravity-direct/gemini-3.8-flash"
],
"selection": "ordered",
Expand All @@ -1772,7 +1769,7 @@
"name": "GPT-6.1 Sol (Design Code)",
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"openai-codex/gpt-6.1-sol",
"openai-plan/gpt-6.1-sol",
"antigravity-direct/gemini-3.8-flash"
],
"selection": "ordered",
Expand All @@ -1783,7 +1780,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-5.6-luna"
"openai-plan/gpt-5.6-luna"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1793,7 +1790,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-5.6-luna"
"openai-plan/gpt-5.6-luna"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1803,7 +1800,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-5.6-luna"
"openai-plan/gpt-5.6-luna"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1813,7 +1810,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-5.6-luna"
"openai-plan/gpt-5.6-luna"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1823,7 +1820,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-6.1-sol"
"openai-plan/gpt-6.1-sol"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1833,7 +1830,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-6.1-sol"
"openai-plan/gpt-6.1-sol"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1843,7 +1840,7 @@
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"antigravity-direct/gemini-3.8-flash",
"openai-codex/gpt-5.6-luna"
"openai-plan/gpt-5.6-luna"
],
"selection": "ordered",
"autonomy": "rules"
Expand All @@ -1852,7 +1849,7 @@
"name": "Open Design Pro",
"system": "You are an elite Code & Systems Design Architect.\nYour core expertise is in software architecture, clean code design, UI/UX design engineering, design tokens, component abstractions, domain-driven design, and maintainable systems patterns. Provide elegant, production-grade architectures and idiomatic design implementations.",
"targets": [
"openai-codex/gpt-6.1-sol",
"openai-plan/gpt-6.1-sol",
"antigravity-direct/gemini-3.8-flash"
],
"selection": "ordered",
Expand Down
65 changes: 3 additions & 62 deletions bin/sync-models.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const OPENCODE_CONFIG_PATH =
? REPO_CONFIG_PATH
: USER_CONFIG_PATH);
const POLICY_PATH = path.join(import.meta.dirname, 'sync-models.policy.json');
const CODEX_CACHE_PATH = path.join(HOME_DIR, '.codex/models_cache.json');
const GEMINI_CACHE_PATH = path.join(HOME_DIR, '.gemini/antigravity_models_cache.json');
const LS_LOG_PATH = path.join(HOME_DIR, '.config/Antigravity/logs/language_server.log');

Expand Down Expand Up @@ -177,32 +176,6 @@ async function discoverAntigravityModels() {
return discovered;
}

// -----------------------------------------------------------------------------
// 3. Discover Codex Models (via ~/.codex/models_cache.json)
// -----------------------------------------------------------------------------
function discoverCodexModels() {
console.log('[sync-models] Discovering Codex models...');
if (!fs.existsSync(CODEX_CACHE_PATH)) {
console.warn(`[sync-models] Codex cache file not found at ${CODEX_CACHE_PATH}`);
return [];
}
try {
const raw = fs.readFileSync(CODEX_CACHE_PATH, 'utf-8');
const data = JSON.parse(raw);
const models = (data.models || []).map(m => ({
slug: m.slug,
name: m.display_name || m.name || m.slug,
description: m.description || '',
defaultEffort: m.default_reasoning_effort || 'medium'
}));
console.log(`[sync-models] Discovered ${models.length} models from Codex cache`);
return models;
} catch (err) {
console.warn(`[sync-models] Failed to parse Codex cache: ${err.message}`);
return [];
}
}

// -----------------------------------------------------------------------------
// Model policy (bin/sync-models.policy.json). Per provider, keep only the newest
// model in each listed family and drop everything else. Exclusions are applied
Expand Down Expand Up @@ -463,7 +436,6 @@ function removeJsoncPath(text, keys) {
async function run() {
const modelsDev = await fetchModelsDev();
const agyModels = await discoverAntigravityModels();
const codexModels = discoverCodexModels();
const policy = loadPolicy();

if (!fs.existsSync(OPENCODE_CONFIG_PATH)) {
Expand Down Expand Up @@ -598,40 +570,9 @@ async function run() {
}
}

// 2. Sync openai-codex
if (codexModels.length > 0 && config.provider['openai-codex']) {
const codexProv = config.provider['openai-codex'];
codexProv.models = codexProv.models || {};
const modelsPath = ['provider', 'openai-codex', 'models'];

const codexEfforts = ['low', 'medium', 'high', 'xhigh', 'max', 'ultra'];
const codexVariants = {};
for (const eff of codexEfforts) {
codexVariants[eff] = { options: { reasoning_effort: eff } };
}

for (const m of codexModels) {
if (m.slug === 'codex-auto-review') continue;
const entry = {
name: m.name.includes('(') ? m.name : `${m.name} (Codex CLI)`,
variants: codexVariants,
limit: { context: 1000000, output: 128000 }
};

if (!codexProv.models[m.slug]) {
console.log(`[sync-models] + Adding openai-codex/${m.slug}`);
defineValue(codexProv.models, m.slug, entry);
edits.push({ set: [...modelsPath, m.slug], value: entry });
totalAdded++;
} else {
if (codexProv.models[m.slug].limit?.context !== 1000000) {
codexProv.models[m.slug].limit = { context: 1000000, output: 128000 };
edits.push({ set: [...modelsPath, m.slug, 'limit'], value: { context: 1000000, output: 128000 } });
totalUpdated++;
}
}
}
}
// 2. openai-codex: retired 2026-11-03 -- the provider definition was
// deleted (dead-provider retirement ordered by Drew) after its route
// legs were re-seated onto openai-plan, so there is nothing to sync.

// 3. Sync models.dev for cloud providers (openai; the google and
// cloudflare-gateway syncs were retired 2026-11-03 with their provider definitions)
Expand Down