Skip to content

Commit 654a304

Browse files
authored
Merge pull request #237 from code-yeongyu/sync/upstream-main-20260718
merge: sync main with upstream/main
2 parents d18032c + 2532485 commit 654a304

162 files changed

Lines changed: 8008 additions & 19416 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/APPROVED_CONTRIBUTORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,7 @@ vibeinging pr
275275
DivineDominion pr
276276

277277
ananthakumaran pr
278+
279+
andrebreijao pr
280+
281+
anh-chu pr

.github/workflows/publish-model-catalog.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ on:
1313
- 'package.json'
1414
- 'packages/ai/**'
1515
- 'scripts/publish-model-catalog.mjs'
16+
# GitHub schedules use UTC. Run hourly candidates across the CET/CEST
17+
# boundaries; the publish job only uploads at 10:17, 12:17, and 14:17
18+
# Europe/Vienna time.
1619
schedule:
17-
- cron: '17 */4 * * *'
20+
- cron: '17 8-13 * * 1-5'
1821
workflow_dispatch:
1922
inputs:
2023
source_ref:
@@ -36,7 +39,7 @@ jobs:
3639
if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') }}
3740
runs-on: ubuntu-latest
3841
env:
39-
SOURCE_REF: ${{ github.event.workflow_run.head_sha || github.event.pull_request.head.sha || inputs.source_ref || github.sha }}
42+
SOURCE_REF: ${{ github.event.workflow_run.head_sha || inputs.source_ref || github.sha }}
4043
steps:
4144
- name: Checkout
4245
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -103,7 +106,38 @@ jobs:
103106
- name: Verify AWS CLI
104107
run: aws --version
105108

109+
- name: Check publication window
110+
id: publication-window
111+
env:
112+
EVENT_NAME: ${{ github.event_name }}
113+
MANUAL_PUBLISH: ${{ inputs.publish || false }}
114+
run: |
115+
set -euo pipefail
116+
117+
local_day="$(TZ=Europe/Vienna date +%u)"
118+
local_hour_text="$(TZ=Europe/Vienna date +%H)"
119+
local_hour="$((10#$local_hour_text))"
120+
local_time="$(TZ=Europe/Vienna date '+%Y-%m-%d %H:%M:%S %Z')"
121+
allowed=false
122+
reason="outside the Monday-Friday 10:00-15:00 Europe/Vienna publication window"
123+
124+
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$MANUAL_PUBLISH" == "true" ]]; then
125+
allowed=true
126+
reason="manual publication"
127+
elif (( local_day <= 5 && local_hour >= 10 && local_hour < 15 )); then
128+
if [[ "$EVENT_NAME" != "schedule" ]] || (( (local_hour - 10) % 2 == 0 )); then
129+
allowed=true
130+
reason="business-hours publication"
131+
else
132+
reason="not a scheduled 10:17, 12:17, or 14:17 Europe/Vienna publication"
133+
fi
134+
fi
135+
136+
echo "allowed=$allowed" >> "$GITHUB_OUTPUT"
137+
echo "R2 publication allowed: $allowed ($reason; local time: $local_time)"
138+
106139
- name: Publish model catalog to R2
140+
if: steps.publication-window.outputs.allowed == 'true'
107141
run: |
108142
node scripts/publish-model-catalog.mjs \
109143
--input .artifacts/model-catalog \

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"check:install-lock:coding-agent": "node scripts/generate-coding-agent-install-lock.mjs --check",
2828
"check:ts-imports": "node scripts/check-ts-relative-imports.mjs",
2929
"verify:pms": "node scripts/verify-package-managers.mjs",
30+
"generate:models": "npm --prefix packages/ai run generate-models && npm --prefix packages/ai run generate-image-models",
3031
"generate:model-catalog": "npm --prefix packages/ai run generate-model-catalog",
32+
"diff:model-catalog": "node scripts/diff-model-catalog.mjs",
3133
"check:model-catalog": "node scripts/publish-model-catalog.mjs --input .artifacts/model-catalog --dry-run",
3234
"profile:tui": "node scripts/profile-coding-agent-node.mjs --mode tui",
3335
"profile:rpc": "node scripts/profile-coding-agent-node.mjs --mode rpc",

