Skip to content

Commit 2b891c3

Browse files
authored
Merge pull request #4 from ampeco/chore/sync-upstream-v7.2.73
Sync upstream v7.2.15 → v7.2.73 (preserve ampeco patches 1-5)
2 parents 02a9ad9 + 5a6c273 commit 2b891c3

436 files changed

Lines changed: 54505 additions & 11855 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Our team doesn't have any GODs or ORACLEs or MIND READERs. Please make sure to a
1818
A clear and concise description of what the bug is.
1919

2020
**CLI Type**
21-
What type of CLI account do you use? (gemini-cli, gemini, codex, claude code or openai-compatibility)
21+
What type of CLI account do you use? (gemini, codex, claude code or openai-compatibility)
2222

2323
**Model Name**
2424
What model are you using? (example: gemini-2.5-pro, claude-sonnet-4-20250514, gpt-5, etc.)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
models_repository="${MODELS_REPOSITORY_URL:-https://github.com/router-for-me/models.git}"
5+
models_ref="${MODELS_REPOSITORY_REF:-main}"
6+
catalog_dir="${MODEL_CATALOG_DIR:-internal/registry/models}"
7+
codex_catalog="$catalog_dir/codex_client_models.json"
8+
codex_candidate="$(mktemp)"
9+
trap 'rm -f "$codex_candidate"' EXIT
10+
11+
git fetch --depth 1 "$models_repository" "$models_ref"
12+
git show FETCH_HEAD:models.json > "$catalog_dir/models.json"
13+
14+
if git show FETCH_HEAD:codex_client_models.json > "$codex_candidate" &&
15+
go run ./cmd/validate_codex_models --file "$codex_candidate"; then
16+
mv "$codex_candidate" "$codex_catalog"
17+
printf 'Refreshed validated Codex client model catalog.\n'
18+
else
19+
printf '::warning::Remote Codex client model catalog is missing or invalid; using embedded fallback.\n'
20+
fi
21+
22+
go run ./cmd/validate_codex_models --file "$codex_catalog"
23+
24+
# --- ampeco Patch 4: strip Claude entries from the antigravity catalog ---
25+
# Antigravity's published catalog advertises Claude models served by Google's
26+
# cloudcode-pa.googleapis.com. With those entries present, an antigravity OAuth
27+
# becomes eligible alongside the Anthropic OAuth pool for `claude-*` selector
28+
# picks; session-affinity then pins entire Claude Code sessions to the
29+
# antigravity OAuth, exhausting its small Sonnet quota within hours. Strip them
30+
# post-refresh so the antigravity OAuth is Gemini-only.
31+
python3 - <<'PY'
32+
import json
33+
p = "internal/registry/models/models.json"
34+
with open(p) as f:
35+
d = json.load(f)
36+
if "antigravity" in d:
37+
before = len(d["antigravity"])
38+
d["antigravity"] = [
39+
m for m in d["antigravity"]
40+
if not (
41+
m.get("id", "").startswith("claude-")
42+
or m.get("type", "") == "claude"
43+
or m.get("owned_by", "") == "anthropic"
44+
)
45+
]
46+
after = len(d["antigravity"])
47+
print(f"antigravity catalog: {before} -> {after} entries ({before - after} claude stripped)")
48+
with open(p, "w") as f:
49+
json.dump(d, f, indent=2)
50+
f.write("\n")
51+
PY

.github/workflows/docker-image.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
cache: true
1823
- name: Refresh models catalog
19-
run: |
20-
git fetch --depth 1 https://github.com/router-for-me/models.git main
21-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
24+
run: bash .github/scripts/refresh-model-catalogs.sh
2225
- name: Set up Docker Buildx
2326
uses: docker/setup-buildx-action@v3
2427
- name: Login to DockerHub
@@ -50,10 +53,13 @@ jobs:
5053
steps:
5154
- name: Checkout
5255
uses: actions/checkout@v4
56+
- name: Set up Go
57+
uses: actions/setup-go@v5
58+
with:
59+
go-version-file: go.mod
60+
cache: true
5361
- name: Refresh models catalog
54-
run: |
55-
git fetch --depth 1 https://github.com/router-for-me/models.git main
56-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
62+
run: bash .github/scripts/refresh-model-catalogs.sh
5763
- name: Set up Docker Buildx
5864
uses: docker/setup-buildx-action@v3
5965
- name: Login to DockerHub

