mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-11-18 07:58:27 +00:00
Merge pull request #20429 from cheaper-inference/chore/sync-back-v3.8.54-into-v3.8.55
chore(release): sync main (v3.8.54 close) into release/v3.8.55
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -156,8 +156,11 @@ jobs:
|
||||
cache: ${{ github.event_name == 'pull_request' }}
|
||||
- run: npm run check:node-runtime
|
||||
- run: npm run audit:deps
|
||||
# The cache, the JSON report and its upload run even when a step above failed:
|
||||
# quality-gate still runs on a failed lint job and its ESLint download is strict, so a
|
||||
# missing artifact would skip the complexity / duplication / dead-code ratchets too.
|
||||
- name: Restore ESLint file cache
|
||||
if: github.event_name == 'pull_request'
|
||||
if: github.event_name == 'pull_request' && !cancelled()
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
|
||||
with:
|
||||
path: |
|
||||
@@ -172,6 +175,7 @@ jobs:
|
||||
# Single ESLint inventory (JSON) — quality-gate reuses the artifact instead of
|
||||
# a second cold full-tree pass for eslintWarnings ratchet counts.
|
||||
- name: ESLint (JSON report)
|
||||
if: ${{ !cancelled() }}
|
||||
run: npm run lint:json
|
||||
- name: Upload ESLint results
|
||||
if: always()
|
||||
@@ -384,6 +388,10 @@ jobs:
|
||||
run: npm run check:type-coverage
|
||||
- name: Compression budget ratchet (F2.4 / N4)
|
||||
run: npm run check:compression-budget
|
||||
# Kit type scale (#19066 block 7): sizes under 12 px and font-bold may only go down. The
|
||||
# pre-commit hook runs it too, but `git commit --no-verify` skips the hook.
|
||||
- name: Type scale ratchet
|
||||
run: npm run check:type-scale-ratchet -- --ratchet
|
||||
# CodeQL alerts ratchet — BLOQUEANTE (promovido de advisory na v3.8.26).
|
||||
# Lê metrics.codeqlAlerts.value de quality-baseline.json e sai 1 SOMENTE numa
|
||||
# regressão real (alertas abertos > baseline). Falha de medição (gh/auth/api)
|
||||
@@ -475,17 +483,22 @@ jobs:
|
||||
run: |
|
||||
set +e
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
# gitleaks — download latest linux x64 tarball via gh (authed), extract binary
|
||||
# Pinned to quality.yml's versions: a scanner release must not change a ratchet's
|
||||
# verdict mid-cycle, nor give one gate two verdicts on one omni-queue candidate.
|
||||
GITLEAKS_VERSION=v8.30.1
|
||||
OSV_SCANNER_VERSION=v2.3.8
|
||||
OASDIFF_VERSION=v1.19.1
|
||||
# gitleaks — pinned linux x64 tarball via gh (authed), extract binary
|
||||
rm -rf /tmp/gl && mkdir -p /tmp/gl
|
||||
gh release download --repo gitleaks/gitleaks --pattern '*linux_x64.tar.gz' --dir /tmp/gl
|
||||
gh release download "$GITLEAKS_VERSION" --repo gitleaks/gitleaks --pattern '*linux_x64.tar.gz' --dir /tmp/gl
|
||||
tar -xzf /tmp/gl/*linux_x64.tar.gz -C "$HOME/.local/bin" gitleaks
|
||||
# osv-scanner — download latest linux amd64 bare binary via gh (authed)
|
||||
# osv-scanner — pinned linux amd64 bare binary via gh (authed)
|
||||
rm -rf /tmp/osv && mkdir -p /tmp/osv
|
||||
gh release download --repo google/osv-scanner --pattern '*linux_amd64' --dir /tmp/osv
|
||||
gh release download "$OSV_SCANNER_VERSION" --repo google/osv-scanner --pattern '*linux_amd64' --dir /tmp/osv
|
||||
install -m 0755 /tmp/osv/*linux_amd64 "$HOME/.local/bin/osv-scanner"
|
||||
# oasdiff — download latest linux amd64 tarball via gh (authed), extract binary
|
||||
# oasdiff — pinned linux amd64 tarball via gh (authed), extract binary
|
||||
rm -rf /tmp/oasd && mkdir -p /tmp/oasd
|
||||
gh release download --repo oasdiff/oasdiff --pattern '*linux_amd64.tar.gz' --dir /tmp/oasd
|
||||
gh release download "$OASDIFF_VERSION" --repo oasdiff/oasdiff --pattern '*linux_amd64.tar.gz' --dir /tmp/oasd
|
||||
tar -xzf /tmp/oasd/*linux_amd64.tar.gz -C "$HOME/.local/bin" oasdiff
|
||||
# ALWAYS export the bin dir (even if any step above failed)
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
14
.github/workflows/docker-org-mirror.yml
vendored
14
.github/workflows/docker-org-mirror.yml
vendored
@@ -51,6 +51,15 @@ jobs:
|
||||
name: Copy release to cheaperinference/omniroute
|
||||
runs-on: ${{ vars.DOCKER_AMD64_RUNNER == 'blacksmith' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||
timeout-minutes: 45
|
||||
# One group for every mirror run, whatever the caller: docker-publish groups by github.ref,
|
||||
# so two releases never share its group and their mirrors could otherwise overlap. Queued
|
||||
# here, the later run re-reads origin's tags (the script's :latest recheck) after the earlier
|
||||
# one finished, so an older release cannot move :latest back. GitHub keeps one pending run per
|
||||
# group: a pending mirror replaced by a newer one shows as cancelled and is re-run with a
|
||||
# workflow_dispatch of this workflow.
|
||||
concurrency:
|
||||
group: docker-org-mirror
|
||||
cancel-in-progress: false
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
@@ -66,6 +75,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
|
||||
- name: Copy the release images
|
||||
id: mirror
|
||||
env:
|
||||
VERSION: ${{ inputs.version }}
|
||||
PROMOTE_LATEST: ${{ inputs.promote_latest && 'true' || 'false' }}
|
||||
@@ -74,7 +84,9 @@ jobs:
|
||||
run: node scripts/ci/docker-org-mirror.mjs
|
||||
|
||||
- name: Update the org repository description
|
||||
if: env.HAS_ORG_CREDENTIALS == 'true' && inputs.promote_latest
|
||||
# The README follows :latest: only when this run actually moved it (the script rechecks
|
||||
# the promote_latest request against origin's tags and may decline it).
|
||||
if: env.HAS_ORG_CREDENTIALS == 'true' && steps.mirror.outputs.promoted == 'true'
|
||||
continue-on-error: true
|
||||
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5
|
||||
with:
|
||||
|
||||
17
.github/workflows/nightly-derived-refresh.yml
vendored
17
.github/workflows/nightly-derived-refresh.yml
vendored
@@ -66,6 +66,10 @@ jobs:
|
||||
# A freeze issue is titled "🔒 release-freeze: vX.Y.Z in progress"; v3.8.5 must not
|
||||
# match v3.8.52, and a freeze that names no version freezes everything.
|
||||
VER_RE=$(printf '%s' "${BASE#release/}" | sed 's/\./\\./g')
|
||||
# A checked assignment: a failed lookup fails the step. Fed through `< <(gh ...)`, the
|
||||
# failure was invisible to set -e, the loop read EOF and the run went on as not frozen.
|
||||
FREEZES=$(gh issue list --repo "$GITHUB_REPOSITORY" --label release-freeze --state open \
|
||||
--json number,title --jq '.[] | "\(.number)\t\(.title)"')
|
||||
FROZEN=""
|
||||
while IFS=$'\t' read -r NUM TITLE; do
|
||||
[ -n "$NUM" ] || continue
|
||||
@@ -73,8 +77,7 @@ jobs:
|
||||
|| ! printf '%s' "$TITLE" | grep -qE 'v[0-9]+\.[0-9]+\.[0-9]+'; then
|
||||
FROZEN="#$NUM"
|
||||
fi
|
||||
done < <(gh issue list --repo "$GITHUB_REPOSITORY" --label release-freeze --state open \
|
||||
--json number,title --jq '.[] | "\(.number)\t\(.title)"')
|
||||
done <<< "$FREEZES"
|
||||
RED=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open \
|
||||
--search "Release branch not green: $BASE in:title" --json number --jq '.[0].number // empty')
|
||||
{
|
||||
@@ -122,6 +125,12 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TITLE="chore(docs): refresh derived numbers on ${BASE}"
|
||||
# The fetched tip is the robot's own only when the bot both authored AND committed it:
|
||||
# `git commit --amend --no-edit` on the bot commit keeps the bot as author but records
|
||||
# the maintainer as committer, and that hand fix must be neither closed nor overwritten.
|
||||
robot_tip() {
|
||||
[ "$(git log -1 --format='%ae %ce' FETCH_HEAD)" = "$BOT_EMAIL $BOT_EMAIL" ]
|
||||
}
|
||||
git add -A
|
||||
if git diff --cached --quiet; then
|
||||
echo "Every derived number on \`$BASE\` already matches the live code." >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -132,7 +141,7 @@ jobs:
|
||||
--json number --jq '.[0].number // empty')
|
||||
if [ -n "$STALE" ]; then
|
||||
git fetch -q --depth=1 origin "$REFRESH_BRANCH"
|
||||
if [ "$(git log -1 --format=%ae FETCH_HEAD)" = "$BOT_EMAIL" ]; then
|
||||
if robot_tip; then
|
||||
gh pr close "$STALE" --repo "$GITHUB_REPOSITORY" \
|
||||
--comment "Closed by the nightly derived refresh: \`$BASE\` already matches the live code (${RUN_URL})." > /dev/null
|
||||
echo "Closed the stale refresh PR #$STALE." >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -151,7 +160,7 @@ jobs:
|
||||
REMOTE_SHA=$(git ls-remote --heads origin "$REFRESH_BRANCH" | cut -f1)
|
||||
if [ -n "$OPEN_PR" ] && [ -n "$REMOTE_SHA" ]; then
|
||||
git fetch -q --depth=1 origin "$REFRESH_BRANCH"
|
||||
if [ "$(git log -1 --format=%ae FETCH_HEAD)" != "$BOT_EMAIL" ]; then
|
||||
if ! robot_tip; then
|
||||
echo "PR #${OPEN_PR%% *} has commits pushed by hand; not overwriting them." >> "$GITHUB_STEP_SUMMARY"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
82
.github/workflows/npm-publish.yml
vendored
82
.github/workflows/npm-publish.yml
vendored
@@ -520,9 +520,23 @@ jobs:
|
||||
PKG_VERSION=$(node -p "require('./package.json').version")
|
||||
PKG_NAME=$(node -p "require('./package.json').name")
|
||||
|
||||
# Exit 0 when npm has ${PKG_NAME}@$1, 1 when it definitely does not (no output, or
|
||||
# npm's E404). Any other answer is a registry failure: it fails the step instead of
|
||||
# reading as "not published" (the `npm view ... || true` it replaces did).
|
||||
npm_has_version() {
|
||||
local out err rc=0
|
||||
err=$(mktemp)
|
||||
out=$(npm view "${PKG_NAME}@$1" version 2>"$err") || rc=$?
|
||||
if [ "$rc" -eq 0 ] && [ "$out" = "$1" ]; then rm -f "$err"; return 0; fi
|
||||
if [ "$rc" -eq 0 ] && [ -z "$out" ]; then rm -f "$err"; return 1; fi
|
||||
if [ "$rc" -ne 0 ] && grep -q 'code E404' "$err"; then rm -f "$err"; return 1; fi
|
||||
echo "::error::npm view ${PKG_NAME}@$1 was inconclusive (exit $rc): ${out}" >&2
|
||||
cat "$err" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 1) Skip if current version is not yet published (no bump needed)
|
||||
PUBLISHED="$(npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null || true)"
|
||||
if [ "$PUBLISHED" != "$PKG_VERSION" ]; then
|
||||
if ! npm_has_version "$PKG_VERSION"; then
|
||||
echo "✅ ${PKG_NAME}@${PKG_VERSION} is new — no bump needed."
|
||||
echo "bumped=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
@@ -546,9 +560,26 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 4) Auto-bump patch version
|
||||
npm version patch --no-git-tag-version --allow-same-version
|
||||
NEW_VERSION=$(node -p "require('./package.json').version")
|
||||
# 4) Auto-bump the patch version past every version npm already has. The bump only
|
||||
# exists in this job's workspace (the committed manifest keeps the old version), so a
|
||||
# later release with plugin changes starts from the same manifest: a single bump
|
||||
# recomputed a version an earlier release had published, and the publish step below
|
||||
# skipped it without publishing the change.
|
||||
# Every candidate is looked up before it can be selected; 50 taken candidates fail.
|
||||
NEW_VERSION=""
|
||||
for _ in $(seq 1 50); do
|
||||
npm version patch --no-git-tag-version --allow-same-version
|
||||
CANDIDATE=$(node -p "require('./package.json').version")
|
||||
if ! npm_has_version "$CANDIDATE"; then
|
||||
NEW_VERSION="$CANDIDATE"
|
||||
break
|
||||
fi
|
||||
echo "${PKG_NAME}@${CANDIDATE} is already on npm — bumping again."
|
||||
done
|
||||
if [ -z "$NEW_VERSION" ]; then
|
||||
echo "::error::${PKG_NAME}: no unpublished patch version within 50 bumps of ${PKG_VERSION}."
|
||||
exit 1
|
||||
fi
|
||||
echo "bumped=true" >> "$GITHUB_OUTPUT"
|
||||
echo "📦 Auto-bumped ${PKG_NAME} from ${PKG_VERSION} to ${NEW_VERSION}"
|
||||
|
||||
@@ -612,9 +643,23 @@ jobs:
|
||||
PKG_VERSION=$(node -p "require('./package.json').version")
|
||||
PKG_NAME=$(node -p "require('./package.json').name")
|
||||
|
||||
# Exit 0 when npm has ${PKG_NAME}@$1, 1 when it definitely does not (no output, or
|
||||
# npm's E404). Any other answer is a registry failure: it fails the step instead of
|
||||
# reading as "not published" (the `npm view ... || true` it replaces did).
|
||||
npm_has_version() {
|
||||
local out err rc=0
|
||||
err=$(mktemp)
|
||||
out=$(npm view "${PKG_NAME}@$1" version 2>"$err") || rc=$?
|
||||
if [ "$rc" -eq 0 ] && [ "$out" = "$1" ]; then rm -f "$err"; return 0; fi
|
||||
if [ "$rc" -eq 0 ] && [ -z "$out" ]; then rm -f "$err"; return 1; fi
|
||||
if [ "$rc" -ne 0 ] && grep -q 'code E404' "$err"; then rm -f "$err"; return 1; fi
|
||||
echo "::error::npm view ${PKG_NAME}@$1 was inconclusive (exit $rc): ${out}" >&2
|
||||
cat "$err" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 1) Skip if current version is not yet published (no bump needed)
|
||||
PUBLISHED="$(npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null || true)"
|
||||
if [ "$PUBLISHED" != "$PKG_VERSION" ]; then
|
||||
if ! npm_has_version "$PKG_VERSION"; then
|
||||
echo "✅ ${PKG_NAME}@${PKG_VERSION} is new — no bump needed."
|
||||
echo "bumped=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
@@ -638,9 +683,26 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 4) Auto-bump patch version
|
||||
npm version patch --no-git-tag-version --allow-same-version
|
||||
NEW_VERSION=$(node -p "require('./package.json').version")
|
||||
# 4) Auto-bump the patch version past every version npm already has. The bump only
|
||||
# exists in this job's workspace (the committed manifest keeps the old version), so a
|
||||
# later release with plugin changes starts from the same manifest: a single bump
|
||||
# recomputed a version an earlier release had published, and the publish step below
|
||||
# skipped it without publishing the change.
|
||||
# Every candidate is looked up before it can be selected; 50 taken candidates fail.
|
||||
NEW_VERSION=""
|
||||
for _ in $(seq 1 50); do
|
||||
npm version patch --no-git-tag-version --allow-same-version
|
||||
CANDIDATE=$(node -p "require('./package.json').version")
|
||||
if ! npm_has_version "$CANDIDATE"; then
|
||||
NEW_VERSION="$CANDIDATE"
|
||||
break
|
||||
fi
|
||||
echo "${PKG_NAME}@${CANDIDATE} is already on npm — bumping again."
|
||||
done
|
||||
if [ -z "$NEW_VERSION" ]; then
|
||||
echo "::error::${PKG_NAME}: no unpublished patch version within 50 bumps of ${PKG_VERSION}."
|
||||
exit 1
|
||||
fi
|
||||
echo "bumped=true" >> "$GITHUB_OUTPUT"
|
||||
echo "📦 Auto-bumped ${PKG_NAME} from ${PKG_VERSION} to ${NEW_VERSION}"
|
||||
|
||||
|
||||
36292
.i18n-state.json
generated
36292
.i18n-state.json
generated
File diff suppressed because it is too large
Load Diff
@@ -963,7 +963,8 @@ export async function collectCatalog(
|
||||
apiFormat: opts.apiFormat,
|
||||
});
|
||||
if (servedCombo) {
|
||||
mapped.name = buildModelDisplayName({ rawId: mapped.name, isCombo: true });
|
||||
// From the raw id: the mapper's name already carries the provider prefix.
|
||||
mapped.name = buildModelDisplayName({ rawId: entry.id, isCombo: true });
|
||||
}
|
||||
const enrichmentEntry = lookupEnrichment(
|
||||
entry.id,
|
||||
|
||||
@@ -579,6 +579,12 @@ export function applyEnrichment(
|
||||
typeof context.rawModelId === "string" && context.rawModelId.length > 0
|
||||
? context.rawModelId
|
||||
: "";
|
||||
// An entry with no name (pricing or free-tier data only) names the model from
|
||||
// its id. Without a raw id from the caller (the /api/combos pass) that is the
|
||||
// model's own id, else the builder gets nothing and renders `combo - `.
|
||||
const hasEnrichmentName =
|
||||
typeof enrichment.name === "string" && enrichment.name.trim().length > 0;
|
||||
const nameSourceId = rawModelId || (hasEnrichmentName ? "" : model.id);
|
||||
let providerDisplayName = enrichment.providerDisplayName;
|
||||
if (
|
||||
(!providerDisplayName || providerDisplayName.trim().length === 0) &&
|
||||
@@ -588,7 +594,7 @@ export function applyEnrichment(
|
||||
providerDisplayName = rawModelId.slice(0, rawModelId.indexOf("/"));
|
||||
}
|
||||
const built = buildModelDisplayName({
|
||||
rawId: rawModelId,
|
||||
rawId: nameSourceId,
|
||||
enrichmentName: enrichment.name,
|
||||
providerAlias: enrichment.providerAlias,
|
||||
providerDisplayName,
|
||||
|
||||
@@ -318,8 +318,12 @@ export function buildModelDisplayName(params: ModelDisplayNameParams): string {
|
||||
|
||||
// Split off a leading provider prefix (`Provider - rest`) when present.
|
||||
let work = rawBase.trim();
|
||||
let prefixWasFree = false;
|
||||
const dashMatch = work.match(/^(.+?)\s+-\s+(.+)$/);
|
||||
if (dashMatch) {
|
||||
// A free marker on the name's provider prefix (`[Free] Cloudflare - ...`)
|
||||
// still marks the entry free, even when the label comes from elsewhere.
|
||||
prefixWasFree = stripFreeMarkers(dashMatch[1]!).wasFree;
|
||||
if (!provider) provider = dashMatch[1]!.trim();
|
||||
// Remove a leading [Free] from provider if present.
|
||||
const pm = stripFreeMarkers(provider);
|
||||
@@ -348,7 +352,7 @@ export function buildModelDisplayName(params: ModelDisplayNameParams): string {
|
||||
// Free markers.
|
||||
const { text: cleanedModel, wasFree } = stripFreeMarkers(work);
|
||||
const model = cleanedModel.length > 0 ? cleanedModel : work;
|
||||
const isFree = !!params.isFree || wasFree;
|
||||
const isFree = !!params.isFree || wasFree || prefixWasFree;
|
||||
|
||||
if (
|
||||
editor &&
|
||||
@@ -454,7 +458,10 @@ export function disambiguateDisplayNames(
|
||||
for (const entry of entries) {
|
||||
let name = renamed.get(entry.id) ?? entry.name;
|
||||
if (globalSeen.has(name)) {
|
||||
name = `${entry.name} (${entry.id})`;
|
||||
// The key suffix can itself be a name already kept: count up until free.
|
||||
const base = `${entry.name} (${entry.id})`;
|
||||
name = base;
|
||||
for (let n = 2; globalSeen.has(name); n++) name = `${base} (${n})`;
|
||||
renamed.set(entry.id, name);
|
||||
}
|
||||
globalSeen.add(name);
|
||||
|
||||
@@ -988,10 +988,13 @@ describe("disambiguation stays unique across groups", () => {
|
||||
{ id: "b/m", owned_by: "b", context_length: 1000 },
|
||||
{ id: "c/keep", owned_by: "c", context_length: 1000 },
|
||||
]);
|
||||
// One shared provider label, so the raw names really collide across groups:
|
||||
// `P - X` twice (renamed by route to `P - X (a)` / `P - X (b)`) and a kept
|
||||
// `P - X (a)` that the first route rename lands on.
|
||||
const enrichment = new Map([
|
||||
["a/m", { name: "X" }],
|
||||
["b/m", { name: "X" }],
|
||||
["c/keep", { name: "X (a)" }],
|
||||
["a/m", { name: "X", providerDisplayName: "P" }],
|
||||
["b/m", { name: "X", providerDisplayName: "P" }],
|
||||
["c/keep", { name: "X (a)", providerDisplayName: "P" }],
|
||||
]);
|
||||
const collected = await collectCatalog(
|
||||
{ ...baseOpts, enrichment },
|
||||
@@ -1003,6 +1006,12 @@ describe("disambiguation stays unique across groups", () => {
|
||||
collected.entries.get("omniroute/c/keep")?.name,
|
||||
];
|
||||
for (const name of names) assert.ok(name, "every entry keeps a published name");
|
||||
assert.notEqual(names[0], "P - X", "the shared name is disambiguated by route");
|
||||
assert.notEqual(names[1], "P - X", "the shared name is disambiguated by route");
|
||||
assert.ok(
|
||||
names.includes("P - X (a)"),
|
||||
`the cross-group collision on P - X (a) is reached: ${JSON.stringify(names)}`
|
||||
);
|
||||
assert.equal(
|
||||
new Set(names).size,
|
||||
3,
|
||||
|
||||
@@ -186,6 +186,37 @@ describe("collectCatalog combo source", () => {
|
||||
assert.equal(collected.entries.has("omniroute/Mixed"), false, "a paid member drops the combo");
|
||||
assert.equal(collected.counts.combos, 1);
|
||||
});
|
||||
|
||||
// CodeRabbit R5 (#19191): a /v1/models combo row is named from its raw id, not
|
||||
// from the mapper's already-formatted `omniroute - <id>` name.
|
||||
it("models: a combo row with no overlay entry is named combo - <id>", async () => {
|
||||
const collected = await quiet(() =>
|
||||
collectCatalog({ ...baseOpts, combosSource: "models" }, {
|
||||
models: async () => [{ id: "m1" }, { id: "My Combo", owned_by: "combo" }],
|
||||
} as never)
|
||||
);
|
||||
assert.equal(collected.entries.get("omniroute/My Combo")?.name, "combo - My Combo");
|
||||
});
|
||||
|
||||
// CodeRabbit R2 (#19191): an /api/combos overlay entry with pricing but no name
|
||||
// must not blank the combo name to `combo - `.
|
||||
it("default: a combo overlay entry without a name keeps the combo name", async () => {
|
||||
const collected = await quiet(() =>
|
||||
collectCatalog(
|
||||
{
|
||||
...baseOpts,
|
||||
enrichment: new Map([["x", { pricing: { input: 1, output: 2 } }]]) as never,
|
||||
},
|
||||
{
|
||||
models: async () => [{ id: "m1" }],
|
||||
combos: async () => [{ id: "x", name: "Duo", models: [{ kind: "model", model: "m1" }] }],
|
||||
} as never
|
||||
)
|
||||
);
|
||||
const duo = collected.entries.get("omniroute/Duo");
|
||||
assert.equal(duo?.name, "combo - Duo");
|
||||
assert.equal(duo?.cost.input, 1, "the pricing overlay still applies");
|
||||
});
|
||||
});
|
||||
|
||||
function setupCtx(options: Record<string, unknown>) {
|
||||
|
||||
@@ -49,6 +49,16 @@ describe("the enrichment overlay reaches the picker", () => {
|
||||
assert.equal(m.name, "combo - Combo Fast");
|
||||
});
|
||||
|
||||
it("keeps a combo's name when its overlay entry carries no name (CodeRabbit R2)", () => {
|
||||
const m = applyEnrichment(
|
||||
model("Duo", "combo - Duo"),
|
||||
{ pricing: { input: 1, output: 2 }, freeType: "recurring-monthly" as const },
|
||||
{ isCombo: true }
|
||||
);
|
||||
assert.equal(m.name, "combo - Duo");
|
||||
assert.equal(m.cost.input, 1);
|
||||
});
|
||||
|
||||
it("still overlays pricing", () => {
|
||||
const m = applyEnrichment(model("x"), { pricing: { input: 3, output: 15 } });
|
||||
assert.equal(m.cost.input, 3);
|
||||
|
||||
@@ -129,6 +129,21 @@ describe("compact model names", () => {
|
||||
assert.equal(m.name, "🆓 Nvidia - Nemotron 3 Ultra");
|
||||
});
|
||||
|
||||
it("keeps a free marker carried on the provider prefix (CodeRabbit R4)", () => {
|
||||
assert.equal(
|
||||
buildModelDisplayName({
|
||||
rawId: "cf/open-m",
|
||||
enrichmentName: "[Free] Cloudflare - Open Model",
|
||||
}),
|
||||
"🆓 Cloudflare - Open Model"
|
||||
);
|
||||
const m = applyEnrichment(model("cf/open-m", "cf/open-m"), {
|
||||
name: "[Free] Cloudflare - Open Model",
|
||||
providerDisplayName: "Cloudflare",
|
||||
});
|
||||
assert.equal(m.name, "🆓 Cloudflare - Open Model");
|
||||
});
|
||||
|
||||
it("uses a suffix marker for free entries and none otherwise", () => {
|
||||
const free = buildModelDisplayName({
|
||||
rawId: "opencode-go/beam-free",
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import { formatFreeBudget, type FreeModelFreeType } from "../src/shared/naming.js";
|
||||
import {
|
||||
disambiguateDisplayNames,
|
||||
formatFreeBudget,
|
||||
type FreeModelFreeType,
|
||||
} from "../src/shared/naming.js";
|
||||
|
||||
test("formatFreeBudget: recurring-daily formats tokens/day", () => {
|
||||
assert.equal(
|
||||
@@ -84,3 +88,22 @@ test("formatFreeBudget: uncapped budget has no counters, label only", () => {
|
||||
"(uncapped)"
|
||||
);
|
||||
});
|
||||
|
||||
// CodeRabbit R3 (#19191): the publication-key fallback can itself be a name another
|
||||
// entry already keeps; fallback candidates are checked until one is unused.
|
||||
test("disambiguateDisplayNames: a fallback name that is already taken is not reused", () => {
|
||||
const entries = [
|
||||
{ id: "p/d", name: "X (a) (p/c)" },
|
||||
{ id: "p/a/m", name: "X" },
|
||||
{ id: "p/b/m", name: "X" },
|
||||
{ id: "p/c", name: "X (a)" },
|
||||
];
|
||||
const renamed = disambiguateDisplayNames(entries);
|
||||
const finalNames = entries.map((entry) => renamed.get(entry.id) ?? entry.name);
|
||||
assert.equal(
|
||||
new Set(finalNames).size,
|
||||
entries.length,
|
||||
`published names must be unique: ${JSON.stringify(finalNames)}`
|
||||
);
|
||||
assert.equal(finalNames[0], "X (a) (p/c)", "an entry that is already unique keeps its name");
|
||||
});
|
||||
|
||||
1213
CHANGELOG.md
1213
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -21,6 +21,7 @@ import { t } from "../i18n.mjs";
|
||||
import { resolveDataDir } from "../data-dir.mjs";
|
||||
import { resolveActiveContext } from "../contexts.mjs";
|
||||
import { quoteShellArgsForSpawn } from "../utils/winShellArgs.mjs";
|
||||
import { isLoopbackUrl } from "../api.mjs";
|
||||
import {
|
||||
buildClaudeEnv,
|
||||
fetchModelContextWindow,
|
||||
@@ -44,6 +45,41 @@ function getVersionCachePath() {
|
||||
return join(getFccDataDir(), "version-cache.json");
|
||||
}
|
||||
|
||||
// ─── Plain-HTTP guard for the credential ─────────────────────────────────────
|
||||
|
||||
/** Opt-in for sending the key over plain HTTP to a non-loopback host. */
|
||||
export const ALLOW_INSECURE_REMOTE_ENV = "OMNIROUTE_ALLOW_INSECURE_REMOTE";
|
||||
|
||||
/**
|
||||
* Why fcc-claude must not send `authToken` to `baseUrl`, or null when it may.
|
||||
*
|
||||
* The bearer key goes to the catalog (GET /v1/models), to /v1/messages in
|
||||
* --test mode and to claude itself, so a non-loopback `http://` target would
|
||||
* carry it in plaintext (CWE-319). Loopback HTTP, HTTPS and requests without
|
||||
* a credential are fine. An operator on a network they trust (a LAN server at
|
||||
* http://192.168.x.y:20128) opts in with OMNIROUTE_ALLOW_INSECURE_REMOTE=1;
|
||||
* the variable must come from the shell or the data-dir `.env`, since a `.env`
|
||||
* in the working directory cannot set it (bin/cli/utils/untrustedCwdEnv.mjs).
|
||||
* The message names only the origin: never the key or URL userinfo.
|
||||
*/
|
||||
export function insecureRemoteRefusal(baseUrl, authToken, env = process.env) {
|
||||
if (!authToken || !String(authToken).trim()) return null;
|
||||
let url;
|
||||
try {
|
||||
url = new URL(baseUrl);
|
||||
} catch {
|
||||
return null; // not a URL: every request fails before anything is sent
|
||||
}
|
||||
if (url.protocol !== "http:" || isLoopbackUrl(url.href)) return null;
|
||||
if (/^(1|true)$/i.test(String(env[ALLOW_INSECURE_REMOTE_ENV] ?? "").trim())) return null;
|
||||
const origin = `${url.protocol}//${url.host}`;
|
||||
return (
|
||||
`[fcc-claude] Refusing to send your OmniRoute API key in plaintext to ${origin}: ` +
|
||||
`it is plain http:// and not a loopback address. Use an https:// URL, or, on a ` +
|
||||
`network you trust, set ${ALLOW_INSECURE_REMOTE_ENV}=1 in your shell to allow it.`
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Default fallback chain (FCC style) ──────────────────────────────────────
|
||||
|
||||
const DEFAULT_FALLBACK_MODELS = ["auto/best-coding", "auto/best-chat", "auto/fast"];
|
||||
@@ -163,6 +199,11 @@ export async function* streamMessages(
|
||||
*/
|
||||
export async function runTestCommand(opts = {}) {
|
||||
const { baseUrl, authToken } = resolveLaunchTarget(opts);
|
||||
const refusal = insecureRemoteRefusal(baseUrl, authToken);
|
||||
if (refusal) {
|
||||
console.error(refusal);
|
||||
return 1;
|
||||
}
|
||||
const prompt = opts.test || opts.prompt || "Say hi";
|
||||
const chain = loadFallbackChain(opts);
|
||||
const fallbackModels = chain.models?.slice(1) || [];
|
||||
@@ -299,6 +340,11 @@ export async function runFccClaude(opts = {}, claudeArgs = []) {
|
||||
|
||||
// Normal mode: launch the claude binary.
|
||||
const { baseUrl, authToken } = resolveLaunchTarget(opts);
|
||||
const refusal = insecureRemoteRefusal(baseUrl, authToken);
|
||||
if (refusal) {
|
||||
console.error(refusal);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Health check
|
||||
try {
|
||||
|
||||
@@ -49,7 +49,10 @@ export function buildClaudeEnv(baseEnv, baseUrlOrPort, authToken, opts = {}) {
|
||||
// stays stripped (above) so it can't shadow the Bearer token.
|
||||
env.ANTHROPIC_AUTH_TOKEN = (authToken && String(authToken).trim()) || "omniroute-no-auth";
|
||||
env.CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY = "1";
|
||||
// Window sizing for a model with a known real window: see claudeWindowEnv.
|
||||
// Window sizing for a model with a known real window: see claudeWindowEnv. It owns both
|
||||
// keys, including when it omits one, so an inherited value (--inherit-env) must not survive.
|
||||
delete env.CLAUDE_CODE_AUTO_COMPACT_WINDOW;
|
||||
delete env.CLAUDE_CODE_MAX_CONTEXT_TOKENS;
|
||||
Object.assign(env, claudeWindowEnv(opts.contextWindow));
|
||||
// Profile isolation (Claude Code has no native profiles — CLAUDE_CONFIG_DIR is
|
||||
// the idiomatic mechanism: separate settings/credentials/history/cache per dir).
|
||||
|
||||
@@ -30,7 +30,14 @@ function isBlank(value) {
|
||||
return value === undefined || value === null || String(value).trim() === "";
|
||||
}
|
||||
|
||||
function toAuthSource(targetOpts, baseUrl) {
|
||||
/**
|
||||
* Where the credential a plan launches with comes from. `authToken` is the
|
||||
* credential the target's own resolver returned, so a variable that target
|
||||
* never reads (Codex ignores ANTHROPIC_AUTH_TOKEN) is not reported as the
|
||||
* source of a launch that actually gets the no-auth sentinel.
|
||||
*/
|
||||
function toAuthSource(targetOpts, baseUrl, authToken) {
|
||||
if (isBlank(authToken)) return "none";
|
||||
const explicit =
|
||||
!isBlank(targetOpts.token) || !isBlank(targetOpts.apiKey) || !isBlank(targetOpts["api-key"]);
|
||||
if (explicit) return "option";
|
||||
@@ -144,7 +151,7 @@ async function buildClaudePlan(rawOpts, args = []) {
|
||||
args: spawnArgs,
|
||||
model: merged.model || undefined,
|
||||
envDiff: envPreview(process.env, env),
|
||||
authSource: toAuthSource(rawOpts, baseUrl),
|
||||
authSource: toAuthSource(rawOpts, baseUrl, authToken),
|
||||
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
|
||||
};
|
||||
}
|
||||
@@ -178,7 +185,7 @@ async function buildCodexPlan(rawOpts, args = []) {
|
||||
args: spawnArgs,
|
||||
model: merged.model || undefined,
|
||||
envDiff: envPreview(process.env, env),
|
||||
authSource: toAuthSource(rawOpts, baseUrl),
|
||||
authSource: toAuthSource(rawOpts, baseUrl, authToken),
|
||||
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
|
||||
providerArgs,
|
||||
profileArgs,
|
||||
@@ -345,7 +352,7 @@ async function buildGenericPlan(target, rawOpts, args = []) {
|
||||
args: quoteShellArgsForSpawn(fullArgs, process.platform, commandSpec.shell),
|
||||
model: model || undefined,
|
||||
envDiff: envPreview(process.env, env),
|
||||
authSource: toAuthSource(rawOpts, baseUrl),
|
||||
authSource: toAuthSource(rawOpts, baseUrl, authToken),
|
||||
commandDisplay: describeCommand(commandSpec.command, commandSpec.shell),
|
||||
modelArgs,
|
||||
configOverlay:
|
||||
|
||||
@@ -181,13 +181,17 @@ async function terminatePids(allPids, { kill, running, wait, identify }) {
|
||||
// A listener on the port is only stopped when its command line names OmniRoute (same proof
|
||||
// as the pid-file path). A foreign or unreadable one is someone else's server: leave it alone
|
||||
// and do not report the port free.
|
||||
// A "gone" pid had no process behind it when classified: nothing to signal.
|
||||
const pids = [];
|
||||
let skipped = 0;
|
||||
for (const p of allPids) {
|
||||
const identity = identify(p);
|
||||
if (identity === "ours" || identity === "gone") pids.push(p);
|
||||
else console.error(`Skipped PID ${p} on the port: it does not look like an OmniRoute process.`);
|
||||
if (identity === "ours") pids.push(p);
|
||||
else if (identity !== "gone") {
|
||||
skipped++;
|
||||
console.error(`Skipped PID ${p} on the port: it does not look like an OmniRoute process.`);
|
||||
}
|
||||
}
|
||||
const skipped = allPids.length - pids.length;
|
||||
if (pids.length === 0) return skipped === 0;
|
||||
for (const p of pids) {
|
||||
try {
|
||||
@@ -195,11 +199,23 @@ async function terminatePids(allPids, { kill, running, wait, identify }) {
|
||||
} catch {}
|
||||
}
|
||||
await wait(1000);
|
||||
// A pid that exited during the wait can already belong to another process: prove it is still
|
||||
// OmniRoute before SIGKILL. A foreign or gone survivor means ours exited; an unproven one
|
||||
// cannot be counted as stopped.
|
||||
const escalated = [];
|
||||
let unproven = false;
|
||||
for (const p of pids) {
|
||||
try {
|
||||
if (running(p)) kill(p, "SIGKILL");
|
||||
} catch {}
|
||||
if (!running(p)) continue;
|
||||
const identity = identify(p);
|
||||
if (identity === "ours") {
|
||||
try {
|
||||
kill(p, "SIGKILL");
|
||||
} catch {}
|
||||
escalated.push(p);
|
||||
} else if (identity === "unknown") {
|
||||
unproven = true;
|
||||
}
|
||||
}
|
||||
// Confirm the port is free: any PID still alive means we failed.
|
||||
return skipped === 0 && pids.every((p) => !running(p));
|
||||
// Confirm the port is free: any OmniRoute PID still alive means we failed.
|
||||
return skipped === 0 && !unproven && escalated.every((p) => !running(p));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { resolveDataDir } from "../data-dir.mjs";
|
||||
|
||||
@@ -45,6 +45,7 @@ export function classifyPidIdentity(pid, deps = {}) {
|
||||
const run = deps.execFileSync || execFileSync;
|
||||
try {
|
||||
let commandLine;
|
||||
let argv = null;
|
||||
if (platform === "win32") {
|
||||
// Pid goes in by env, never into the script (Hard Rule #13). One retry:
|
||||
// a cold PowerShell start can time out once.
|
||||
@@ -78,9 +79,11 @@ export function classifyPidIdentity(pid, deps = {}) {
|
||||
} else {
|
||||
const read = deps.readFileSync || ((file) => readFileSync(file, "utf8"));
|
||||
commandLine = String(read(`/proc/${pid}/cmdline`));
|
||||
// NUL-separated argv; process.title rewrites it in place and pads it with NUL bytes.
|
||||
argv = commandLine.split("\0").filter(Boolean);
|
||||
}
|
||||
// process.title rewrites cmdline in place and pads it with NUL bytes.
|
||||
return OMNIROUTE_COMMAND.test(String(commandLine).replaceAll("\0", " ")) ? "ours" : "foreign";
|
||||
const isFile = deps.isFile || isRegularFile;
|
||||
return commandIdentity(argv ?? splitCommandLine(String(commandLine)), argv === null, isFile);
|
||||
} catch (err) {
|
||||
// No /proc/<pid> entry while procfs is mounted: the process is gone, so
|
||||
// there is nothing to signal. Without procfs, "gone" cannot be told from
|
||||
@@ -90,8 +93,115 @@ export function classifyPidIdentity(pid, deps = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
// Install dirs like "omniroute-main" or "my-omniroute" are legitimate, so match the substring.
|
||||
function isRegularFile(file) {
|
||||
try {
|
||||
return statSync(file).isFile();
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Install dirs like "omniroute-main" or "my-omniroute" are legitimate, so match the substring,
|
||||
// but only in the executable, the script a JS runtime runs, or the process title ("omniroute
|
||||
// (v16.2.9)" is argv[0] after the rename). An argument such as --log=/tmp/omniroute.log proves
|
||||
// nothing about the process.
|
||||
const OMNIROUTE_COMMAND = /omniroute/i;
|
||||
const JS_RUNTIME = /(?:^|[\\/])(?:node|nodejs|bun)(?:\d+(?:\.\d+)*)?(?:\.exe)?$/i;
|
||||
const EXECUTABLE_END = /(?:^|[\\/])(?:(?:node|nodejs|bun)(?:\d+(?:\.\d+)*)?|[^\\/]+\.exe)$/i;
|
||||
const SCRIPT_END = /\.[cm]?[jt]s$/i;
|
||||
// Runtime options that take their value as the next argument.
|
||||
const RUNTIME_VALUE_OPTIONS = new Set([
|
||||
"-r",
|
||||
"--require",
|
||||
"--import",
|
||||
"--loader",
|
||||
"--experimental-loader",
|
||||
"--preload",
|
||||
"-C",
|
||||
"--conditions",
|
||||
"--env-file",
|
||||
"--title",
|
||||
"--input-type",
|
||||
]);
|
||||
// Bare runtime options known to take no separate value. Exact names only: no prefix is safe
|
||||
// (--trace-event-file-pattern, --experimental-sea-config and --inspect-port all take one), and
|
||||
// any other bare option may take the next token as its value, so what follows it cannot be
|
||||
// proven to be the script. `--opt=value` forms carry their value and are always skipped.
|
||||
// OmniRoute spawns itself with --dns-result-order=, --max-old-space-size= (both `=` forms),
|
||||
// --import / --preload <path> (RUNTIME_VALUE_OPTIONS) and --no-warnings (plugins/loader.ts).
|
||||
const RUNTIME_FLAGS = new Set([
|
||||
"--no-warnings",
|
||||
"--enable-source-maps",
|
||||
"--no-deprecation",
|
||||
"--trace-warnings",
|
||||
"--trace-deprecation",
|
||||
"--trace-uncaught",
|
||||
"--throw-deprecation",
|
||||
"--expose-gc",
|
||||
"--smol",
|
||||
]);
|
||||
const RUNTIME_INLINE_CODE = /^(?:-e|-p|-pe|-ep|--eval|--print)(?:=|$)/;
|
||||
|
||||
// macOS ps and Windows CommandLine give one string. Double quotes group an argument.
|
||||
function splitCommandLine(commandLine) {
|
||||
const tokens = [];
|
||||
for (const match of commandLine.trim().matchAll(/"([^"]*)"?|(\S+)/g)) {
|
||||
tokens.push({ value: match[1] ?? match[2], quoted: match[1] !== undefined });
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
// An unquoted path with a space ("C:\Program Files\nodejs\node.exe", "/Users/me/Application
|
||||
// Support/node") arrives as several tokens, but so does a path followed by an argument
|
||||
// ("/srv/other/server omniroute.js"). Joining is a guess, so it fails closed: a joined path counts
|
||||
// only when it is a real file and no shorter candidate (the first token alone included) is one.
|
||||
// Anything else is `ambiguous`. When no join reaches a recognised end (`isEnd`), the first token
|
||||
// stands alone: it is a prefix of the real path, so a match in it is still sound.
|
||||
function joinPathTokens(tokens, start, isEnd, joinable, isFile) {
|
||||
const first = tokens[start];
|
||||
const single = { value: first.value, next: start + 1, ambiguous: false };
|
||||
if (!joinable || first.quoted || isEnd(first.value)) return single;
|
||||
const shorter = [first.value];
|
||||
let value = first.value;
|
||||
for (let k = start + 1; k < tokens.length; k++) {
|
||||
const token = tokens[k];
|
||||
if (token.quoted || /^(?:[-/\\]|[A-Za-z]:)/.test(token.value)) break;
|
||||
value += ` ${token.value}`;
|
||||
if (isEnd(value)) {
|
||||
const proven = isFile(value) && !shorter.some((candidate) => isFile(candidate));
|
||||
return { value, next: k + 1, ambiguous: !proven };
|
||||
}
|
||||
shorter.push(value);
|
||||
}
|
||||
return single;
|
||||
}
|
||||
|
||||
// `joinable`: the tokens came from a space-joined string, not an exact argv.
|
||||
function commandIdentity(rawTokens, joinable, isFile) {
|
||||
const tokens = rawTokens.map((t) => (typeof t === "string" ? { value: t, quoted: false } : t));
|
||||
if (tokens.length === 0) return "foreign";
|
||||
const exe = joinPathTokens(tokens, 0, (v) => EXECUTABLE_END.test(v), joinable, isFile);
|
||||
if (exe.ambiguous) return "unknown";
|
||||
if (OMNIROUTE_COMMAND.test(exe.value)) return "ours";
|
||||
if (!JS_RUNTIME.test(exe.value)) return "foreign";
|
||||
for (let i = exe.next; i < tokens.length; i++) {
|
||||
const arg = tokens[i].value;
|
||||
// Inline code (-e/-p) has no script file to prove anything.
|
||||
if (RUNTIME_INLINE_CODE.test(arg)) return "foreign";
|
||||
if (arg === "--") {
|
||||
if (i + 1 >= tokens.length) return "foreign";
|
||||
i++;
|
||||
} else if (arg.startsWith("-")) {
|
||||
if (RUNTIME_VALUE_OPTIONS.has(arg)) i++;
|
||||
else if (!arg.includes("=") && !RUNTIME_FLAGS.has(arg)) return "unknown";
|
||||
continue;
|
||||
}
|
||||
const script = joinPathTokens(tokens, i, (v) => SCRIPT_END.test(v), joinable, isFile);
|
||||
if (script.ambiguous) return "unknown";
|
||||
return OMNIROUTE_COMMAND.test(script.value) ? "ours" : "foreign";
|
||||
}
|
||||
return "foreign";
|
||||
}
|
||||
|
||||
// The pid in a pid file, or null when none can be signalled safely. A dead pid
|
||||
// is still returned so callers keep their stale-file handling; a live pid that
|
||||
|
||||
@@ -15,14 +15,19 @@ import { isRequireApiKeyValueEnabled } from "../../../src/shared/utils/requireAp
|
||||
* environment can still set every key.
|
||||
*
|
||||
* A key is listed only when no value it accepts can load code, pick a file,
|
||||
* name a remote host, change TLS or relax a security policy. Values are
|
||||
* checked too: ports must be numbers, and locale and time zone names may not
|
||||
* be paths. The ports still decide which local port the CLI talks to, and so
|
||||
* which local listener gets the API key, the context token and the CLI
|
||||
* machine token (`x-omniroute-cli-token`).
|
||||
* name a remote host, pick a local listener, change TLS or relax a security
|
||||
* policy. Values are checked too: locale and time zone names may not be paths.
|
||||
*
|
||||
* PORT, API_PORT and DASHBOARD_PORT are deliberately NOT listed. Without a
|
||||
* base URL from a higher-precedence source the CLI talks to
|
||||
* `http://localhost:<PORT>`, and it attaches the API key, the context token
|
||||
* and the CLI machine token (`x-omniroute-cli-token`) to any loopback
|
||||
* destination without checking which process listens there. A port from this
|
||||
* file would let it hand those credentials to a listener of its choosing
|
||||
* (CodeRabbit I6, CWE-522). The shell, the data-dir `.env` and `--port` can
|
||||
* still set the ports.
|
||||
*/
|
||||
|
||||
const PORT_VALUE = /^[0-9]{1,5}$/;
|
||||
// Locale names such as `en_US.UTF-8` or `de_DE@euro`. glibc reads a name that
|
||||
// contains a slash as a path to locale files, so slashes are not allowed.
|
||||
const LOCALE_VALUE = /^[A-Za-z0-9_.@-]{1,64}$/;
|
||||
@@ -34,22 +39,11 @@ const LOCALE_LIST_VALUE = /^[A-Za-z0-9_.@:-]{1,64}$/;
|
||||
// That also rejects the `:Area/City` form and POSIX rules with `,` or `<>`.
|
||||
const TZ_VALUE = /^[A-Za-z0-9_+-][A-Za-z0-9_+/-]{0,63}$/;
|
||||
const FLAG_VALUE = /^[A-Za-z0-9]{0,16}$/;
|
||||
function isPort(value) {
|
||||
if (!PORT_VALUE.test(value)) return false;
|
||||
const n = Number(value);
|
||||
return n >= 1 && n <= 65535;
|
||||
}
|
||||
|
||||
const PORT_RULE = { check: isPort, expected: "a port number from 1 to 65535" };
|
||||
const LOCALE_RULE = { check: (v) => LOCALE_VALUE.test(v), expected: "a locale name" };
|
||||
const FLAG_RULE = { check: (v) => FLAG_VALUE.test(v), expected: "up to 16 letters or digits" };
|
||||
|
||||
/** Allowed keys, each with the check its value must pass. */
|
||||
const ALLOWED = new Map([
|
||||
// The local ports the server listens on and the CLI talks to.
|
||||
["PORT", PORT_RULE],
|
||||
["API_PORT", PORT_RULE],
|
||||
["DASHBOARD_PORT", PORT_RULE],
|
||||
// The parser the server gate uses, so the file can turn enforcement on but
|
||||
// never off, and a value that already turned it on is not dropped on upgrade.
|
||||
["REQUIRE_API_KEY", { check: isRequireApiKeyValueEnabled, expected: "true, 1 or yes" }],
|
||||
@@ -78,8 +72,8 @@ export function isPlainEnvKey(key) {
|
||||
/**
|
||||
* Why a `.env` in the working directory may not set `key` to `value` (the
|
||||
* parsed value), or null when it may. Names must match exactly: on Linux and
|
||||
* macOS `port=` sets a variable nothing reads, and on Windows it would set
|
||||
* PORT, so a name in another case is skipped on every platform.
|
||||
* macOS `tz=` sets a variable nothing reads, and on Windows it would set
|
||||
* TZ, so a name in another case is skipped on every platform.
|
||||
*
|
||||
* - `{ kind: "name" }`: not an allowed key.
|
||||
* - `{ kind: "case", name }`: an allowed key written in another case.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(video):** connect consented Video Bridge frame drill-down to the request path — already-derived JPEG frames are published through a shared tenant-bound lifecycle only with explicit operator and authenticated per-part consent (raw videos stay out of retention); JSON/SSE responses return bounded opaque handles, Video settings expose independent retention/remote-read controls and aggregate-only usage, and authenticated preview/standard/detail reads, isolated idempotent deletion, cancellation, TTL/quota cleanup and actual-content variant provenance are supported with bounded queries, sanitized errors and the 32 MiB serialized response limit. Defaults remain off; real-model promotion and deployment require separate evidence ([#16074](https://github.com/diegosouzapw/OmniRoute/pull/16074)).
|
||||
@@ -1 +0,0 @@
|
||||
- **fix(providers):** treat TypeSafe (Jev) as a decisions-only provider: a chat request routed to `typesafe` now fails fast with HTTP 400 pointing at `POST /v1/systemone` instead of falling through to the default executor (which targets the OpenAI endpoint with the TypeSafe key), imported or discovered TypeSafe models are never classified as chat models, and Jev aliases get an input-only default price ([#14498](https://github.com/cheaper-inference/OmniRoute/pull/14498), [#13987](https://github.com/cheaper-inference/OmniRoute/issues/13987)) — thanks @seanford
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(systemone):** `POST /v1/systemone` can serve `ollama-local/<model>` decisions models on the local Ollama of the existing `ollama-local` connection (its base URL, default `http://localhost:11434/v1`, never a request field), with Ollama's own limits checked before any upstream call (2–26 candidates per choice/score question, at most 64 questions, no chat sampling fields, raw base64 images only, 64 KiB / 32 MiB body cap); opt-in through the `SYSTEMONE_OLLAMA_LOCAL_BACKEND_ENABLED` feature flag (default off) ([#14667](https://github.com/diegosouzapw/OmniRoute/pull/14667)) — thanks @PixmaNts
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(api-keys):** `/v1/me/status` now reports today's and this week's USD, request and token usage, a `limits[]` list covering every per-key limit (daily/weekly USD usage limits, budgets, token limits, key quota) measured on its own enforcement window, and masked account labels plus cache-first `accountQuotas` limited to the connections the key can reach and the providers the admin chose to share. The endpoint also accepts `x-api-key`. A per-key `anthropicRateLimitHeaders` mode (`auto` / `forward` / `strip`) controls whether pooled accounts' `anthropic-ratelimit-*` and `anthropic-organization-id` headers reach the client; `auto` forwards them only for keys pinned to one shared connection. The API manager gains the matching controls and a per-key details page with usage, limits, account quotas and editors for token limits and key quota ([#14771](https://github.com/diegosouzapw/OmniRoute/pull/14771)).
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(usage):** attribute proxied requests to coding-agent sessions and projects for team usage reporting, recording session token counters, priced cost, working directory, and project repo ([#14833](https://github.com/diegosouzapw/OmniRoute/pull/14833)) — thanks @fouadSalkini
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(api):** add `/v1/me/sessions` self-service API key endpoints to list and inspect agent sessions with project, client, date, and sorting filters ([#14840](https://github.com/diegosouzapw/OmniRoute/pull/14840)) — thanks @fouadSalkini
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(api):** per-key `anthropicRateLimitHeaders` policy to forward or strip upstream Anthropic account-identity and quota headers on both streaming and non-streaming responses, preserving legacy forwarding by default ([#14862](https://github.com/diegosouzapw/OmniRoute/pull/14862)) — thanks @fouadSalkini
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(chatgpt):** Add the official "Sign in with ChatGPT" provider (`chatgpt`): dynamic registration with PKCE, live account model discovery, inference through the public Responses API and refresh with `earliest_refresh_at` — separate from `codex` and `chatgpt-web`. Routing fails closed to the registration that advertises the model; the ChatGPT catalog keeps its own owner and never inherits Cursor `auto*` aliases. ([#15201](https://github.com/diegosouzapw/OmniRoute/pull/15201) — thanks @JxnLexn)
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(routing):** new `jev` combo strategy — you order the providers, one TypeSafe System One `choice` call admits the winner plus up to 4 fallbacks (options at or above 0.15 confidence) for each request; a missing key, timeout or low confidence falls open to your own order, live session pins skip the call, and the combo editor shows a privacy note because the latest user message is sent to TypeSafe. The TypeSafe call is opt-in through the `COMBO_JEV_STRATEGY_ENABLED` feature flag (default off): a stored TypeSafe key alone never sends traffic, and with the flag off a jev combo keeps your order ([#15279](https://github.com/diegosouzapw/OmniRoute/pull/15279)) — thanks @miguelenes
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(sse):** Agentic pipelines detect repeated tool rounds with unchanged, call-matched results and consecutive failed rounds across native protocols, then return control to the planner. Incomplete or ambiguous parallel rounds do not falsely stop execution ([#15420](https://github.com/diegosouzapw/OmniRoute/pull/15420)) — thanks @potatosips.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(sse):** Agentic pipelines support opt-in context compaction with per-model character budgets for the planner and each executor fallback, preserved instructions and active tool boundaries, and pre-dispatch oversize rejection. Exact incremental size accounting avoids repeated whole-history serialization; structured screenshot results remain intact ([#15421](https://github.com/diegosouzapw/OmniRoute/pull/15421)) — thanks @potatosips.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(intelligence):** the `models_dev_tier` intelligence source is now persisted (rebuilt after every capabilities sync and on demand via `POST /api/intelligence/sync {"rebuildTier": true}`), `user_override` entries get a management-authed `POST`/`DELETE /api/intelligence/overrides` API, and `GET /api/intelligence/sync` reports per-source health in `sourcesDetail` ([#15906](https://github.com/cheaper-inference/OmniRoute/pull/15906) — thanks @pizzav-xyz)
|
||||
@@ -1 +0,0 @@
|
||||
- Add an explicit per-account Codex quota query beside Quota, available even when quota details are hidden, without consuming reset credits. Distinguish current, partial, stale and failed observations; prevent duplicate requests and reconcile the account list without claiming that a cooldown was released. Backend recovery diagnostics and automatic recovery validation remain separate work for #16161.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** set a model's context window when adding a custom model and from the catalog model list of native providers, so a model whose window the catalog does not know yet no longer falls back to 128k; a context-only override no longer turns a catalog model into a custom one ([#16178](https://github.com/diegosouzapw/OmniRoute/pull/16178))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(usage):** report provider-reported cache-read tokens in usage analytics and retained daily summaries, with partial-coverage indicators for legacy or filtered history while preserving billing calculations ([#16452](https://github.com/diegosouzapw/OmniRoute/pull/16452)) — thanks @KiaroSama
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(proxy):** report per-proxy and aggregate application-payload upload and download traffic, including retry attempts and incomplete transfers, without presenting payload counts as wire traffic or billing measurements ([#16455](https://github.com/diegosouzapw/OmniRoute/pull/16455)) — thanks @KiaroSama
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(gemini-web):** add opt-in `gemini-4-argon` model support to the `gemini-web` provider registry with UI mode selection and verification descriptor; off by default until its selectors are checked live, enable with `OMNIROUTE_GEMINI_WEB_ARGON_ENABLED=1` ([#16573](https://github.com/diegosouzapw/OmniRoute/pull/16573))
|
||||
@@ -1 +0,0 @@
|
||||
- Use registered local-provider URLs for model discovery and synchronized embedding routes, and align Docker Model Runner's default with its engine-neutral OpenAI endpoint. Docker Model Runner embedding requests now accept keyless connections while preserving configured credentials and per-model capability checks. (#16670)
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(systemone):** `POST /v1/systemone` can serve TypeSafe Jev and Cloudflare Clef / Clef-flash on Cloudflare Workers AI through the existing `cloudflare-ai` connection (`cloudflare-ai/jev`, `cloudflare-ai/clef`, `cloudflare-ai/clef-flash`, alias `cf/`), as a new `systemOneRegistry` backend, opt-in through the `SYSTEMONE_CLOUDFLARE_BACKEND_ENABLED` feature flag (default off) ([#16676](https://github.com/diegosouzapw/OmniRoute/pull/16676)) — thanks @xiaoyaner0201
|
||||
@@ -1 +0,0 @@
|
||||
- feat(codex): add global and per-connection Ultrafast defaults scoped to GPT-6 Astra and GPT-6.1 Sol, while preserving explicit request and API-key precedence. (#16678)
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(mitm):** Antigravity MITM can map Claude Sonnet 5.5 / Opus 5.5 (low/medium/high tiers) to OmniRoute routes ([#16709](https://github.com/diegosouzapw/OmniRoute/pull/16709)) — thanks @lmortezal
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(images):** Antigravity image edits accept multiple reference images (data URL or raw base64; remote URLs stay rejected), each forwarded as its own inline part; invalid references fail fast with a 400 and text-only answers surface as an error ([#16731](https://github.com/diegosouzapw/OmniRoute/pull/16731)) — thanks @yheiakadylan
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(resilience):** dashboard editor for operator error cooldown rules, optional status/match conditions, and an opt-in per-provider catch-all cooldown that never shortens a longer upstream Retry-After/reset hint ([#16734](https://github.com/diegosouzapw/OmniRoute/pull/16734)) — thanks @zyizyiz
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** "New models" inbox — model sync records each provider's listing (first sync seeds a baseline) and the Providers toolbar shows newly added models with an unread badge, grouped by provider, with mark-as-read ([#16864](https://github.com/diegosouzapw/OmniRoute/pull/16864)) — thanks @ErfanBagheri404
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** `opencode-server` provider — a native executor for the opencode CLI's local headless server (`opencode serve`) that translates OpenAI chat/Responses requests to opencode sessions/parts with streaming, tool-call envelope support; the server is started from the dashboard (local-only `/api/services/opencode-server/{status,start,stop}`) or with `opencode serve`, never from a chat request; only the server URL is a dashboard setting, the CLI binary is env-only (`OPENCODE_SERVER_BIN`) and the spawned server gets a minimal environment; it speaks the opencode v1 server API, and an opencode 2.x server is detected and answered with a clear "unsupported opencode server version" error instead of being treated as healthy ([#16995](https://github.com/cheaper-inference/OmniRoute/pull/16995)) — thanks @cmbergamo
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** Added EmpirioLabs AI (`empiriolabs`) as an OpenAI-compatible API-key provider (`https://api.empiriolabs.ai/v1`), with live model discovery limited to chat models and API key checks against the authenticated `/v1/account/usage` endpoint ([#17209](https://github.com/cheaper-inference/OmniRoute/pull/17209), [#19316](https://github.com/cheaper-inference/OmniRoute/pull/19316)) — thanks @Adam-Dalloul
|
||||
@@ -1,4 +0,0 @@
|
||||
- **feat(providers):** add the MiniMax Code provider — OmniRoute can now route chat completions through the managed MiniMax subscription gateway under the `minimax-code` / `mmcode` alias. The gateway path reads the local refresh token of the user's own MiniMax Code profile (`~/.minimax/auth/prod/<region>/mcode-public/auth.json`) and rewrites the auth files of that profile when the account rotates the credential, so the CLI and the local agent pick the rotated credential up on their next session; OmniRoute does not persist a separate provider credential in its connection database. The transport speaks the native tool protocol, so a request that carries client tools comes back as `tool_calls` for the client to execute, and a refusal of the gateway keeps its own status instead of being renamed into an outage of the model ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
|
||||
- **feat(oauth):** the MiniMax Code provider can now be signed in from the dashboard — the provider page offers the MiniMax account device-code flow (RFC 8628 + S256-PKCE), the panel shows the verification URL and the code to confirm, and the credential that comes back is written into the local MiniMax Code profile, so the CLI and the local agent pick it up on their next session; the dashboard connection row stores no access or refresh token; the provider itself stays a no-auth provider: the dashboard connection is the account entry, the local profile is the credential ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
|
||||
- **fix(sse):** refuse an oversized MiniMax Code request with a request-scoped 413 — a request that did not fit the ceiling of the managed gateway was refused with a status that the combo layer renamed into a 502, and a 502 is in the model-lockout list, so one request that was too large took the MiniMax leg out of every combo for minutes and the next request answered 503; the refusal is now a 413 marked `invalid_request_error`, which is a property of the request and never of the model ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
|
||||
- **fix(sse):** the MiniMax Code executor answers 499 while the instance is draining — a graceful shutdown tears the transport down under the requests that are still in flight, so the failure is evidence about our own shutdown and not about the health of the provider, but a 502 said the opposite: it is in the model-lockout list and in the provider-breaker list, and it is not exempt from the connection cooldown, so the account was written as `unavailable` with a `rateLimitedUntil` into the `provider_connections` table — a state that outlives the restart; the answer during a drain is now 499, the status an aborted caller already gets, which carries `client_disconnected` and is exempt from that cooldown ([#17286](https://github.com/diegosouzapw/OmniRoute/pull/17286))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(usage):** Preserve provider-reported 5-minute and 1-hour cache-write tiers through response translation, call logs, and Cache Health diagnostics; keep legacy unknown tiers explicit and existing quota deductions unchanged; translated Claude and OpenAI usage now also carries `usage.cache_creation` (additive) ([#17307](https://github.com/diegosouzapw/OmniRoute/pull/17307)) — thanks @xiaoyaner0201
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(combo):** new `expiry-first` combo routing strategy (the 21st) — orders targets by the provider-level expiry-first salvage score, using the quota window of the model family each target spends, with a relative tie band and priority order kept for targets without quota telemetry ([#17829](https://github.com/cheaper-inference/OmniRoute/pull/17829)) — thanks @HouMinXi
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(search):** Keenable web search and fetch provider (`keenable-search`, alias `keenable`): keyless by default, with an optional API key that only lifts the per-IP rate limits. Serves `/v1/search` (web only, fallback-only so it never displaces a configured paid provider) and `/v1/web/fetch` (Markdown only, capped at 100,000 characters) ([#17920](https://github.com/diegosouzapw/OmniRoute/pull/17920)) — thanks @ilya-bogin-keenable
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(search):** Add `codex-search` (alias `codex_search`) for web/news search through connected Codex (ChatGPT) accounts. A request that names `codex-search` uses it directly; automatic selection is opt-in behind the `CODEX_SEARCH_AUTO_FALLBACK_ENABLED` flag (default off), which keeps configured search providers first and tries Codex before keyless fallbacks while preserving other providers' order, API-key connection scopes and REST provider blocks. Parse bounded SSE responses into source-grounded rows and log upstream tokens/search counts. Search failures only apply an in-memory search-specific backoff, capped at 60 seconds; they never change shared chat-account health. Searches consume subscription quota, use a 60-second default timeout unless explicitly configured otherwise, and treat time/domain constraints as hints. A search-locked account is skipped in favour of another provider rather than another Codex account. ([#17933](https://github.com/cheaper-inference/OmniRoute/pull/17933)) — thanks @xiaoyaner0201
|
||||
@@ -1 +0,0 @@
|
||||
- Add `POST /api/keys/import` to register caller-supplied API keys with create-key policies, atomic duplicate checks, non-mutating UUID retries, management authentication, and masked responses without restoring unrelated configuration ([#18010](https://github.com/cheaper-inference/OmniRoute/pull/18010)) — thanks @xiaoyaner0201.
|
||||
@@ -1 +0,0 @@
|
||||
- **Dots Studio tool-call markup**: `<dots_function_call>` text blocks (structured `<invoke>` or pure JSON) are converted into real tool calls in the Claude stream translator and the OpenAI response sanitizer, accepting both OpenAI-shaped and Anthropic-shaped client tools (including tools declared without a schema). On the Claude stream an unfinished block, or an opener split mid-tag across chunks, is held back until it completes; on the OpenAI leg the scrub covers non-streaming responses only (streamed OpenAI deltas are passed through unchanged) (#18024).
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** RenderHour provider for images, video and speech — sign in with a RenderHour subscription (OAuth PKCE, paid in plan credits) or paste an `rh_…` API key (paid from the dollar balance); models as `renderhour/<model>` ([#18103](https://github.com/cheaper-inference/OmniRoute/pull/18103) — thanks @sha367)
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** MegaBrain as a dual-auth provider (`megabrain` / `mb`): sign in with a MegaBrain account through Kilo's device-code flow on `api.getmegabrain.com` or paste `mb-v1-…` API keys; requests carry `X-KILOCODE-FEATURE: omniroute` so they run on the account's plan (session and weekly limits, shown in Provider Limits), and a 403 for a model the account cannot pay for (`plan_tier_required`, `extra_usage_off`) locks only that model instead of banning the connection ([#18129](https://github.com/diegosouzapw/OmniRoute/pull/18129))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** add an Import auth modal to the Antigravity CLI (`agy`) provider page: loopback-only 1-click import of the local CLI login (`AGY_TOKEN_FILE`, Linux keyring, `~/.gemini/antigravity-cli/` and AgentControl profiles), single token file/paste and bulk JSON import ([#18181](https://github.com/cheaper-inference/OmniRoute/pull/18181)) — thanks @ziuus
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(plugin):** render picker names as `Provider - Model` with a leading free icon, the free-tier budget kept as a `· 1M tokens/month` suffix, the editor of an explicit `Editor: Model` name in trailing parentheses, and `combo - slug` for combos. Behavior change: `providerTag` no longer removes the provider prefix (the provider is now always shown); `providerTag: false` only drops the editor parenthesis, and configs that matched entries by their old exact name need updating ([#18230](https://github.com/cheaper-inference/OmniRoute/pull/18230)) — thanks @maxmad64bis
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** GitHub Copilot embeddings (`github/text-embedding-3-small`, `github/text-embedding-ada-002`) through the Copilot API with the exchanged Copilot token, refreshed before dispatch ([#18291](https://github.com/cheaper-inference/OmniRoute/pull/18291)) — thanks @AppleVibe, @tmaarcxs
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** the Grok CLI catalog now lists `grok-4.7-build-fast` (Grok 4.7 on Grok Build's faster lane, 500k window, low–xhigh efforts) and `grok-code-fast-1`, both accepted by the Grok Build proxy but missing from the static catalog that the pickers fall back to before live discovery runs ([#18318](https://github.com/cheaper-inference/OmniRoute/pull/18318)) — thanks @cristianob
|
||||
@@ -1,6 +0,0 @@
|
||||
- **feat(dashboard):** the "Import only free models" option now also works on OpenAI/Anthropic-compatible nodes. It keeps only models that the endpoint's own `/models` list marks as free and that have no paid signal; models without free evidence are never imported as free ([#18320](https://github.com/cheaper-inference/OmniRoute/pull/18320)) — thanks @IlyaKhalafi / @maryasov
|
||||
- **fix(providers):** positive discovery prices and explicit paid flags override free catalog entries and Free badges, and remain available through named-provider discovery, cache, and model sync (Refs #17028).
|
||||
- **fix(providers):** retire five unconditionally free Ollama Cloud entries after checking current model prices, document seven free offers with their eligibility limits, and expose Requesty's NVIDIA trial training restriction (Refs #17028).
|
||||
- **fix(providers):** stop advertising OpenCode-only free offers as generally available through the proxy, including cached Free badges, while keeping the provider and normal imports available and leaving uncertain pricing unclassified. Existing free-only connections retain their preference and an explicit opt-out control (Refs #17028).
|
||||
- **fix(providers):** remove static free grants for retired Ollama DeepSeek V4 Flash, Ollama GLM5.1 and Tencent Hunyuan Pro, while preserving normal model imports (Refs #17028).
|
||||
- **fix(providers):** remove static free grants for AINative’s retired `nous-coder` alias and Enterprise-tier `deepseek-r1`, preserving normal imports (Refs #17028).
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** the Quota Tracker provider order now follows the operator across browsers (saved as `settings.quotaProviderOrder` through `PATCH /api/settings`, with local storage kept as the cache), and the Full layout's provider sections get the same drag grips and "Restore default order" action as the overview; display-only, connection priority is never touched ([#18344](https://github.com/cheaper-inference/OmniRoute/pull/18344)) — thanks @ape1121
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(usage):** The Cursor Quota card shows per-model API tokens (input, output, cache read/write) and the cost Cursor billed for the current cycle, fetched fail-open so the existing % bars render unchanged when that call fails ([#18346](https://github.com/cheaper-inference/OmniRoute/pull/18346)) — thanks @AMSeify
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** "Quota check" toggle for OpenAI- and Anthropic-compatible nodes reads a standard `/credits` balance into Provider Limits; `anthropic-compatible-*` keys now use the configurable quota fetcher, which goes through the SSRF-guarded outbound fetch ([#18350](https://github.com/cheaper-inference/OmniRoute/pull/18350)) — thanks @MWGE22629
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(audio):** Cloudflare Workers AI Deepgram Nova-3 transcription (`cf/@cf/deepgram/nova-3`) with opt-in speaker diarization and `verbose_json` words, per-speaker segments and `num_speakers` ([#18352](https://github.com/cheaper-inference/OmniRoute/pull/18352)) — thanks @LeandroTechify
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** custom JSON API provider nodes — an OpenAI-compatible node with `apiType: "custom-json"` fills a JSON request template (`{{prompt}}`, `{{messages}}`, `{{model}}`, `{{request.<path>}}`; substitution only) for any JSON business endpoint, reads the reply from a response path and returns it in the client's format; business requests are never replayed (no retry, no account or combo fallback). API-only for now, see `docs/guides/CUSTOM_JSON_API.md` ([#18353](https://github.com/cheaper-inference/OmniRoute/pull/18353)) — thanks @lyccccy
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** add ParalonCloud API-key provider (chat + embeddings) ([#18356](https://github.com/cheaper-inference/OmniRoute/pull/18356)) — thanks @robertjitaru
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** the OpenAI-compatible Add and Edit provider modals offer the **Custom JSON API** type — HTTP method, auth (bearer, API key header or none), a request-template editor with simple fields or full JSON, the response path and a "Send test request" button — validated in the browser with the same schema the server uses ([#18359](https://github.com/cheaper-inference/OmniRoute/pull/18359)) — thanks @lyccccy
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(api-keys):** rolling 5-hour USD budget per API key, enforced next to the daily/weekly limits and reported on the API key endpoints ([#18362](https://github.com/cheaper-inference/OmniRoute/pull/18362)) — thanks @sajjadsaharkhan
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(services):** the in-memory session TTL is now configurable via `OMNIROUTE_SESSION_TTL_MIN` (minutes; default stays 15 and invalid values keep the default) ([#18394](https://github.com/cheaper-inference/OmniRoute/pull/18394)) — thanks @jjxyxsjr
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** Codex connections on the provider page show whether each one is a personal plan or a Business seat, with the ChatGPT workspace name ("· Business · <workspace>", role in the tooltip), and the plan badge reads "Business Pro Lite" instead of `self_serve_business_prolite`. The usage sync reads the workspace from ChatGPT's accounts endpoint at most once a week per connection, after a successful usage fetch and with a 15 s timeout; until then the kind falls back to the plan type ([#18412](https://github.com/cheaper-inference/OmniRoute/pull/18412) — thanks @feci).
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(auto-combo):** the reset-aware no-quota floor score is now a per-combo config field (`resetAwareNoQuotaFloor`, default stays 0.5) instead of a hardcoded midpoint ([#18435](https://github.com/cheaper-inference/OmniRoute/pull/18435)) — thanks @jjxyxsjr
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(sse):** a `STREAM_READINESS_TIMEOUT` now says which failure shape it was: the result carries `anyByteAt` (null = the upstream went fully silent, not one raw byte; an epoch-ms value = transport alive with keepalive bytes but no content event) and the 504 response repeats it in an `X-OmniRoute-Any-Byte-At` header for external tooling. The timeout log line names the shape too. Pure telemetry — no routing or retry decision reads it.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** add deAPI (`deapi`), an API-key media provider on its OpenAI-compatible gateway (oai.deapi.ai/v1) — image generation, text-to-speech, transcription, embeddings, and async video through a new `deapi-video-job` preset that downloads the key-gated `/v1/videos/{id}/content` result; the OpenAI-compatible speech path now forwards `instructions` when given ([#18593](https://github.com/cheaper-inference/OmniRoute/pull/18593)) — thanks @Pietrus-914
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** Costs > Pricing gets a Providers "Configured only" filter (providers with a connection, plus no-auth providers that are turned on), and a model search lists only the matching models under each provider ([#18651](https://github.com/cheaper-inference/OmniRoute/pull/18651))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** "Needs verification (N)" status pill on the provider connections list that shows only the Antigravity accounts holding a stored Google verify-account link, so operators can work through `403 VALIDATION_REQUIRED` accounts one by one; hidden while no account needs verification ([#18662](https://github.com/cheaper-inference/OmniRoute/pull/18662)) — thanks @bufftop25
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(combo):** opt-in `OMNIROUTE_COMBO_MAX_DEADLINE_FAILURES` sub-budget terminates a combo with a clean 504 after N stream-readiness deadline failures instead of rotating every remaining target against a stalled upstream ([#18721](https://github.com/cheaper-inference/OmniRoute/pull/18721)) — thanks @jjxyxsjr
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(routing):** add endpoint-specific combo routes with independent targets, strategies and config for Chat, search/fetch, embeddings, rerank, images, video, music, OCR and audio surfaces. `/v1/search`, `/v1/web/fetch`, `/v1/music/generations`, `/v1/music`, `/v1/sound-generation` and `/v1/ocr` resolve saved combo names while preserving native response contracts, account pins and caller key scopes. Mixed combinations filter incompatible targets before credential selection. Related to #10274; fixes #17858.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(translator):** per-node `thinkingReplay` capability declaration (`redacted`/`text`/`none`) on the `modelCompatOverrides` entry, settable through `PUT /api/provider-models`, overrides the provider-prefix assumption about replayed thinking shape — `text` forces plain `thinking` blocks for Claude-shape upstreams that reject `redacted_thinking`, `none` leaves replayed thinking untouched and keeps thinking enabled for upstreams that want no precursor ([#18739](https://github.com/cheaper-inference/OmniRoute/pull/18739)) — thanks @jjxyxsjr
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(vision):** opt-in `OMNIROUTE_IMAGE_NORMALIZATION` normalizes inline base64 images before dispatch (RGB, ≤4096px long edge, ~4MP, baseline JPEG/PNG) so Qwen2-VL-style vision pipelines stop 400ing or hanging on oversized/exotic images ([#18740](https://github.com/cheaper-inference/OmniRoute/pull/18740)) — thanks @jjxyxsjr
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** Costs > Pricing can compare one model across providers: a **View: Compare models** toggle lists each model with every provider offering it, input / output / cached price, cheapest first, unpriced offers marked as such; the Configured-only and Auth filters apply and variants stay on their own row ([#18775](https://github.com/cheaper-inference/OmniRoute/pull/18775), closes [#18642](https://github.com/cheaper-inference/OmniRoute/issues/18642))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** Gemini AI Studio Lyria 3 models (`lyria-3-pro-preview`, `lyria-3-clip-preview`, `lyria-3.5`) are callable through `POST /v1/music/generations` instead of being advertised as music and rejected with `400 Invalid music model` ([#18797](https://github.com/cheaper-inference/OmniRoute/pull/18797)) — thanks @LuisAlejandro
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(gemini):** Pass an explicit per-image `media_resolution` (`low` through `ultra_high`) through the OpenAI to Gemini conversion as `Part.mediaResolution` for inline and remote images; opt-in, and `detail` keeps its meaning ([#18844](https://github.com/cheaper-inference/OmniRoute/pull/18844)) — thanks @Bl0ck154
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(dashboard):** the combo builder shows a Nadir settings section (API key, timeout, self-hosted base URL) when the router strategy is `nadir`, so a dashboard-built combo no longer needs hand-edited JSON or env vars to set `config.nadir` ([#18846](https://github.com/cheaper-inference/OmniRoute/pull/18846)) — thanks @doramirdor
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** add an opt-in schema-driven Fal gateway behind `FAL_NATIVE_ENABLED` (off by default): the `/v1/fal` routes, the `/api/providers/{id}/fal` schema routes, a Fal panel on the provider page and live catalog discovery, plus schema validation of Fal requests on the image, video and music routes. With the flag off, Fal requests keep their established shape, endpoint mapping and response format. ([#18849](https://github.com/cheaper-inference/OmniRoute/pull/18849)) — thanks @KiaroSama
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(executors):** Gzip request bodies of 4096+ characters sent to the official `api.anthropic.com`, as Claude Code 2.1.3xx does. Long agent sessions re-upload 0.5-10 MB of JSON each turn; it compresses 3-4x (gzip level 3: 3 MB in 27 ms). Skipped behind a proxy, TLS impersonation or `NODE_EXTRA_CA_CERTS`. A refused encoding (415, a non-Anthropic 400/403, or an origin JSON-parse 400) is resent uncompressed once and that origin stays uncompressed for one hour; ordinary API errors are never resent. Opt out with `OMNIROUTE_GZIP_REQUEST_BODIES=0`.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(observability):** opt-in V8 heap pressure log: with `OMNIROUTE_HEAP_DIAGNOSTICS_ENABLED=1` the event-loop stall recorder logs heap, RSS and inflight numbers at most once a minute when `heapUsed` passes `OMNIROUTE_HEAP_DIAGNOSTICS_THRESHOLD_MB` (default 900) ([#19054](https://github.com/cheaper-inference/OmniRoute/pull/19054)) — thanks @Bl0ck154
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(usage):** Zed Hosted Models connections show the remaining USD credit on the Provider Limits page when the operator pastes the optional Orb billing portal link into the connection settings, stored as a credential (encrypted at rest, stripped from API responses) and displayed without affecting routing or connection parking ([#19065](https://github.com/cheaper-inference/OmniRoute/pull/19065)) — thanks @wray-lee
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** Upgrade the existing Microsoft 365 Copilot provider with work/school PKCE sign-in, account-safe reauthentication, the documented model catalog, single-generation emulated tools, bounded native turns, distinct model-licence and account-throttle handling, and Copilot safety refusals (`Disengaged`) surfaced as terminal provider safety stops rather than retryable upstream errors. Follow-up requests continue the same Copilot conversation: one that extends the previous reply exactly (same connection, model profile and tool set, unchanged history, and that reply's tool-call ids or text) sends only the new messages instead of opening a new conversation with the whole history, which is what Copilot's per-user thread throttle counts; anything doubtful starts fresh, and a content-less `InternalError` is re-sent once in a fresh conversation and otherwise surfaces as `m365_internal_error`. Continuations live in process memory, so a restart starts fresh conversations. Image input works like the web client: each image (data URL or public HTTPS URL) is uploaded into the turn's conversation and attached to the message, and a failed upload fails the request. `/v1/images/generations` serves `copilot-m365-web/m365-copilot-image` through Copilot's built-in image tool (one turn per image; the artifacts are downloaded with a Designer token minted from the sign-in's refresh token, and a used-up image budget is a 429). Answers keep their web sources: Copilot's inline citation markers become numbered links with `url_citation` annotations instead of leaking as private-use characters, and its reasoning summary is returned as `reasoning_content`. An expired or revoked sign-in is reported as `401 m365_unauthorized` instead of a generic connection failure, and Test Connection fails on an expired sign-in that nothing can refresh, while a signed-in connection's test renews an expired access token instead of answering "Provider test not supported". A refusal carrying `ReasoningTurnExhausted` (the per-account cap on Think deeper turns) is reported as `429 reasoning_turns_exhausted`, not as a model's priority access. The same refusal takes the other `gpt-5.5`/`gpt-5.6` Think deeper models out of rotation on that connection, so a combo does not spend a turn on each. Legacy HAR connections remain supported.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(executors):** opt-in Bun relay (`OPENCODE_FREE_TIER_RELAY_URL`) and canonical OpenCode CLI prompt/tools for gated free-tier OpenCode requests, which the upstream otherwise answers with 429 FreeUsageLimitError to non-Bun clients; calls to injected CLI tools are filtered from the stream; plaintext `http://` relay URLs are accepted for loopback hosts only and a non-loopback relay bind requires `OPENCODE_FREE_RELAY_TOKEN` and a proxy allowlist ([#19128](https://github.com/cheaper-inference/OmniRoute/pull/19128)) — thanks @DavyMassoneto
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(skills):** opt-in `agent-sandbox` runtime for the skill sandbox — `execute_command` / `eval_code` can run in a remote Kubernetes sandbox (kubernetes-sigs/agent-sandbox warm pools, e.g. gVisor) instead of a local container; selected with `SKILLS_SANDBOX_RUNTIME=agent-sandbox`, never auto-detected
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(antigravity):** add opt-in, per-account Antigravity physical-send phase timing diagnostics without logging request content or credentials ([#19133](https://github.com/cheaper-inference/OmniRoute/pull/19133)) — thanks @Bl0ck154
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(antigravity):** Expose physical-send timing diagnostics as a saved Settings → Resilience toggle. New sends use updated values through the settings cache without server restart.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(providers):** add Replicate chat, Cerebrium, Hetzner Inference and Grokified providers, the MarkItDown MCP launcher, and desktop launchers with an Arabic setup guide ([#19206](https://github.com/cheaper-inference/OmniRoute/pull/19206)) — thanks @jowimila
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(api):** Add reusable key policy templates with editable drafts, secret-free capture and atomic key creation ([#19311](https://github.com/cheaper-inference/OmniRoute/pull/19311)) — thanks @Szqub.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(pii):** opt-in reversible PII vault (`PII_REVERSIBLE_VAULT_ENABLED`, default off, needs `PII_REDACTION_ENABLED`): request PII becomes per-request surrogate tokens instead of irreversible placeholders, and the chat handler restores the original values in 2xx responses (SSE split across events and JSON, tool arguments and reasoning included). Providers, fusion judges, logs and caches only see tokens; error bodies keep the tokens; memory, idempotency and semantic-cache writes are skipped for masked turns ([#19326](https://github.com/cheaper-inference/OmniRoute/pull/19326), builds on [#18017](https://github.com/cheaper-inference/OmniRoute/pull/18017)) — thanks @Ardem2025
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(webhooks):** a new `provider.exhausted` webhook event alerts you when every account of a provider is cooling down, at most once per provider every 10 minutes. ([#19566](https://github.com/cheaper-inference/OmniRoute/pull/19566))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(db):** New migrations are named `YYYYMMDDHHMMSS_description.sql` (UTC, `npm run db:new-migration -- <description>`) instead of the next number, so parallel PRs no longer collide. The numbered migrations (`001`–`241`) stay frozen. The runner orders by the numeric value of the prefix. Against the base, the migration gate refuses deleted merged migrations and unsafe renames, and runs a commutation check on out-of-order and edited migrations. Release-Green applies every migration to an empty database and compares with the latest release tag. The order of `RENAMED_MIGRATION_COMPATIBILITY` entries no longer matters: a database whose old PR rows block each other's slots boots instead of stopping with `Cannot reconcile` ([#20169](https://github.com/cheaper-inference/OmniRoute/pull/20169))
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(docker):** releases are also published to the Cheaper Inference Docker Hub organization (`cheaperinference/omniroute`) next to `diegosouzapw/omniroute`, which keeps its pull history and every image; without the org credentials the copy is skipped with a warning, and `docker-org-mirror.yml` republishes a released version later. The desktop app now auto-updates from `cheaper-inference/OmniRoute` ([#20344](https://github.com/cheaper-inference/OmniRoute/pull/20344))
|
||||
@@ -1 +0,0 @@
|
||||
- Add bounded response headers for account fallback count/reasons, same-account retries and routing wait, preserving response routing policies on immutable-header streaming responses.
|
||||
@@ -1 +0,0 @@
|
||||
- **feat(analytics):** split the summary into total tokens, total input, input excluding cache reads, and cached input, with explicit incomplete-data handling and localized explanations while preserving provider accounting.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user