packages/ai/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
### Fixed
1414

15+
- Fixed GitHub Copilot long-context pricing tiers in generated model metadata.
16+
- Fixed Kimi Coding subscription models to report API-equivalent implied costs when models.dev reports zero pricing.
17+
- Fixed OpenAI Responses early stream endings to be classified as retryable provider errors.
18+
1519
### Removed
1620

1721
## [2026.7.17-5] - 2026-07-17

packages/ai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ Add a lazy wrapper `src/api/<api-id>.lazy.ts` (`<name>Api()` via `lazyApi()`) so
15531553
#### 3. Model Generation (`scripts/generate-models.ts`, `scripts/generate-image-models.ts`)
15541554

15551555
- Add logic to fetch and parse models from the provider's source (e.g., models.dev API)
1556-
- Map chat/tool-capable provider model data to the standardized `Model` interface via `scripts/generate-models.ts`; regeneration emits `src/providers/<id>.models.ts` and the aggregator
1556+
- Map chat/tool-capable provider model data to the standardized `Model` interface via `scripts/generate-models.ts`; regeneration emits structural `src/providers/<id>.models.ts` shards, committed generated values in `src/providers/data/`, and the aggregator
15571557
- Map image-generation provider model data to the standardized `ImagesModel` interface via `scripts/generate-image-models.ts`
15581558
- Handle provider-specific quirks (pricing format, capability flags, model ID transformations)
15591559

packages/ai/changes.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# changes.md — ai
22

3+
## Commit generated model catalog data for reproducible builds (2026-07-18)
4+
5+
### What changed
6+
7+
- `../../.gitignore`: removed the `packages/ai/src/providers/data/` ignore rule so generated catalog JSON is committed,
8+
reviewed source, matching `src/models.generated.ts`.
9+
- `package.json`: the ordinary `build` no longer runs `generate-models`; it compiles, restores the CLI executable bit,
10+
and copies the committed `src/providers/data/` into `dist`. Networked regeneration stays explicit via the
11+
`generate-models` script, the root `generate:models` workflow, release tooling, and `prepublishOnly`.
12+
- `../../scripts/build-all.test.mjs`: the AI build config regression now asserts the ordinary build skips networked
13+
generation, keeps the committed-data copy step, retains the explicit generator workflow, and leaves catalog JSON
14+
unignored.
15+
- `README.md`: model-generation guidance now describes `src/providers/data/` as committed generated values.
16+
17+
### Why
18+
19+
- The ordinary AI build fetched models.dev and provider APIs to regenerate ignored JSON catalog data, so a build could
20+
emit an unreviewed or different catalog and failed entirely offline. The committed `.models.ts` shards import the
21+
JSON at compile time, so the catalog must be committed generated source for the build to be reproducible.
22+
23+
### Why extension system couldn't handle this
24+
25+
- Model inventory is generated before the coding-agent extension runtime is loaded, and package build scripts run
26+
before any extension hook exists.
27+
28+
### Modified upstream files
29+
30+
- `package.json`
31+
- `README.md`
32+
- `../../.gitignore`
33+
- `../../scripts/build-all.test.mjs`
34+
35+
### Expected merge conflict zones
36+
37+
- LOW: AI package build scripts if upstream changes the compiler command or bin generation flow.
38+
339
## Preserve stable Kimi Coding model IDs during catalog generation (2026-07-17)
440

541
### What changed

packages/ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"generate-models": "tsx scripts/generate-models.ts",
5454
"generate-model-catalog": "tsx scripts/generate-models.ts --strict --json-only --json-output ../../.artifacts/model-catalog",
5555
"generate-image-models": "tsx scripts/generate-image-models.ts",
56-
"build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js",
56+
"build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && shx rm -rf dist/providers/data && shx cp -r src/providers/data dist/providers/data",
5757
"dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
5858
"dev:tsc": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
5959
"test": "vitest --run",

0 commit comments

Comments
 (0)