.github/workflows/pr-test-build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v4
15-
- name: Refresh models catalog
16-
run: |
17-
git fetch --depth 1 https://github.com/router-for-me/models.git main
18-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
1915
- name: Set up Go
2016
uses: actions/setup-go@v5
2117
with:
2218
go-version-file: go.mod
2319
cache: true
20+
- name: Refresh models catalog
21+
run: bash .github/scripts/refresh-model-catalogs.sh
2422
- name: Build
2523
run: |
2624
go build -o test-output ./cmd/server

.github/workflows/release.yaml

Lines changed: 21 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -127,51 +127,16 @@ jobs:
127127
- uses: actions/checkout@v6
128128
with:
129129
fetch-depth: 0
130+
- uses: actions/setup-go@v6
131+
with:
132+
go-version: ${{ env.GO_VERSION }}
133+
cache: true
130134
- name: Refresh models catalog
131135
shell: bash
132-
run: |
133-
set -euo pipefail
134-
git fetch --depth 1 https://github.com/router-for-me/models.git main
135-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
136-
- name: Strip Claude entries from antigravity catalog (ampeco Patch 4)
137-
# Antigravity's published catalog advertises Claude models served by
138-
# Google's cloudcode-pa.googleapis.com. With those entries present, an
139-
# antigravity OAuth becomes eligible alongside the Anthropic OAuth pool
140-
# for `claude-*` selector picks. Session-affinity then pins entire
141-
# Claude Code sessions (parent + sub-agents) to the antigravity OAuth
142-
# whenever the parent request was a Gemini call, exhausting
143-
# Antigravity's small Sonnet quota within hours. Strip them post-refresh
144-
# so the antigravity OAuth is Gemini-only.
145-
shell: bash
146-
run: |
147-
python3 - <<'PY'
148-
import json
149-
p = "internal/registry/models/models.json"
150-
with open(p) as f:
151-
d = json.load(f)
152-
if "antigravity" in d:
153-
before = len(d["antigravity"])
154-
d["antigravity"] = [
155-
m for m in d["antigravity"]
156-
if not (
157-
m.get("id", "").startswith("claude-")
158-
or m.get("type", "") == "claude"
159-
or m.get("owned_by", "") == "anthropic"
160-
)
161-
]
162-
after = len(d["antigravity"])
163-
print(f"antigravity catalog: {before} -> {after} entries ({before - after} claude stripped)")
164-
with open(p, "w") as f:
165-
json.dump(d, f, indent=2)
166-
f.write("\n")
167-
PY
136+
run: bash .github/scripts/refresh-model-catalogs.sh
168137
- name: Fetch tags
169138
shell: bash
170139
run: git fetch --force --tags
171-
- uses: actions/setup-go@v6
172-
with:
173-
go-version: ${{ env.GO_VERSION }}
174-
cache: true
175140
- uses: actions/cache@v4
176141
with:
177142
path: |
@@ -289,44 +254,13 @@ jobs:
289254
- uses: actions/checkout@v6
290255
with:
291256
fetch-depth: 0
257+
- uses: actions/setup-go@v6
258+
with:
259+
go-version: ${{ env.GO_VERSION }}
260+
cache: true
292261
- name: Refresh models catalog
293262
shell: bash
294-
run: |
295-
set -euo pipefail
296-
git fetch --depth 1 https://github.com/router-for-me/models.git main
297-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
298-
- name: Strip Claude entries from antigravity catalog (ampeco Patch 4)
299-
# Antigravity's published catalog advertises Claude models served by
300-
# Google's cloudcode-pa.googleapis.com. With those entries present, an
301-
# antigravity OAuth becomes eligible alongside the Anthropic OAuth pool
302-
# for `claude-*` selector picks. Session-affinity then pins entire
303-
# Claude Code sessions (parent + sub-agents) to the antigravity OAuth
304-
# whenever the parent request was a Gemini call, exhausting
305-
# Antigravity's small Sonnet quota within hours. Strip them post-refresh
306-
# so the antigravity OAuth is Gemini-only.
307-
shell: bash
308-
run: |
309-
python3 - <<'PY'
310-
import json
311-
p = "internal/registry/models/models.json"
312-
with open(p) as f:
313-
d = json.load(f)
314-
if "antigravity" in d:
315-
before = len(d["antigravity"])
316-
d["antigravity"] = [
317-
m for m in d["antigravity"]
318-
if not (
319-
m.get("id", "").startswith("claude-")
320-
or m.get("type", "") == "claude"
321-
or m.get("owned_by", "") == "anthropic"
322-
)
323-
]
324-
after = len(d["antigravity"])
325-
print(f"antigravity catalog: {before} -> {after} entries ({before - after} claude stripped)")
326-
with open(p, "w") as f:
327-
json.dump(d, f, indent=2)
328-
f.write("\n")
329-
PY
263+
run: bash .github/scripts/refresh-model-catalogs.sh
330264
- name: Fetch tags
331265
shell: bash
332266
run: git fetch --force --tags
@@ -452,51 +386,16 @@ jobs:
452386
- uses: actions/checkout@v6
453387
with:
454388
fetch-depth: 0
389+
- uses: actions/setup-go@v6
390+
with:
391+
go-version: ${{ env.GO_VERSION }}
392+
cache: true
455393
- name: Refresh models catalog
456394
shell: bash
457-
run: |
458-
set -euo pipefail
459-
git fetch --depth 1 https://github.com/router-for-me/models.git main
460-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
461-
- name: Strip Claude entries from antigravity catalog (ampeco Patch 4)
462-
# Antigravity's published catalog advertises Claude models served by
463-
# Google's cloudcode-pa.googleapis.com. With those entries present, an
464-
# antigravity OAuth becomes eligible alongside the Anthropic OAuth pool
465-
# for `claude-*` selector picks. Session-affinity then pins entire
466-
# Claude Code sessions (parent + sub-agents) to the antigravity OAuth
467-
# whenever the parent request was a Gemini call, exhausting
468-
# Antigravity's small Sonnet quota within hours. Strip them post-refresh
469-
# so the antigravity OAuth is Gemini-only.
470-
shell: bash
471-
run: |
472-
python3 - <<'PY'
473-
import json
474-
p = "internal/registry/models/models.json"
475-
with open(p) as f:
476-
d = json.load(f)
477-
if "antigravity" in d:
478-
before = len(d["antigravity"])
479-
d["antigravity"] = [
480-
m for m in d["antigravity"]
481-
if not (
482-
m.get("id", "").startswith("claude-")
483-
or m.get("type", "") == "claude"
484-
or m.get("owned_by", "") == "anthropic"
485-
)
486-
]
487-
after = len(d["antigravity"])
488-
print(f"antigravity catalog: {before} -> {after} entries ({before - after} claude stripped)")
489-
with open(p, "w") as f:
490-
json.dump(d, f, indent=2)
491-
f.write("\n")
492-
PY
395+
run: bash .github/scripts/refresh-model-catalogs.sh
493396
- name: Fetch tags
494397
shell: bash
495398
run: git fetch --force --tags
496-
- uses: actions/setup-go@v6
497-
with:
498-
go-version: ${{ env.GO_VERSION }}
499-
cache: true
500399
- uses: actions/cache@v4
501400
with:
502401
path: |
@@ -594,7 +493,7 @@ jobs:
594493
runs-on: ubuntu-latest
595494
env:
596495
TARGET: ${{ matrix.target }}
597-
GOARCH: ${{ matrix.goarch }}
496+
TARGET_GOARCH: ${{ matrix.goarch }}
598497
ASSET_ARCH: ${{ matrix.asset_arch }}
599498
ASSET_SUFFIX: ${{ matrix.asset_suffix }}
600499
strategy:
@@ -615,47 +514,14 @@ jobs:
615514
- uses: actions/checkout@v6
616515
with:
617516
fetch-depth: 0
618-
- name: Refresh models catalog
619-
run: |
620-
git fetch --depth 1 https://github.com/router-for-me/models.git main
621-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
622-
- name: Strip Claude entries from antigravity catalog (ampeco Patch 4)
623-
# Antigravity's published catalog advertises Claude models served by
624-
# Google's cloudcode-pa.googleapis.com. With those entries present, an
625-
# antigravity OAuth becomes eligible alongside the Anthropic OAuth pool
626-
# for `claude-*` selector picks. Session-affinity then pins entire
627-
# Claude Code sessions (parent + sub-agents) to the antigravity OAuth
628-
# whenever the parent request was a Gemini call, exhausting
629-
# Antigravity's small Sonnet quota within hours. Strip them post-refresh
630-
# so the antigravity OAuth is Gemini-only.
631-
run: |
632-
python3 - <<'PY'
633-
import json
634-
p = "internal/registry/models/models.json"
635-
with open(p) as f:
636-
d = json.load(f)
637-
if "antigravity" in d:
638-
before = len(d["antigravity"])
639-
d["antigravity"] = [
640-
m for m in d["antigravity"]
641-
if not (
642-
m.get("id", "").startswith("claude-")
643-
or m.get("type", "") == "claude"
644-
or m.get("owned_by", "") == "anthropic"
645-
)
646-
]
647-
after = len(d["antigravity"])
648-
print(f"antigravity catalog: {before} -> {after} entries ({before - after} claude stripped)")
649-
with open(p, "w") as f:
650-
json.dump(d, f, indent=2)
651-
f.write("\n")
652-
PY
653-
- name: Fetch tags
654-
run: git fetch --force --tags
655517
- uses: actions/setup-go@v6
656518
with:
657519
go-version: ${{ env.GO_VERSION }}
658520
cache: true
521+
- name: Refresh models catalog
522+
run: bash .github/scripts/refresh-model-catalogs.sh
523+
- name: Fetch tags
524+
run: git fetch --force --tags
659525
- uses: actions/cache@v4
660526
with:
661527
path: |
@@ -710,7 +576,7 @@ jobs:
710576
run: |
711577
set -euo pipefail
712578
mkdir -p "dist/${TARGET}/bin"
713-
CGO_ENABLED=0 GOOS=freebsd GOARCH="$GOARCH" go build -buildvcs=false \
579+
CGO_ENABLED=0 GOOS=freebsd GOARCH="$TARGET_GOARCH" go build -buildvcs=false \
714580
-ldflags="-s -w -X main.Version=${RELEASE_VERSION} -X main.Commit=${COMMIT} -X main.BuildDate=${BUILD_DATE}" \
715581
-o "dist/${TARGET}/bin/cli-proxy-api" ./cmd/server/
716582
- name: Package FreeBSD archive

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static/*
2525

2626
# Authentication data
2727
auths/*
28+
/auths
2829
!auths/.gitkeep
2930

3031
# Documentation
@@ -38,6 +39,7 @@ GEMINI.md
3839
.worktrees/
3940
.codex/*
4041
.claude/*
42+
.claude
4143
.gemini/*
4244
.serena/*
4345
.agent/*

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ When the credential's API key starts with `sk-ant-oat01-`, route via `Authorizat
2626

2727
### Patch 4 — strip Claude entries from the `antigravity` model catalog
2828

29-
`internal/registry/models/models.json` and `.github/workflows/release.yaml` (post-refresh step).
29+
`internal/registry/models/models.json` and `.github/scripts/refresh-model-catalogs.sh` (post-refresh strip; the script is invoked by every build job in `release.yaml`).
3030

3131
Antigravity's published catalog includes `claude-opus-4-6-thinking` and `claude-sonnet-4-6` because Google's AI Code Assist tier resells Claude models via `cloudcode-pa.googleapis.com`. With those entries present, an antigravity OAuth becomes eligible alongside the Anthropic OAuth pool when the selector picks for `claude-*` routes. Session-affinity then pins entire Claude Code sessions (parent + sub-agents) to the antigravity OAuth whenever the parent request was a Gemini call, exhausting Antigravity's small Sonnet quota within hours.
3232

33-
Strip every entry whose `id` starts with `claude-`, whose `type` is `claude`, or whose `owned_by` is `anthropic` from the `antigravity` array. Applied both to the in-tree `models.json` (so `go test ./...` and local dev see the patched shape) and to the release workflow's post-refresh step (so upstream catalog refreshes during tagged builds re-apply the strip automatically). After the patch the antigravity OAuth is Gemini-only and Claude requests fall through to the Anthropic OAuth pool.
33+
Strip every entry whose `id` starts with `claude-`, whose `type` is `claude`, or whose `owned_by` is `anthropic` from the `antigravity` array. Applied both to the in-tree `models.json` (so `go test ./...` and local dev see the patched shape) and to `.github/scripts/refresh-model-catalogs.sh` (so upstream catalog refreshes during tagged builds re-apply the strip automatically). After the patch the antigravity OAuth is Gemini-only and Claude requests fall through to the Anthropic OAuth pool.
3434

3535
## Tests
3636

0 commit comments

Comments
 (0)